diff options
author | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2011-05-23 17:39:58 -0400 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2011-05-27 14:51:29 -0400 |
commit | d933990c57b498c092ceef591c7c5d69dbfe9f30 (patch) | |
tree | f00a2b7fd6e17152b6ed908f5aebd77c00698a05 /drivers/video/via | |
parent | 8aa4d96fe3e4cda9a6469b22b3f017ed30996b10 (diff) |
viafb: use display information in info not in var for panning
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
Diffstat (limited to 'drivers/video/via')
-rw-r--r-- | drivers/video/via/viafbdev.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c index 3114a8755c13..aa87529d7d6a 100644 --- a/drivers/video/via/viafbdev.c +++ b/drivers/video/via/viafbdev.c | |||
@@ -348,8 +348,9 @@ static int viafb_pan_display(struct fb_var_screeninfo *var, | |||
348 | struct fb_info *info) | 348 | struct fb_info *info) |
349 | { | 349 | { |
350 | struct viafb_par *viapar = info->par; | 350 | struct viafb_par *viapar = info->par; |
351 | u32 vram_addr = (var->yoffset * var->xres_virtual + var->xoffset) | 351 | u32 vram_addr = viapar->vram_addr |
352 | * (var->bits_per_pixel / 8) + viapar->vram_addr; | 352 | + var->yoffset * info->fix.line_length |
353 | + var->xoffset * info->var.bits_per_pixel / 8; | ||
353 | 354 | ||
354 | DEBUG_MSG(KERN_DEBUG "viafb_pan_display, address = %d\n", vram_addr); | 355 | DEBUG_MSG(KERN_DEBUG "viafb_pan_display, address = %d\n", vram_addr); |
355 | if (!viafb_dual_fb) { | 356 | if (!viafb_dual_fb) { |