From 34e1b6921f2137ed89ab7e2d2ca0303728b71339 Mon Sep 17 00:00:00 2001 From: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Date: Sat, 9 Aug 2014 00:19:19 +0200 Subject: [PATCH] exynos: font: use restrict for src/dst in put_glyph_rgba4444 This should help the compiler to generate better code for memory access. --- gfx/exynos_gfx.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/gfx/exynos_gfx.c b/gfx/exynos_gfx.c index c7483d8400..a5c806741a 100644 --- a/gfx/exynos_gfx.c +++ b/gfx/exynos_gfx.c @@ -373,16 +373,15 @@ static int clear_buffer(struct g2d_context *g2d, struct g2d_image *img) { } /* Put a font glyph at a position in the buffer that is backing the G2D font image object. */ -static void put_glyph_rgba4444(struct exynos_data *pdata, const uint8_t *src, uint16_t color, - unsigned g_width, unsigned g_height, unsigned g_pitch, - unsigned dst_x, unsigned dst_y) { +static void put_glyph_rgba4444(struct exynos_data *pdata, const uint8_t *__restrict__ src, + uint16_t color, unsigned g_width, unsigned g_height, + unsigned g_pitch, unsigned dst_x, unsigned dst_y) { const enum exynos_image_type buf_type = defaults[exynos_image_font].buf_type; const unsigned buf_width = pdata->src[exynos_image_font]->width; unsigned x, y; - uint16_t *dst; - - dst = (uint16_t*)pdata->buf[buf_type]->vaddr + dst_y * buf_width + dst_x; + uint16_t *__restrict__ dst = (uint16_t*)pdata->buf[buf_type]->vaddr + + dst_y * buf_width + dst_x; for (y = 0; y < g_height; ++y, src += g_pitch, dst += buf_width) { for (x = 0; x < g_width; ++x) {