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> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
This commit is contained in:
parent
a4aadc9311
commit
4ee99f7e2e
|
@ -1062,15 +1062,15 @@ static int mx3fb_pan_display(struct fb_var_screeninfo *var,
|
||||||
y_bottom = var->yoffset;
|
y_bottom = var->yoffset;
|
||||||
|
|
||||||
if (!(var->vmode & FB_VMODE_YWRAP))
|
if (!(var->vmode & FB_VMODE_YWRAP))
|
||||||
y_bottom += var->yres;
|
y_bottom += fbi->var.yres;
|
||||||
|
|
||||||
if (y_bottom > fbi->var.yres_virtual)
|
if (y_bottom > fbi->var.yres_virtual)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
mutex_lock(&mx3_fbi->mutex);
|
mutex_lock(&mx3_fbi->mutex);
|
||||||
|
|
||||||
offset = (var->yoffset * var->xres_virtual + var->xoffset) *
|
offset = var->yoffset * fbi->fix.line_length
|
||||||
(var->bits_per_pixel / 8);
|
+ var->xoffset * (fbi->var.bits_per_pixel / 8);
|
||||||
base = fbi->fix.smem_start + offset;
|
base = fbi->fix.smem_start + offset;
|
||||||
|
|
||||||
dev_dbg(fbi->device, "Updating SDC BG buf %d address=0x%08lX\n",
|
dev_dbg(fbi->device, "Updating SDC BG buf %d address=0x%08lX\n",
|
||||||
|
|
Loading…
Reference in New Issue