Commit f5b9cc6a authored by Laurent Pinchart's avatar Laurent Pinchart

intelfb: 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.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
parent 09a9168d
...@@ -390,12 +390,12 @@ int intelfbhw_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) ...@@ -390,12 +390,12 @@ int intelfbhw_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
xoffset = ROUND_DOWN_TO(var->xoffset, 8); xoffset = ROUND_DOWN_TO(var->xoffset, 8);
yoffset = var->yoffset; yoffset = var->yoffset;
if ((xoffset + var->xres > var->xres_virtual) || if ((xoffset + info->var.xres > info->var.xres_virtual) ||
(yoffset + var->yres > var->yres_virtual)) (yoffset + info->var.yres > info->var.yres_virtual))
return -EINVAL; return -EINVAL;
offset = (yoffset * dinfo->pitch) + offset = (yoffset * dinfo->pitch) +
(xoffset * var->bits_per_pixel) / 8; (xoffset * info->var.bits_per_pixel) / 8;
offset += dinfo->fb.offset << 12; offset += dinfo->fb.offset << 12;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment