aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/auo_k1901fb.c
diff options
context:
space:
mode:
authorHeiko Stübner <heiko@sntech.de>2013-03-22 10:13:02 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-04-04 06:08:06 -0400
commita1655100ddfa10829b7d3b055611f268a82e335a (patch)
treeb00af82e6d7670881b27e83ab47490ed9a7d25fc /drivers/video/auo_k1901fb.c
parent07961ac7c0ee8b546658717034fe692fd12eefa9 (diff)
AUO-K190x: Use correct line length
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 <heiko@sntech.de> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/auo_k1901fb.c')
-rw-r--r--drivers/video/auo_k1901fb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/video/auo_k1901fb.c b/drivers/video/auo_k1901fb.c
index d1db1653cd88..9efbe2763447 100644
--- a/drivers/video/auo_k1901fb.c
+++ b/drivers/video/auo_k1901fb.c
@@ -121,6 +121,7 @@ static void auok1901_update_region(struct auok190xfb_par *par, int mode,
121 struct device *dev = par->info->device; 121 struct device *dev = par->info->device;
122 unsigned char *buf = (unsigned char *)par->info->screen_base; 122 unsigned char *buf = (unsigned char *)par->info->screen_base;
123 int xres = par->info->var.xres; 123 int xres = par->info->var.xres;
124 int line_length = par->info->fix.line_length;
124 u16 args[5]; 125 u16 args[5];
125 126
126 pm_runtime_get_sync(dev); 127 pm_runtime_get_sync(dev);
@@ -139,9 +140,9 @@ static void auok1901_update_region(struct auok190xfb_par *par, int mode,
139 args[1] = y1 + 1; 140 args[1] = y1 + 1;
140 args[2] = xres; 141 args[2] = xres;
141 args[3] = y2 - y1; 142 args[3] = y2 - y1;
142 buf += y1 * xres; 143 buf += y1 * line_length;
143 auok190x_send_cmdargs_pixels_nowait(par, AUOK1901_CMD_DMA_START, 4, 144 auok190x_send_cmdargs_pixels_nowait(par, AUOK1901_CMD_DMA_START, 4,
144 args, ((y2 - y1) * xres)/2, 145 args, ((y2 - y1) * line_length)/2,
145 (u16 *) buf); 146 (u16 *) buf);
146 auok190x_send_command_nowait(par, AUOK190X_CMD_DATA_STOP); 147 auok190x_send_command_nowait(par, AUOK190X_CMD_DATA_STOP);
147 148