From e1599cf8c7ab93cb4bbd67516f5c989211335df1 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 25 May 2011 11:34:52 +0200 Subject: savagefb: 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. Also use the aligned fix.line_length and not the (possible) unaligned xres_virtual. Signed-off-by: Laurent Pinchart Reviewed-by: Tormod Volden --- drivers/video/savage/savagefb_driver.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'drivers/video/savage') diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c index 4de541ca9c52..beb495044b24 100644 --- a/drivers/video/savage/savagefb_driver.c +++ b/drivers/video/savage/savagefb_driver.c @@ -1477,15 +1477,9 @@ static void savagefb_set_par_int(struct savagefb_par *par, struct savage_reg *r vgaHWProtect(par, 0); } -static void savagefb_update_start(struct savagefb_par *par, - struct fb_var_screeninfo *var) +static void savagefb_update_start(struct savagefb_par *par, int base) { - int base; - - base = ((var->yoffset * var->xres_virtual + (var->xoffset & ~1)) - * ((var->bits_per_pixel+7) / 8)) >> 2; - - /* now program the start address registers */ + /* program the start address registers */ vga_out16(0x3d4, (base & 0x00ff00) | 0x0c, par); vga_out16(0x3d4, ((base & 0x00ff) << 8) | 0x0d, par); vga_out8(0x3d4, 0x69, par); @@ -1550,8 +1544,12 @@ static int savagefb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) { struct savagefb_par *par = info->par; + int base; + + base = (var->yoffset * info->fix.line_length + + (var->xoffset & ~1) * ((info->var.bits_per_pixel+7) / 8)) >> 2; - savagefb_update_start(par, var); + savagefb_update_start(par, base); return 0; } -- cgit v1.2.3 From 355b200bacdb6017669cdc5bc9e7b1037aac42a2 Mon Sep 17 00:00:00 2001 From: Paul Gortmaker Date: Sun, 3 Jul 2011 16:17:28 -0400 Subject: video: Add module.h to drivers/video files who really use it. They were getting this implicitly by an include of module.h from device.h -- but we are going to clean that up and break that include chain, so include module.h explicitly now. [ with contributions from Axel Lin ] Signed-off-by: Paul Gortmaker --- drivers/video/atmel_lcdfb.c | 1 + drivers/video/backlight/88pm860x_bl.c | 1 + drivers/video/backlight/adp5520_bl.c | 1 + drivers/video/backlight/ams369fg06.c | 1 + drivers/video/backlight/da903x_bl.c | 1 + drivers/video/backlight/ep93xx_bl.c | 1 + drivers/video/backlight/l4f00242t03.c | 1 + drivers/video/backlight/ld9040.c | 1 + drivers/video/backlight/lms283gf05.c | 1 + drivers/video/backlight/max8925_bl.c | 1 + drivers/video/backlight/s6e63m0.c | 1 + drivers/video/backlight/wm831x_bl.c | 1 + drivers/video/carminefb.c | 1 + drivers/video/cobalt_lcdfb.c | 1 + drivers/video/ep93xx-fb.c | 1 + drivers/video/fb_ddc.c | 3 ++- drivers/video/mb862xx/mb862xxfbdrv.c | 1 + drivers/video/omap/lcd_mipid.c | 1 + drivers/video/omap/omapfb_main.c | 1 + drivers/video/omap2/dss/dsi.c | 1 + drivers/video/savage/savagefb_accel.c | 1 + drivers/video/sh_mipi_dsi.c | 1 + drivers/video/sh_mobile_lcdcfb.c | 1 + drivers/video/w100fb.c | 1 + 24 files changed, 25 insertions(+), 1 deletion(-) (limited to 'drivers/video/savage') diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index 4ac48d9ee665..63409c122ae8 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include diff --git a/drivers/video/backlight/88pm860x_bl.c b/drivers/video/backlight/88pm860x_bl.c index c04b94da81f7..1105fa1ed7f4 100644 --- a/drivers/video/backlight/88pm860x_bl.c +++ b/drivers/video/backlight/88pm860x_bl.c @@ -17,6 +17,7 @@ #include #include #include +#include #define MAX_BRIGHTNESS (0xFF) #define MIN_BRIGHTNESS (0) diff --git a/drivers/video/backlight/adp5520_bl.c b/drivers/video/backlight/adp5520_bl.c index d1aee730d7d8..dfb763e9147f 100644 --- a/drivers/video/backlight/adp5520_bl.c +++ b/drivers/video/backlight/adp5520_bl.c @@ -13,6 +13,7 @@ #include #include #include +#include struct adp5520_bl { struct device *master; diff --git a/drivers/video/backlight/ams369fg06.c b/drivers/video/backlight/ams369fg06.c index 9f0a491e2a05..7838a23fbdd1 100644 --- a/drivers/video/backlight/ams369fg06.c +++ b/drivers/video/backlight/ams369fg06.c @@ -22,6 +22,7 @@ */ #include +#include #include #include #include diff --git a/drivers/video/backlight/da903x_bl.c b/drivers/video/backlight/da903x_bl.c index 62043f12a5a4..d68f14bbb687 100644 --- a/drivers/video/backlight/da903x_bl.c +++ b/drivers/video/backlight/da903x_bl.c @@ -19,6 +19,7 @@ #include #include #include +#include #define DA9030_WLED_CONTROL 0x25 #define DA9030_WLED_CP_EN (1 << 6) diff --git a/drivers/video/backlight/ep93xx_bl.c b/drivers/video/backlight/ep93xx_bl.c index b0582917f0c8..c74a6f4baa12 100644 --- a/drivers/video/backlight/ep93xx_bl.c +++ b/drivers/video/backlight/ep93xx_bl.c @@ -13,6 +13,7 @@ #include #include +#include #include #include #include diff --git a/drivers/video/backlight/l4f00242t03.c b/drivers/video/backlight/l4f00242t03.c index 98ad3e5f7c85..046c7aa15a16 100644 --- a/drivers/video/backlight/l4f00242t03.c +++ b/drivers/video/backlight/l4f00242t03.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/video/backlight/ld9040.c b/drivers/video/backlight/ld9040.c index 5934655eb1ff..da9a5ce0ccb8 100644 --- a/drivers/video/backlight/ld9040.c +++ b/drivers/video/backlight/ld9040.c @@ -30,6 +30,7 @@ #include #include #include +#include #include "ld9040_gamma.h" diff --git a/drivers/video/backlight/lms283gf05.c b/drivers/video/backlight/lms283gf05.c index 5d3cf33953ac..4ec78cfe26ea 100644 --- a/drivers/video/backlight/lms283gf05.c +++ b/drivers/video/backlight/lms283gf05.c @@ -17,6 +17,7 @@ #include #include +#include struct lms283gf05_state { struct spi_device *spi; diff --git a/drivers/video/backlight/max8925_bl.c b/drivers/video/backlight/max8925_bl.c index 07e8e273ced0..7bbc802560ea 100644 --- a/drivers/video/backlight/max8925_bl.c +++ b/drivers/video/backlight/max8925_bl.c @@ -17,6 +17,7 @@ #include #include #include +#include #define MAX_BRIGHTNESS (0xff) #define MIN_BRIGHTNESS (0) diff --git a/drivers/video/backlight/s6e63m0.c b/drivers/video/backlight/s6e63m0.c index 694e5aab0d69..e132157d8545 100644 --- a/drivers/video/backlight/s6e63m0.c +++ b/drivers/video/backlight/s6e63m0.c @@ -30,6 +30,7 @@ #include #include #include +#include #include "s6e63m0_gamma.h" diff --git a/drivers/video/backlight/wm831x_bl.c b/drivers/video/backlight/wm831x_bl.c index d4c6eb248ff9..fbe9e9316f3b 100644 --- a/drivers/video/backlight/wm831x_bl.c +++ b/drivers/video/backlight/wm831x_bl.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/video/carminefb.c b/drivers/video/carminefb.c index cb09aa1fa138..2c76fdf23f2a 100644 --- a/drivers/video/carminefb.c +++ b/drivers/video/carminefb.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "carminefb.h" #include "carminefb_regs.h" diff --git a/drivers/video/cobalt_lcdfb.c b/drivers/video/cobalt_lcdfb.c index e02764319ff7..f56699d8122a 100644 --- a/drivers/video/cobalt_lcdfb.c +++ b/drivers/video/cobalt_lcdfb.c @@ -24,6 +24,7 @@ #include #include #include +#include /* * Cursor position address diff --git a/drivers/video/ep93xx-fb.c b/drivers/video/ep93xx-fb.c index 40e5f17d1e4b..2e830ec52a5a 100644 --- a/drivers/video/ep93xx-fb.c +++ b/drivers/video/ep93xx-fb.c @@ -18,6 +18,7 @@ */ #include +#include #include #include #include diff --git a/drivers/video/fb_ddc.c b/drivers/video/fb_ddc.c index 4a874c8d039c..2b106f046fde 100644 --- a/drivers/video/fb_ddc.c +++ b/drivers/video/fb_ddc.c @@ -1,5 +1,5 @@ /* - * driver/vide/fb_ddc.c - DDC/EDID read support. + * drivers/video/fb_ddc.c - DDC/EDID read support. * * Copyright (C) 2006 Dennis Munsie * @@ -10,6 +10,7 @@ #include #include +#include #include #include #include diff --git a/drivers/video/mb862xx/mb862xxfbdrv.c b/drivers/video/mb862xx/mb862xxfbdrv.c index c16ff1d62e91..11a7a333701d 100644 --- a/drivers/video/mb862xx/mb862xxfbdrv.c +++ b/drivers/video/mb862xx/mb862xxfbdrv.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/video/omap/lcd_mipid.c b/drivers/video/omap/lcd_mipid.c index 90e3bdd1b7ab..eb381db7fe51 100644 --- a/drivers/video/omap/lcd_mipid.c +++ b/drivers/video/omap/lcd_mipid.c @@ -23,6 +23,7 @@ #include #include #include +#include #include diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c index b3ddd743d8a6..25d8e5103193 100644 --- a/drivers/video/omap/omapfb_main.c +++ b/drivers/video/omap/omapfb_main.c @@ -28,6 +28,7 @@ #include #include #include +#include #include diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 43c04a9889c4..5abf8e7e7456 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/video/savage/savagefb_accel.c b/drivers/video/savage/savagefb_accel.c index bbcc055d3bb7..bfefa6234cf0 100644 --- a/drivers/video/savage/savagefb_accel.c +++ b/drivers/video/savage/savagefb_accel.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "savagefb.h" diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c index 24640c8458ab..72ee96bc6b3e 100644 --- a/drivers/video/sh_mipi_dsi.c +++ b/drivers/video/sh_mipi_dsi.c @@ -17,6 +17,7 @@ #include #include #include +#include #include