Skip to content

Commit

Permalink
mx3fb: use display information in info not in var for panning
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Laurent Pinchart committed Aug 19, 2011
1 parent 23dc8b1 commit 9f1b3eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/video/mx3fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1062,15 +1062,15 @@ static int mx3fb_pan_display(struct fb_var_screeninfo *var,
y_bottom = var->yoffset;

if (!(var->vmode & FB_VMODE_YWRAP))
y_bottom += var->yres;
y_bottom += fbi->var.yres;

if (y_bottom > fbi->var.yres_virtual)
return -EINVAL;

mutex_lock(&mx3_fbi->mutex);

offset = (var->yoffset * var->xres_virtual + var->xoffset) *
(var->bits_per_pixel / 8);
offset = var->yoffset * fbi->fix.line_length
+ var->xoffset * (fbi->var.bits_per_pixel / 8);
base = fbi->fix.smem_start + offset;

dev_dbg(fbi->device, "Updating SDC BG buf %d address=0x%08lX\n",
Expand Down

0 comments on commit 9f1b3eb

Please sign in to comment.