From a1655100ddfa10829b7d3b055611f268a82e335a Mon Sep 17 00:00:00 2001 From: Heiko Stübner Date: Fri, 22 Mar 2013 15:13:02 +0100 Subject: AUO-K190x: Use correct line length MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously all functions that used the line length used xres directly, thus hardcoding a 8bits per pixel value. This patch calculates the correct line length according to the actual bits per pixel value and changes all line length users to use the calculated line length value. Signed-off-by: Heiko Stübner Signed-off-by: Tomi Valkeinen --- drivers/video/auo_k1900fb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/video/auo_k1900fb.c') diff --git a/drivers/video/auo_k1900fb.c b/drivers/video/auo_k1900fb.c index 1a9ac6e1f4b3..d572d3e9c502 100644 --- a/drivers/video/auo_k1900fb.c +++ b/drivers/video/auo_k1900fb.c @@ -82,6 +82,7 @@ static void auok1900_update_region(struct auok190xfb_par *par, int mode, struct device *dev = par->info->device; unsigned char *buf = (unsigned char *)par->info->screen_base; int xres = par->info->var.xres; + int line_length = par->info->fix.line_length; u16 args[4]; pm_runtime_get_sync(dev); @@ -100,9 +101,9 @@ static void auok1900_update_region(struct auok190xfb_par *par, int mode, args[1] = y1 + 1; args[2] = xres; args[3] = y2 - y1; - buf += y1 * xres; + buf += y1 * line_length; auok190x_send_cmdargs_pixels(par, AUOK1900_CMD_PARTIALDISP, 4, args, - ((y2 - y1) * xres)/2, (u16 *) buf); + ((y2 - y1) * line_length)/2, (u16 *) buf); auok190x_send_command(par, AUOK190X_CMD_DATA_STOP); par->update_cnt++; -- cgit v1.2.3