Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* [PATCH v2 17/29] pm2fb: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-06-14  9:24 UTC (permalink / raw)
  To: linux-fbdev

We must not use any information in the passed var besides xoffset,
yoffset and vmode as otherwise applications might abuse it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Krzysztof Helt <krzysztof.h1@wp.pl>
---
 drivers/video/pm2fb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/pm2fb.c b/drivers/video/pm2fb.c
index 27f93aa..f4f8ce8 100644
--- a/drivers/video/pm2fb.c
+++ b/drivers/video/pm2fb.c
@@ -973,8 +973,8 @@ static int pm2fb_pan_display(struct fb_var_screeninfo *var,
 {
 	struct pm2fb_par *p = info->par;
 	u32 base;
-	u32 depth = (var->bits_per_pixel + 7) & ~7;
-	u32 xres = (var->xres + 31) & ~31;
+	u32 depth = (info->var.bits_per_pixel + 7) & ~7;
+	u32 xres = (info->var.xres + 31) & ~31;
 
 	depth = (depth > 32) ? 32 : depth;
 	base = to3264(var->yoffset * xres + var->xoffset, depth, 1);
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH v2 16/29] neofb: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-06-14  9:24 UTC (permalink / raw)
  To: linux-fbdev

We must not use any information in the passed var besides xoffset,
yoffset and vmode as otherwise applications might abuse it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Krzysztof Helt <krzysztof.h1@wp.pl>
---
 drivers/video/neofb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c
index 588527a..feea7b1 100644
--- a/drivers/video/neofb.c
+++ b/drivers/video/neofb.c
@@ -1185,8 +1185,8 @@ static int neofb_pan_display(struct fb_var_screeninfo *var,
 
 	DBG("neofb_update_start");
 
-	Base = (var->yoffset * var->xres_virtual + var->xoffset) >> 2;
-	Base *= (var->bits_per_pixel + 7) / 8;
+	Base = (var->yoffset * info->var.xres_virtual + var->xoffset) >> 2;
+	Base *= (info->var.bits_per_pixel + 7) / 8;
 
 	neoUnlock();
 
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH v2 15/29] mx3fb: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-06-14  9:24 UTC (permalink / raw)
  To: linux-fbdev

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 <laurent.pinchart@ideasonboard.com>
Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 drivers/video/mx3fb.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c
index 7e3a490..bd76858 100644
--- a/drivers/video/mx3fb.c
+++ b/drivers/video/mx3fb.c
@@ -1062,15 +1062,15 @@ static int mx3fb_pan_display(struct fb_var_screeninfo *var,
 	y_bottom = var->yoffset;
 
 	if (!(var->vmode & FB_VMODE_YWRAP))
-		y_bottom += var->yres;
+		y_bottom += fbi->var.yres;
 
 	if (y_bottom > fbi->var.yres_virtual)
 		return -EINVAL;
 
 	mutex_lock(&mx3_fbi->mutex);
 
-	offset = (var->yoffset * var->xres_virtual + var->xoffset) *
-		(var->bits_per_pixel / 8);
+	offset = var->yoffset * fbi->fix.line_length
+	       + var->xoffset * (fbi->var.bits_per_pixel / 8);
 	base = fbi->fix.smem_start + offset;
 
 	dev_dbg(fbi->device, "Updating SDC BG buf %d address=0x%08lX\n",
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH v2 14/29] mb862xxfb: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-06-14  9:24 UTC (permalink / raw)
  To: linux-fbdev

We must not use any information in the passed var besides xoffset,
yoffset and vmode as otherwise applications might abuse it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Anatolij Gustschin <agust@denx.de>
---
 drivers/video/mb862xx/mb862xxfbdrv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/mb862xx/mb862xxfbdrv.c b/drivers/video/mb862xx/mb862xxfbdrv.c
index f70bd63..2191de0 100644
--- a/drivers/video/mb862xx/mb862xxfbdrv.c
+++ b/drivers/video/mb862xx/mb862xxfbdrv.c
@@ -278,7 +278,7 @@ static int mb862xxfb_pan(struct fb_var_screeninfo *var,
 	reg = pack(var->yoffset, var->xoffset);
 	outreg(disp, GC_L0WY_L0WX, reg);
 
-	reg = pack(var->yres_virtual, var->xres_virtual);
+	reg = pack(info->var.yres_virtual, info->var.xres_virtual);
 	outreg(disp, GC_L0WH_L0WW, reg);
 	return 0;
 }
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH v2 13/29] intelfb: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-06-14  9:24 UTC (permalink / raw)
  To: linux-fbdev

We must not use any information in the passed var besides xoffset,
yoffset and vmode as otherwise applications might abuse it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Maik Broemme <mbroemme@plusserver.de>
---
 drivers/video/intelfb/intelfbhw.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/video/intelfb/intelfbhw.c b/drivers/video/intelfb/intelfbhw.c
index 38065cf..fbad61d 100644
--- a/drivers/video/intelfb/intelfbhw.c
+++ b/drivers/video/intelfb/intelfbhw.c
@@ -390,12 +390,12 @@ int intelfbhw_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
 	xoffset = ROUND_DOWN_TO(var->xoffset, 8);
 	yoffset = var->yoffset;
 
-	if ((xoffset + var->xres > var->xres_virtual) ||
-	    (yoffset + var->yres > var->yres_virtual))
+	if ((xoffset + info->var.xres > info->var.xres_virtual) ||
+	    (yoffset + info->var.yres > info->var.yres_virtual))
 		return -EINVAL;
 
 	offset = (yoffset * dinfo->pitch) +
-		 (xoffset * var->bits_per_pixel) / 8;
+		 (xoffset * info->var.bits_per_pixel) / 8;
 
 	offset += dinfo->fb.offset << 12;
 
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH v2 12/29] imsttfb: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-06-14  9:24 UTC (permalink / raw)
  To: linux-fbdev

We must not use any information in the passed var besides xoffset,
yoffset and vmode as otherwise applications might abuse it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/video/imsttfb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/imsttfb.c b/drivers/video/imsttfb.c
index efb2c10..8149356 100644
--- a/drivers/video/imsttfb.c
+++ b/drivers/video/imsttfb.c
@@ -749,7 +749,7 @@ set_offset (struct fb_var_screeninfo *var, struct fb_info *info)
 {
 	struct imstt_par *par = info->par;
 	__u32 off = var->yoffset * (info->fix.line_length >> 3)
-		    + ((var->xoffset * (var->bits_per_pixel >> 3)) >> 3);
+		    + ((var->xoffset * (info->var.bits_per_pixel >> 3)) >> 3);
 	write_reg_le32(par->dc_regs, SSR, off);
 }
 
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH v2 11/29] hgafb: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-06-14  9:24 UTC (permalink / raw)
  To: linux-fbdev

We must not use any information in the passed var besides xoffset,
yoffset and vmode as otherwise applications might abuse it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Ferenc Bakonyi <fero@drama.obuda.kando.hu>
Cc: Brent Cook <busterb@gmail.com>
---
 drivers/video/hgafb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/hgafb.c b/drivers/video/hgafb.c
index 4052718..4394389 100644
--- a/drivers/video/hgafb.c
+++ b/drivers/video/hgafb.c
@@ -422,8 +422,8 @@ static int hgafb_pan_display(struct fb_var_screeninfo *var,
 		    var->xoffset)
 			return -EINVAL;
 	} else {
-		if (var->xoffset + var->xres > info->var.xres_virtual
-		 || var->yoffset + var->yres > info->var.yres_virtual
+		if (var->xoffset + info->var.xres > info->var.xres_virtual
+		 || var->yoffset + info->var.yres > info->var.yres_virtual
 		 || var->yoffset % 8)
 			return -EINVAL;
 	}
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH v2 10/29] gxt4500: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-06-14  9:24 UTC (permalink / raw)
  To: linux-fbdev

We must not use any information in the passed var besides xoffset,
yoffset and vmode as otherwise applications might abuse it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Paul Mackerras <paulus@samba.org>
---
 drivers/video/gxt4500.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/gxt4500.c b/drivers/video/gxt4500.c
index 896e53d..0fad23f 100644
--- a/drivers/video/gxt4500.c
+++ b/drivers/video/gxt4500.c
@@ -543,8 +543,8 @@ static int gxt4500_pan_display(struct fb_var_screeninfo *var,
 
 	if (var->xoffset & 7)
 		return -EINVAL;
-	if (var->xoffset + var->xres > var->xres_virtual ||
-	    var->yoffset + var->yres > var->yres_virtual)
+	if (var->xoffset + info->var.xres > info->var.xres_virtual ||
+	    var->yoffset + info->var.yres > info->var.yres_virtual)
 		return -EINVAL;
 
 	writereg(par, REFRESH_START, (var->xoffset << 16) | var->yoffset);
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH v2 09/29] g364fb: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-06-14  9:24 UTC (permalink / raw)
  To: linux-fbdev

We must not use any information in the passed var besides xoffset,
yoffset and vmode as otherwise applications might abuse it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/video/g364fb.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/video/g364fb.c b/drivers/video/g364fb.c
index d662317..223896c 100644
--- a/drivers/video/g364fb.c
+++ b/drivers/video/g364fb.c
@@ -149,10 +149,11 @@ int g364fb_cursor(struct fb_info *info, struct fb_cursor *cursor)
 static int g364fb_pan_display(struct fb_var_screeninfo *var, 
 			      struct fb_info *info)
 {
-	if (var->xoffset || var->yoffset + var->yres > var->yres_virtual)
+	if (var->xoffset ||
+	    var->yoffset + info->var.yres > info->var.yres_virtual)
 		return -EINVAL;
 
-	*(unsigned int *) TOP_REG = var->yoffset * var->xres;
+	*(unsigned int *) TOP_REG = var->yoffset * info->var.xres;
 	return 0;
 }
 
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH v2 08/29] fbdev: unicore32: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-06-14  9:24 UTC (permalink / raw)
  To: linux-fbdev

We must not use any information in the passed var besides xoffset,
yoffset and vmode as otherwise applications might abuse it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
---
 drivers/video/fb-puv3.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fb-puv3.c b/drivers/video/fb-puv3.c
index 27f2c57..60a787f 100644
--- a/drivers/video/fb-puv3.c
+++ b/drivers/video/fb-puv3.c
@@ -624,8 +624,8 @@ static int unifb_pan_display(struct fb_var_screeninfo *var,
 		    || var->xoffset)
 			return -EINVAL;
 	} else {
-		if (var->xoffset + var->xres > info->var.xres_virtual ||
-		    var->yoffset + var->yres > info->var.yres_virtual)
+		if (var->xoffset + info->var.xres > info->var.xres_virtual ||
+		    var->yoffset + info->var.yres > info->var.yres_virtual)
 			return -EINVAL;
 	}
 	info->var.xoffset = var->xoffset;
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH v2 07/29] fbdev: da8xx: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-06-14  9:24 UTC (permalink / raw)
  To: linux-fbdev

We must not use any information in the passed var besides xoffset,
yoffset and vmode as otherwise applications might abuse it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Cc: Martin Ambrose <martin@ti.com>
---
 drivers/video/da8xx-fb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index fcdac87..8d4e4eb 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -877,8 +877,8 @@ static int da8xx_pan_display(struct fb_var_screeninfo *var,
 
 			start	= fix->smem_start +
 				new_var.yoffset * fix->line_length +
-				new_var.xoffset * var->bits_per_pixel / 8;
-			end	= start + var->yres * fix->line_length - 1;
+				new_var.xoffset * fbi->var.bits_per_pixel / 8;
+			end	= start + fbi->var.yres * fix->line_length - 1;
 			par->dma_start	= start;
 			par->dma_end	= end;
 		}
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH v2 06/29] radeonfb: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-06-14  9:24 UTC (permalink / raw)
  To: linux-fbdev

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 <laurent.pinchart@ideasonboard.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 drivers/video/aty/radeon_base.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
index 32f8cf6..1506848 100644
--- a/drivers/video/aty/radeon_base.c
+++ b/drivers/video/aty/radeon_base.c
@@ -845,16 +845,16 @@ static int radeonfb_pan_display (struct fb_var_screeninfo *var,
 {
         struct radeonfb_info *rinfo = info->par;
 
-        if ((var->xoffset + var->xres > var->xres_virtual)
-	    || (var->yoffset + var->yres > var->yres_virtual))
-               return -EINVAL;
+	if ((var->xoffset + info->var.xres > info->var.xres_virtual)
+	    || (var->yoffset + info->var.yres > info->var.yres_virtual))
+		return -EINVAL;
                 
         if (rinfo->asleep)
         	return 0;
 
 	radeon_fifo_wait(2);
-        OUTREG(CRTC_OFFSET, ((var->yoffset * var->xres_virtual + var->xoffset)
-			     * var->bits_per_pixel / 8) & ~7);
+	OUTREG(CRTC_OFFSET, (var->yoffset * info->fix.line_length +
+			     var->xoffset * info->var.bits_per_pixel / 8) & ~7);
         return 0;
 }
 
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH v2 05/29] atmel_lcdfb: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-06-14  9:24 UTC (permalink / raw)
  To: linux-fbdev

We must not use any information in the passed var besides xoffset,
yoffset and vmode as otherwise applications might abuse it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 drivers/video/atmel_lcdfb.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 4484c72..8b5d755 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -39,7 +39,8 @@
 					 | FBINFO_HWACCEL_YPAN)
 
 static inline void atmel_lcdfb_update_dma2d(struct atmel_lcdfb_info *sinfo,
-					struct fb_var_screeninfo *var)
+					struct fb_var_screeninfo *var,
+					struct fb_info *info)
 {
 
 }
@@ -50,14 +51,16 @@ static inline void atmel_lcdfb_update_dma2d(struct atmel_lcdfb_info *sinfo,
 					| FBINFO_HWACCEL_YPAN)
 
 static void atmel_lcdfb_update_dma2d(struct atmel_lcdfb_info *sinfo,
-				     struct fb_var_screeninfo *var)
+				     struct fb_var_screeninfo *var,
+				     struct fb_info *info)
 {
 	u32 dma2dcfg;
 	u32 pixeloff;
 
-	pixeloff = (var->xoffset * var->bits_per_pixel) & 0x1f;
+	pixeloff = (var->xoffset * info->var.bits_per_pixel) & 0x1f;
 
-	dma2dcfg = ((var->xres_virtual - var->xres) * var->bits_per_pixel) / 8;
+	dma2dcfg = (info-var.xres_virtual - info->var.xres)
+		 * info->var.bits_per_pixel / 8;
 	dma2dcfg |= pixeloff << ATMEL_LCDC_PIXELOFF_OFFSET;
 	lcdc_writel(sinfo, ATMEL_LCDC_DMA2DCFG, dma2dcfg);
 
@@ -249,14 +252,14 @@ static void atmel_lcdfb_update_dma(struct fb_info *info,
 	unsigned long dma_addr;
 
 	dma_addr = (fix->smem_start + var->yoffset * fix->line_length
-		    + var->xoffset * var->bits_per_pixel / 8);
+		    + var->xoffset * info->var.bits_per_pixel / 8);
 
 	dma_addr &= ~3UL;
 
 	/* Set framebuffer DMA base address and pixel offset */
 	lcdc_writel(sinfo, ATMEL_LCDC_DMABADDR1, dma_addr);
 
-	atmel_lcdfb_update_dma2d(sinfo, var);
+	atmel_lcdfb_update_dma2d(sinfo, var, info);
 }
 
 static inline void atmel_lcdfb_free_video_memory(struct atmel_lcdfb_info *sinfo)
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH v2 04/29] arkfb: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-06-14  9:24 UTC (permalink / raw)
  To: linux-fbdev

We must not use any information in the passed var besides xoffset,
yoffset and vmode as otherwise applications might abuse it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Ondrej Zajicek <santiago@crfreenet.org>
---
 drivers/video/arkfb.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/video/arkfb.c b/drivers/video/arkfb.c
index 8686429..555dd4c 100644
--- a/drivers/video/arkfb.c
+++ b/drivers/video/arkfb.c
@@ -908,13 +908,14 @@ static int arkfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info
 	unsigned int offset;
 
 	/* Calculate the offset */
-	if (var->bits_per_pixel = 0) {
-		offset = (var->yoffset / 16) * (var->xres_virtual / 2) + (var->xoffset / 2);
+	if (info->var.bits_per_pixel = 0) {
+		offset = (var->yoffset / 16) * (info->var.xres_virtual / 2)
+		       + (var->xoffset / 2);
 		offset = offset >> 2;
 	} else {
 		offset = (var->yoffset * info->fix.line_length) +
-			 (var->xoffset * var->bits_per_pixel / 8);
-		offset = offset >> ((var->bits_per_pixel = 4) ? 2 : 3);
+			 (var->xoffset * info->var.bits_per_pixel / 8);
+		offset = offset >> ((info->var.bits_per_pixel = 4) ? 2 : 3);
 	}
 
 	/* Set the offset */
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH v2 03/29] acornfb: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-06-14  9:24 UTC (permalink / raw)
  To: linux-fbdev

We must not use any information in the passed var besides xoffset,
yoffset and vmode as otherwise applications might abuse it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/video/acornfb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/acornfb.c b/drivers/video/acornfb.c
index 3bacc12..b303f17 100644
--- a/drivers/video/acornfb.c
+++ b/drivers/video/acornfb.c
@@ -850,9 +850,9 @@ acornfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
 	u_int y_bottom = var->yoffset;
 
 	if (!(var->vmode & FB_VMODE_YWRAP))
-		y_bottom += var->yres;
+		y_bottom += info->var.yres;
 
-	if (y_bottom > var->yres_virtual)
+	if (y_bottom > info->var.yres_virtual)
 		return -EINVAL;
 
 	acornfb_update_dma(info, var);
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH v2 02/29] acornfb: Dont BUG() on invalid pan parameters
From: Laurent Pinchart @ 2011-06-14  9:24 UTC (permalink / raw)
  To: linux-fbdev

The driver currently BUG()s if the pan parameters passed directly from
userspace are invalid. Return -EINVAL instead.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/video/acornfb.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/video/acornfb.c b/drivers/video/acornfb.c
index 6183a57..3bacc12 100644
--- a/drivers/video/acornfb.c
+++ b/drivers/video/acornfb.c
@@ -852,7 +852,8 @@ acornfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
 	if (!(var->vmode & FB_VMODE_YWRAP))
 		y_bottom += var->yres;
 
-	BUG_ON(y_bottom > var->yres_virtual);
+	if (y_bottom > var->yres_virtual)
+		return -EINVAL;
 
 	acornfb_update_dma(info, var);
 
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH v2 01/29] 68328fb: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-06-14  9:24 UTC (permalink / raw)
  To: linux-fbdev

We must not use any information in the passed var besides xoffset,
yoffset and vmode as otherwise applications might abuse it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/video/68328fb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/68328fb.c b/drivers/video/68328fb.c
index 75a39ea..a425d65 100644
--- a/drivers/video/68328fb.c
+++ b/drivers/video/68328fb.c
@@ -378,8 +378,8 @@ static int mc68x328fb_pan_display(struct fb_var_screeninfo *var,
 		    || var->xoffset)
 			return -EINVAL;
 	} else {
-		if (var->xoffset + var->xres > info->var.xres_virtual ||
-		    var->yoffset + var->yres > info->var.yres_virtual)
+		if (var->xoffset + info->var.xres > info->var.xres_virtual ||
+		    var->yoffset + info->var.yres > info->var.yres_virtual)
 			return -EINVAL;
 	}
 	info->var.xoffset = var->xoffset;
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH v2 00/29] Use display information in info not in var for panning
From: Laurent Pinchart @ 2011-06-14  9:24 UTC (permalink / raw)
  To: linux-fbdev

Hi everybody,

Here's the second version of the FBIOPAN_DISPLAY fixes patch series.

As a reminder, while playing with the FBIOPAN_DISPLAY ioctl I noticed that many
drivers use information from the ioctl argument such as the display resolution
when they should use the current settings from the fb_info structure.

These 29 patches fix most of those drivers. Missing drivers are ivtv (for
which a patch has Andy Walls has already pushed a patch), sh_mobile_lcdcfb (for
which the fix is a bit more complex, I will work on it later) and viafb (for
which Florian Tobias Schandinat has already sent a patch).

The patches have been compile-tested on architectures for which I have a
working compiler (x86 and ARM) with allyesconfig. I don't own any hardware
supported by these drivers so I haven't been able to perform additional tests.

I've split the fixes in one patch per driver for easier review and handling of
potential problems. The patches can be squashed together if needed. I've tried
to CC individual driver maintainers when possible, and Acked-by lines received
in reply to the first version have been included.

Compared to v1, I've fixed a couple of subject lines that mentioned the wrong
driver name, and replaced var->bits_per_pixel in the mx3fb driver.

Not all patches have been tested on real hardware and acked. Geert Uytterhoeven
acked the overall idea, and I believe the patches are now ready to be applied.

Laurent Pinchart (29):
  68328fb: use display information in info not in var for panning
  acornfb: Dont BUG() on invalid pan parameters
  acornfb: use display information in info not in var for panning
  arkfb: use display information in info not in var for panning
  atmel_lcdfb: use display information in info not in var for panning
  radeonfb: use display information in info not in var for panning
  fbdev: da8xx: use display information in info not in var for panning
  fbdev: unicore32: use display information in info not in var for
    panning
  g364fb: use display information in info not in var for panning
  gxt4500: use display information in info not in var for panning
  hgafb: use display information in info not in var for panning
  imsttfb: use display information in info not in var for panning
  intelfb: use display information in info not in var for panning
  mb862xxfb: use display information in info not in var for panning
  mx3fb: use display information in info not in var for panning
  neofb: use display information in info not in var for panning
  pm2fb: use display information in info not in var for panning
  pm3fb: use display information in info not in var for panning
  s3c-fb: use display information in info not in var for panning
  s3fb: use display information in info not in var for panning
  savagefb: use display information in info not in var for panning
  sisfb: use display information in info not in var for panning
  sm501fb: use display information in info not in var for panning
  tridentfb: use display information in info not in var for panning
  vfb: use display information in info not in var for panning
  vga16fb: use display information in info not in var for panning
  vt8500lcdfb: use display information in info not in var for panning
  vt8623fb: use display information in info not in var for panning
  staging: xgifb: use display information in info not in var for
    panning

 drivers/staging/xgifb/XGI_main_26.c    |   22 ++++++----------------
 drivers/video/68328fb.c                |    4 ++--
 drivers/video/acornfb.c                |    5 +++--
 drivers/video/arkfb.c                  |    9 +++++----
 drivers/video/atmel_lcdfb.c            |   15 +++++++++------
 drivers/video/aty/radeon_base.c        |   10 +++++-----
 drivers/video/da8xx-fb.c               |    4 ++--
 drivers/video/fb-puv3.c                |    4 ++--
 drivers/video/g364fb.c                 |    5 +++--
 drivers/video/gxt4500.c                |    4 ++--
 drivers/video/hgafb.c                  |    4 ++--
 drivers/video/imsttfb.c                |    2 +-
 drivers/video/intelfb/intelfbhw.c      |    6 +++---
 drivers/video/mb862xx/mb862xxfbdrv.c   |    2 +-
 drivers/video/mx3fb.c                  |    6 +++---
 drivers/video/neofb.c                  |    4 ++--
 drivers/video/pm2fb.c                  |    4 ++--
 drivers/video/pm3fb.c                  |    4 ++--
 drivers/video/s3c-fb.c                 |    2 +-
 drivers/video/s3fb.c                   |    7 ++++---
 drivers/video/savage/savagefb_driver.c |   16 +++++++---------
 drivers/video/sis/sis_main.c           |   30 ++++++++++--------------------
 drivers/video/sm501fb.c                |    6 +++---
 drivers/video/tridentfb.c              |    4 ++--
 drivers/video/vfb.c                    |    4 ++--
 drivers/video/vga16fb.c                |    2 +-
 drivers/video/vt8500lcdfb.c            |    4 ++--
 drivers/video/vt8623fb.c               |    9 +++++----
 28 files changed, 92 insertions(+), 106 deletions(-)

-- 
Regards,

Laurent Pinchart


^ permalink raw reply

* Re: [PATCH] au1200fb: fix hardcoded IRQ
From: Manuel Lauss @ 2011-06-14  8:23 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1307898929-12365-1-git-send-email-manuel.lauss@googlemail.com>

Hi Paul,

On Tue, Jun 14, 2011 at 9:10 AM, Paul Mundt <lethal@linux-sh.org> wrote:
> On Sun, Jun 12, 2011 at 07:15:29PM +0200, Manuel Lauss wrote:
>> Use the IRQ provided by platform resource information.
>> Required for Au1300 support.
>>
>> Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com>
>> ---
>> applies on top of the other 3 au1200fb patches sent earlier.
>>
>>  drivers/video/au1200fb.c |   12 +++++++-----
>>  1 files changed, 7 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/video/au1200fb.c b/drivers/video/au1200fb.c
>> index e018373..e6d3478 100644
>> --- a/drivers/video/au1200fb.c
>> +++ b/drivers/video/au1200fb.c
>> @@ -1631,7 +1631,7 @@ static int __devinit au1200fb_drv_probe(struct platform_device *dev)
>>       struct au1200fb_device *fbdev;
>>       struct fb_info *fbi = NULL;
>>       unsigned long page;
>> -     int bpp, plane, ret;
>> +     int bpp, plane, ret, irq;
>>
>>       /* shut gcc up */
>>       ret = 0;
>> @@ -1707,10 +1707,12 @@ static int __devinit au1200fb_drv_probe(struct platform_device *dev)
>>       }
>>
>>       /* Now hook interrupt too */
>> -     if ((ret = request_irq(AU1200_LCD_INT, au1200fb_handle_irq,
>> -                       IRQF_DISABLED | IRQF_SHARED, "lcd", (void *)dev)) < 0) {
>> +     irq = platform_get_irq(dev, 0);
>> +     ret = request_irq(irq, au1200fb_handle_irq,
>> +                       IRQF_DISABLED | IRQF_SHARED, "lcd", (void *)dev);
>> +     if (ret) {
>>               print_err("fail to request interrupt line %d (err: %d)",
>> -                       AU1200_LCD_INT, ret);
>> +                       irq, ret);
>>               goto failed;
>>       }
>>
> A minor nit, but if you're passing along IRQ information via the platform
> data already you could take that a step further and also fetch the IRQ
> flags. This would at least allow you to avoid an unconditional
> IRQF_SHARED.

That IRQF_SHARED is required because the out-of-tree mpeg decoder
driver attaches to this irq as well.  I'll incorporate it in the rewrite though.

Thanks!
        Manuel Lauss

^ permalink raw reply

* Re: [PATCH 0/4] fbdev: au1200fb updates
From: Manuel Lauss @ 2011-06-14  8:20 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1307719384-23702-1-git-send-email-manuel.lauss@googlemail.com>

Hi Paul,

On Tue, Jun 14, 2011 at 9:26 AM, Paul Mundt <lethal@linux-sh.org> wrote:
> On Fri, Jun 10, 2011 at 05:23:00PM +0200, Manuel Lauss wrote:
>> Here are 4 updates to the au1200fb codebase to get it to work and compile
>> again, also with PM enabled.
>>
>> Run and PM-tested on DB1200 and DB1300.
>>
>> Manuel Lauss (4):
>>   au1200fb: use framebuffer_alloc()
>>   au1200fb: fixup PM
>>   au1200fb: make number of windows configurable at load time.
>>   au1200fb: switch to FB_SYS helpers
>>
>>  drivers/video/Kconfig    |    7 +-
>>  drivers/video/au1200fb.c |  285 ++++++++++++++++++++--------------------------
>>  2 files changed, 128 insertions(+), 164 deletions(-)
>>
> This is quite a bit bigger than something I would generally like to push
> along for -rc4 timing. Patches 1, 2, and 4 all technically qualify as
> fixes, so those are workable. 3/4 on the other hand looks like a feature
> enhancement that you're either dependent on for your new platform or a
> cleanup to move off of the previous hardcoding (in either case not really
> -rc4 material).
>
> On the other hand, if you don't require any of these for -rc4 then I can
> just apply the whole batch aimed at the next merge window.

next merge window is fine.  the driver has been in this state for ages, so
another few weeks really don't matter.

Thanks!
        Manuel Lauss

^ permalink raw reply

* Re: [PATCH] fbdev/atyfb: Fix 2 defined-but-not-used warnings
From: Paul Mundt @ 2011-06-14  7:35 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Ville Syrjala, linux-fbdev, linux-kernel, linux-m68k
In-Reply-To: <1307988778-21644-1-git-send-email-geert@linux-m68k.org>

On Mon, Jun 13, 2011 at 08:12:58PM +0200, Geert Uytterhoeven wrote:
> If CONFIG_FB_ATY_BACKLIGHT=y but CONFIG_PCI=n:
> 
> drivers/video/aty/atyfb_base.c:2272: warning: ???aty_bl_exit??? defined but not used
> 
> If CONFIG_ATARI=y for a modular build:
> 
> drivers/video/aty/atyfb_base.c:2794: warning: ???store_video_par??? defined but not
> used
> 
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH] efifb: Fix call to wrong unregister function
From: Paul Mundt @ 2011-06-14  7:33 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: wanlong.gao, linux-kernel, linux-fbdev, Maarten Lankhorst,
	Peter Jones
In-Reply-To: <4DF57C29.4070601@mit.edu>

On Sun, Jun 12, 2011 at 10:55:37PM -0400, Andy Lutomirski wrote:
> On 06/12/2011 06:52 AM, wanlong.gao wrote:
> ><snip>
> >
> >Hi Maarten:
> >It registered efifb_device but try to unregistered efifb_driver,
> >so I think you should fix it like this?
> >
> >Signed-off-by: Wanlong Gao<wanlong.gao@gmail.com>
> >---
> >  drivers/video/efifb.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> >diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c
> >index 69c49df..784139a 100644
> >--- a/drivers/video/efifb.c
> >+++ b/drivers/video/efifb.c
> >@@ -541,7 +541,7 @@ static int __init efifb_init(void)
> >  	 */
> >  	ret = platform_driver_probe(&efifb_driver, efifb_probe);
> >  	if (ret) {
> >-		platform_device_unregister(&efifb_driver);
> >+		platform_device_unregister(&efifb_device);
> >  		return ret;
> >  	}
> >
> 
> Acked-by: Andy Lutomirski <luto@mit.edu>
> 
Updated version applied, thanks.

^ permalink raw reply

* Re: [PATCH 0/4] fbdev: au1200fb updates
From: Paul Mundt @ 2011-06-14  7:26 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1307719384-23702-1-git-send-email-manuel.lauss@googlemail.com>

On Fri, Jun 10, 2011 at 05:23:00PM +0200, Manuel Lauss wrote:
> Here are 4 updates to the au1200fb codebase to get it to work and compile
> again, also with PM enabled.
> 
> Run and PM-tested on DB1200 and DB1300.
> 
> Manuel Lauss (4):
>   au1200fb: use framebuffer_alloc()
>   au1200fb: fixup PM
>   au1200fb: make number of windows configurable at load time.
>   au1200fb: switch to FB_SYS helpers
> 
>  drivers/video/Kconfig    |    7 +-
>  drivers/video/au1200fb.c |  285 ++++++++++++++++++++--------------------------
>  2 files changed, 128 insertions(+), 164 deletions(-)
> 
This is quite a bit bigger than something I would generally like to push
along for -rc4 timing. Patches 1, 2, and 4 all technically qualify as
fixes, so those are workable. 3/4 on the other hand looks like a feature
enhancement that you're either dependent on for your new platform or a
cleanup to move off of the previous hardcoding (in either case not really
-rc4 material).

On the other hand, if you don't require any of these for -rc4 then I can
just apply the whole batch aimed at the next merge window.

^ permalink raw reply

* Re: [PATCHv2 01/28] OMAP: change get_context_loss_count ret value
From: Tomi Valkeinen @ 2011-06-14  7:24 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: linux-fbdev, b-cousson, khilman, linux-omap mailing list
In-Reply-To: <alpine.DEB.2.00.1106140111540.20723@utopia.booyaka.com>

On Tue, 2011-06-14 at 01:13 -0600, Paul Walmsley wrote:
> Hi Tomi
> 
> On Mon, 13 Jun 2011, Tomi Valkeinen wrote:
> 
> > Paul, can you take this patch and queue it for an rc?
> 
> Generally I only queue regressions or fixes for major problems (crashes, 
> corruption, etc.) for -rc series.  So probably this one should go in via 
> the normal merge window, unless it's been causing major disruptions?

No, only disruptions for me as the DSS pm_runtime patches depend on this
one to function correctly. So merge window is ok, I'll handle the DSS
side somehow.

 Tomi



^ permalink raw reply

* Re: [PATCHv2 01/28] OMAP: change get_context_loss_count ret value
From: Paul Walmsley @ 2011-06-14  7:13 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-fbdev, b-cousson, khilman, linux-omap mailing list
In-Reply-To: <1307958710.1847.56.camel@deskari>

Hi Tomi

On Mon, 13 Jun 2011, Tomi Valkeinen wrote:

> Paul, can you take this patch and queue it for an rc?

Generally I only queue regressions or fixes for major problems (crashes, 
corruption, etc.) for -rc series.  So probably this one should go in via 
the normal merge window, unless it's been causing major disruptions?


- Paul

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox