aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2011-05-23 21:39:58 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-11 09:36:12 -0800
commitcdf3e3448744d14b6307dfc7f7203cba6fecf199 (patch)
tree12368b676f1fc02981953eb1c441e7d18d12b7d2 /drivers
parent3f199a7d6f2c769131f1c0dda2eb9b30d1e21617 (diff)
downloadkernel_samsung_crespo-cdf3e3448744d14b6307dfc7f7203cba6fecf199.zip
kernel_samsung_crespo-cdf3e3448744d14b6307dfc7f7203cba6fecf199.tar.gz
kernel_samsung_crespo-cdf3e3448744d14b6307dfc7f7203cba6fecf199.tar.bz2
viafb: use display information in info not in var for panning
commit d933990c57b498c092ceef591c7c5d69dbfe9f30 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/via/viafbdev.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index cf43c80..518f3ff 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,
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) {