aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/mx3fb.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2011-05-25 05:34:52 -0400
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2011-08-19 04:32:52 -0400
commit9f1b3ebbce04dc61986a1b3b41b0f1b1a77a5cc4 (patch)
tree86085e8614b383f2c3a41865f0a9bd9ebb7b7020 /drivers/video/mx3fb.c
parent23dc8b1c07f75427510d56fa7c263dd1371ec2e4 (diff)
mx3fb: use display information in info not in var for panning
We must not use any information in the passed var besides xoffset, yoffset and vmode as otherwise applications might abuse it. Also use the aligned fix.line_length and not the (possible) unaligned xres_virtual. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Diffstat (limited to 'drivers/video/mx3fb.c')
-rw-r--r--drivers/video/mx3fb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c
index 7e3a490e8d76..bd768588cf10 100644
--- a/drivers/video/mx3fb.c
+++ b/drivers/video/mx3fb.c
@@ -1062,15 +1062,15 @@ static int mx3fb_pan_display(struct fb_var_screeninfo *var,
1062 y_bottom = var->yoffset; 1062 y_bottom = var->yoffset;
1063 1063
1064 if (!(var->vmode & FB_VMODE_YWRAP)) 1064 if (!(var->vmode & FB_VMODE_YWRAP))
1065 y_bottom += var->yres; 1065 y_bottom += fbi->var.yres;
1066 1066
1067 if (y_bottom > fbi->var.yres_virtual) 1067 if (y_bottom > fbi->var.yres_virtual)
1068 return -EINVAL; 1068 return -EINVAL;
1069 1069
1070 mutex_lock(&mx3_fbi->mutex); 1070 mutex_lock(&mx3_fbi->mutex);
1071 1071
1072 offset = (var->yoffset * var->xres_virtual + var->xoffset) * 1072 offset = var->yoffset * fbi->fix.line_length
1073 (var->bits_per_pixel / 8); 1073 + var->xoffset * (fbi->var.bits_per_pixel / 8);
1074 base = fbi->fix.smem_start + offset; 1074 base = fbi->fix.smem_start + offset;
1075 1075
1076 dev_dbg(fbi->device, "Updating SDC BG buf %d address=0x%08lX\n", 1076 dev_dbg(fbi->device, "Updating SDC BG buf %d address=0x%08lX\n",