Skip to content

Commit

Permalink
viafb: use display information in info not in var for panning
Browse files Browse the repository at this point in the history
As Laurent pointed out 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: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: stable@kernel.org
  • Loading branch information
Florian Tobias Schandinat authored and Florian Tobias Schandinat committed May 27, 2011
1 parent 8aa4d96 commit d933990
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/video/via/viafbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,9 @@ static int viafb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info)
{
struct viafb_par *viapar = info->par;
u32 vram_addr = (var->yoffset * var->xres_virtual + var->xoffset)
* (var->bits_per_pixel / 8) + viapar->vram_addr;
u32 vram_addr = viapar->vram_addr
+ var->yoffset * info->fix.line_length
+ var->xoffset * info->var.bits_per_pixel / 8;

DEBUG_MSG(KERN_DEBUG "viafb_pan_display, address = %d\n", vram_addr);
if (!viafb_dual_fb) {
Expand Down

0 comments on commit d933990

Please sign in to comment.