Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* [PATCH 20/29] s3c-fb: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-05-25 22:58 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 Zary <linux@rainbow-software.org>
---
 drivers/video/s3fb.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/video/s3fb.c b/drivers/video/s3fb.c
index c4482f2..a625e5a 100644
--- a/drivers/video/s3fb.c
+++ b/drivers/video/s3fb.c
@@ -894,12 +894,13 @@ static int s3fb_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);
+			 (var->xoffset * info->var.bits_per_pixel / 8);
 		offset = offset >> 2;
 	}
 
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH 21/29] s3fb: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-05-25 22:58 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: Antonino Daplas <adaplas@gmail.com>
---
 drivers/video/savage/savagefb_driver.c |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c
index a2dc1a7..6db8485 100644
--- a/drivers/video/savage/savagefb_driver.c
+++ b/drivers/video/savage/savagefb_driver.c
@@ -1475,15 +1475,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);
@@ -1548,8 +1542,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;
 }
 
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH 22/29] sisfb: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-05-25 22:58 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.

Fix checkpatch.pl warnings in the surrounding code.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Thomas Winischhofer <thomas@winischhofer.net>
---
 drivers/video/sis/sis_main.c |   30 ++++++++++--------------------
 1 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c
index 7525984..078ca21 100644
--- a/drivers/video/sis/sis_main.c
+++ b/drivers/video/sis/sis_main.c
@@ -1333,19 +1333,14 @@ sisfb_set_base_CRT2(struct sis_video_info *ivideo, unsigned int base)
 }
 
 static int
-sisfb_pan_var(struct sis_video_info *ivideo, struct fb_var_screeninfo *var)
+sisfb_pan_var(struct sis_video_info *ivideo, struct fb_info *info,
+	      struct fb_var_screeninfo *var)
 {
-	if(var->xoffset > (var->xres_virtual - var->xres)) {
-		return -EINVAL;
-	}
-	if(var->yoffset > (var->yres_virtual - var->yres)) {
-		return -EINVAL;
-	}
-
-	ivideo->current_base = (var->yoffset * var->xres_virtual) + var->xoffset;
+	ivideo->current_base = var->yoffset * info->var.xres_virtual
+			     + var->xoffset;
 
 	/* calculate base bpp dep. */
-	switch(var->bits_per_pixel) {
+	switch (info->var.bits_per_pixel) {
 	case 32:
 		break;
 	case 16:
@@ -1635,20 +1630,15 @@ sisfb_pan_display(struct fb_var_screeninfo *var, struct fb_info* info)
 	struct sis_video_info *ivideo = (struct sis_video_info *)info->par;
 	int err;
 
-	if(var->xoffset > (var->xres_virtual - var->xres))
-		return -EINVAL;
-
-	if(var->yoffset > (var->yres_virtual - var->yres))
-		return -EINVAL;
-
-	if(var->vmode & FB_VMODE_YWRAP)
+	if (var->vmode & FB_VMODE_YWRAP)
 		return -EINVAL;
 
-	if(var->xoffset + info->var.xres > info->var.xres_virtual ||
-	   var->yoffset + info->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;
 
-	if((err = sisfb_pan_var(ivideo, var)) < 0)
+	err = sisfb_pan_var(ivideo, info, var);
+	if (err < 0)
 		return err;
 
 	info->var.xoffset = var->xoffset;
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH 23/29] sm501fb: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-05-25 22:58 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: Ben Dooks <ben@simtec.co.uk>
---
 drivers/video/sm501fb.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c
index 56ef6b3..53bc35e 100644
--- a/drivers/video/sm501fb.c
+++ b/drivers/video/sm501fb.c
@@ -582,7 +582,7 @@ static int sm501fb_pan_crt(struct fb_var_screeninfo *var,
 {
 	struct sm501fb_par  *par = info->par;
 	struct sm501fb_info *fbi = par->info;
-	unsigned int bytes_pixel = var->bits_per_pixel / 8;
+	unsigned int bytes_pixel = info->var.bits_per_pixel / 8;
 	unsigned long reg;
 	unsigned long xoffs;
 
@@ -614,10 +614,10 @@ static int sm501fb_pan_pnl(struct fb_var_screeninfo *var,
 	struct sm501fb_info *fbi = par->info;
 	unsigned long reg;
 
-	reg = var->xoffset | (var->xres_virtual << 16);
+	reg = var->xoffset | (info->var.xres_virtual << 16);
 	smc501_writel(reg, fbi->regs + SM501_DC_PANEL_FB_WIDTH);
 
-	reg = var->yoffset | (var->yres_virtual << 16);
+	reg = var->yoffset | (info->var.yres_virtual << 16);
 	smc501_writel(reg, fbi->regs + SM501_DC_PANEL_FB_HEIGHT);
 
 	sm501fb_sync_regs(fbi);
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH 24/29] tridentfb: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-05-25 22:58 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/tridentfb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/tridentfb.c b/drivers/video/tridentfb.c
index c6c7756..34cf019 100644
--- a/drivers/video/tridentfb.c
+++ b/drivers/video/tridentfb.c
@@ -987,8 +987,8 @@ static int tridentfb_pan_display(struct fb_var_screeninfo *var,
 	unsigned int offset;
 
 	debug("enter\n");
-	offset = (var->xoffset + (var->yoffset * var->xres_virtual))
-		* var->bits_per_pixel / 32;
+	offset = (var->xoffset + (var->yoffset * info->var.xres_virtual))
+		* info->var.bits_per_pixel / 32;
 	set_screen_start(par, offset);
 	debug("exit\n");
 	return 0;
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH 25/29] vfb: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-05-25 22:58 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/vfb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/vfb.c b/drivers/video/vfb.c
index bc67251..bf2f780 100644
--- a/drivers/video/vfb.c
+++ b/drivers/video/vfb.c
@@ -395,8 +395,8 @@ static int vfb_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 26/29] vga16fb: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-05-25 22:58 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: Antonino A. Daplas <adaplas@gmail.com>
---
 drivers/video/vga16fb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/vga16fb.c b/drivers/video/vga16fb.c
index 53b2c5a..148b3ee 100644
--- a/drivers/video/vga16fb.c
+++ b/drivers/video/vga16fb.c
@@ -207,7 +207,7 @@ static void vga16fb_pan_var(struct fb_info *info,
 	 * granularity if someone supports xoffset in bit resolution */
 	vga_io_r(VGA_IS1_RC);		/* reset flip-flop */
 	vga_io_w(VGA_ATT_IW, VGA_ATC_PEL);
-	if (var->bits_per_pixel = 8)
+	if (info->var.bits_per_pixel = 8)
 		vga_io_w(VGA_ATT_IW, (xoffset & 3) << 1);
 	else
 		vga_io_w(VGA_ATT_IW, xoffset & 7);
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH 27/29] vt8500lcdfb: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-05-25 22:58 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: Alexey Charkov <alchark@gmail.com>
---
 drivers/video/vt8500lcdfb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/vt8500lcdfb.c b/drivers/video/vt8500lcdfb.c
index 0e120d6..c13c246 100644
--- a/drivers/video/vt8500lcdfb.c
+++ b/drivers/video/vt8500lcdfb.c
@@ -210,8 +210,8 @@ static int vt8500lcd_pan_display(struct fb_var_screeninfo *var,
 	struct vt8500lcd_info *fbi = to_vt8500lcd_info(info);
 
 	writel((1 << 31)
-		| (((var->xres_virtual - var->xres) * pixlen / 4) << 20)
-		| (off >> 2), fbi->regbase + 0x20);
+	     | (((info->var.xres_virtual - info->var.xres) * pixlen / 4) << 20)
+	     | (off >> 2), fbi->regbase + 0x20);
 	return 0;
 }
 
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH 28/29] vt8623fb: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-05-25 22:58 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>
Cc: David S. Miller <davem@davemloft.net>
---
 drivers/video/vt8623fb.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

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


^ permalink raw reply related

* [PATCH 29/29] staging: xgifb: use display information in info not in var for panning
From: Laurent Pinchart @ 2011-05-25 22:58 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: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Arnaud Patard <apatard@mandriva.com>
---
 drivers/staging/xgifb/XGI_main_26.c |   22 ++++++----------------
 1 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c
index 721bd25..10a6142 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -1148,26 +1148,16 @@ static int XGIfb_do_set_var(struct fb_var_screeninfo *var, int isactive,
 }
 
 #ifdef XGIFB_PAN
-static int XGIfb_pan_var(struct fb_var_screeninfo *var)
+static int XGIfb_pan_var(struct fb_var_screeninfo *var, struct fb_info *info)
 {
 	unsigned int base;
 
 	/* printk("Inside pan_var"); */
 
-	if (var->xoffset > (var->xres_virtual - var->xres)) {
-		/* printk("Pan: xo: %d xv %d xr %d\n",
-			var->xoffset, var->xres_virtual, var->xres); */
-		return -EINVAL;
-	}
-	if (var->yoffset > (var->yres_virtual - var->yres)) {
-		/* printk("Pan: yo: %d yv %d yr %d\n",
-			var->yoffset, var->yres_virtual, var->yres); */
-		return -EINVAL;
-	}
-	base = var->yoffset * var->xres_virtual + var->xoffset;
+	base = var->yoffset * info->var.xres_virtual + var->xoffset;
 
 	/* calculate base bpp dep. */
-	switch (var->bits_per_pixel) {
+	switch (info->var.bits_per_pixel) {
 	case 16:
 		base >>= 1;
 		break;
@@ -1425,9 +1415,9 @@ static int XGIfb_pan_display(struct fb_var_screeninfo *var,
 
 	/* printk("\nInside pan_display:\n"); */
 
-	if (var->xoffset > (var->xres_virtual - var->xres))
+	if (var->xoffset > (info->var.xres_virtual - info->var.xres))
 		return -EINVAL;
-	if (var->yoffset > (var->yres_virtual - var->yres))
+	if (var->yoffset > (info->var.yres_virtual - info->var.yres))
 		return -EINVAL;
 
 	if (var->vmode & FB_VMODE_YWRAP) {
@@ -1440,7 +1430,7 @@ static int XGIfb_pan_display(struct fb_var_screeninfo *var,
 						> info->var.yres_virtual)
 			return -EINVAL;
 	}
-	err = XGIfb_pan_var(var);
+	err = XGIfb_pan_var(var, info);
 	if (err < 0)
 		return err;
 
-- 
1.7.3.4


^ permalink raw reply related

* Re: [PATCH 27/29] vt8500lcdfb: use display information in info not in
From: Alexey Charkov @ 2011-05-26  3:54 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1306364301-8195-28-git-send-email-laurent.pinchart@ideasonboard.com>

2011/5/26 Laurent Pinchart <laurent.pinchart@ideasonboard.com>:
> We must not use any information in the passed var besides xoffset,
> yoffset and vmode as otherwise applications might abuse it.

Agreed, thanks for the fix!

> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Alexey Charkov <alchark@gmail.com>
> ---
>  drivers/video/vt8500lcdfb.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/vt8500lcdfb.c b/drivers/video/vt8500lcdfb.c
> index 0e120d6..c13c246 100644
> --- a/drivers/video/vt8500lcdfb.c
> +++ b/drivers/video/vt8500lcdfb.c
> @@ -210,8 +210,8 @@ static int vt8500lcd_pan_display(struct fb_var_screeninfo *var,
>        struct vt8500lcd_info *fbi = to_vt8500lcd_info(info);
>
>        writel((1 << 31)
> -               | (((var->xres_virtual - var->xres) * pixlen / 4) << 20)
> -               | (off >> 2), fbi->regbase + 0x20);
> +            | (((info->var.xres_virtual - info->var.xres) * pixlen / 4) << 20)
> +            | (off >> 2), fbi->regbase + 0x20);
>        return 0;
>  }
>
> --
> 1.7.3.4
>
>

Best regards,
Alexey

^ permalink raw reply

* Re: efifb not detected on Intel DQ67SW
From: Andrew Lutomirski @ 2011-05-26  4:09 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <BANLkTikxX577VKmPRVGcp_Chj-udCf-KaQ@mail.gmail.com>

On Wed, May 25, 2011 at 2:54 PM, Andrew Lutomirski <luto@mit.edu> wrote:
> On Wed, May 25, 2011 at 2:32 PM, Matthew Garrett <mjg@redhat.com> wrote:
>> On Wed, May 25, 2011 at 02:21:17PM -0400, Andrew Lutomirski wrote:
>>
>>> Looking at the code, I'm a little confused how it's supposed to work.
>>> AFAICT, unless there's a DMI match, then the driver will only load
>>> ifthe boot code sets VIDEO_TYPE_EFI, but nothing sets that.
>>
>> grub should be setting that.
>
> It looks like grub-fedora (the git version, anyway) has a function
> set_kernel_params that tries to do this.  Peter, the git tree claims
> that you maintain it.  Are there any experiments you'd like me to do?
> (Dumping boot_params, perhaps?)

It's a bug in grub.  If I have a splashimage then efifb works.  If I
don't, then efifb doesn't.  If I don't hear anything back soon, I'll
file a bug against Fedora.

FWIW, efifb seems really slow.

--Andy

>
> --Andy
>

^ permalink raw reply

* Re: [PATCH 00/29] Use display information in info not in var for panning
From: Geert Uytterhoeven @ 2011-05-26  5:23 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1306364301-8195-1-git-send-email-laurent.pinchart@ideasonboard.com>

On Thu, May 26, 2011 at 00:57, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> 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.

Haven't gone through all patches, but the above is correct.

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply

* [PATCH] fbdev: sh_mobile_lcdcfb: Reduce scope and rename result variable
From: Damian Hobson-Garcia @ 2011-05-26  6:53 UTC (permalink / raw)
  To: linux-fbdev

Commit 69843ba7f24950f8ef5dadacfbfbd08f53e3455b
reduces the scope of the variable that was used to get the
return value of ops->meram_register() in sh_mobile_lcdc_start.

In order to avoid conflicts with that patch, the variable has been renamed
and scoped within the local if-clause.
---
 drivers/video/sh_mobile_lcdcfb.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
index 404c03b..596b662 100644
--- a/drivers/video/sh_mobile_lcdcfb.c
+++ b/drivers/video/sh_mobile_lcdcfb.c
@@ -617,6 +617,7 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
 			unsigned long icb_addr_y, icb_addr_c;
 			int icb_pitch;
 			int pf;
+			int retval;
 
 			cfg = ch->cfg.meram_cfg;
 			mdev = priv->meram_dev;
@@ -637,7 +638,7 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
 				pf = SH_MOBILE_MERAM_PF_RGB;
 			}
 
-			ret = mdev->ops->meram_register(mdev, cfg, pitch,
+			retval = mdev->ops->meram_register(mdev, cfg, pitch,
 						ch->info->var.yres,
 						pf,
 						base_addr_y,
@@ -645,7 +646,7 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
 						&icb_addr_y,
 						&icb_addr_c,
 						&icb_pitch);
-			if (!ret)  {
+			if (!retval)  {
 				/* set LDSA1R value */
 				base_addr_y = icb_addr_y;
 				pitch = icb_pitch;
-- 
1.7.1


^ permalink raw reply related

* Re: [PATCH 00/29] Use display information in info not in var for panning
From: Laurent Pinchart @ 2011-05-26  8:17 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1306364301-8195-1-git-send-email-laurent.pinchart@ideasonboard.com>

Hi Geert,

On Thursday 26 May 2011 07:23:36 Geert Uytterhoeven wrote:
> On Thu, May 26, 2011 at 00:57, Laurent Pinchart wrote:
> > 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.
> 
> Haven't gone through all patches, but the above is correct.
> 
> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

Thanks.

I will wait a couple of days for individual drievr maintainers to reply. I 
don't expect to get an ack for every driver, so we will have to decide whether 
to apply some of the patches without testing them.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply

* [PATCH] fbdev: sh_mobile_lcdcfb: Change BGR24 to RGB24
From: Damian Hobson-Garcia @ 2011-05-26  9:09 UTC (permalink / raw)
  To: linux-fbdev

The ordering of the bytes in the 24 bpp RGB colour mode was
being set to BGR.

This now matches the values returned in the
struct fb_var_screeninfo .red, .green, and .blue offsets as well as
the output format of other blocs, such as the VEU

Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
---
 drivers/video/sh_mobile_lcdcfb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
index 04f2260..a442471 100644
--- a/drivers/video/sh_mobile_lcdcfb.c
+++ b/drivers/video/sh_mobile_lcdcfb.c
@@ -590,7 +590,7 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
 				tmp |= 0x03;
 				break;
 			case 24:
-				tmp |= 0x0b;
+				tmp |= 0x02;
 				break;
 			case 32:
 				break;
@@ -1178,7 +1178,7 @@ static int sh_mobile_lcdc_set_bpp(struct fb_var_screeninfo *var, int bpp,
 		var->transp.length = 0;
 		break;
 
-	case 24: /* PKF[4:0] = 01011 - RGB 888 */
+	case 24: /* PKF[4:0] = 00010 - RGB 888 */
 		var->red.offset = 16;
 		var->red.length = 8;
 		var->green.offset = 8;
-- 
1.7.1


^ permalink raw reply related

* Re: [PATCH] fbdev: sh_mobile_lcdcfb: Reduce scope and rename result variable
From: Laurent Pinchart @ 2011-05-26  9:32 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1306392790-17462-1-git-send-email-dhobsong@igel.co.jp>

Hi Damian,

On Thursday 26 May 2011 08:53:10 Damian Hobson-Garcia wrote:
> Commit 69843ba7f24950f8ef5dadacfbfbd08f53e3455b
> reduces the scope of the variable that was used to get the
> return value of ops->meram_register() in sh_mobile_lcdc_start.
> 
> In order to avoid conflicts with that patch, the variable has been renamed
> and scoped within the local if-clause.

Is there a need for this patch after 
http://git.kernel.org/?p=linux/kernel/git/lethal/fbdev-2.6.git;a=commitdiff;hÀ46a54e7e98577d3f04ce9d7ef1ec43a41c9061;hpw32eeb425419599de15096ce92d7eb6a51d749a 
?

> ---
>  drivers/video/sh_mobile_lcdcfb.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/video/sh_mobile_lcdcfb.c
> b/drivers/video/sh_mobile_lcdcfb.c index 404c03b..596b662 100644
> --- a/drivers/video/sh_mobile_lcdcfb.c
> +++ b/drivers/video/sh_mobile_lcdcfb.c
> @@ -617,6 +617,7 @@ static int sh_mobile_lcdc_start(struct
> sh_mobile_lcdc_priv *priv) unsigned long icb_addr_y, icb_addr_c;
>  			int icb_pitch;
>  			int pf;
> +			int retval;
> 
>  			cfg = ch->cfg.meram_cfg;
>  			mdev = priv->meram_dev;
> @@ -637,7 +638,7 @@ static int sh_mobile_lcdc_start(struct
> sh_mobile_lcdc_priv *priv) pf = SH_MOBILE_MERAM_PF_RGB;
>  			}
> 
> -			ret = mdev->ops->meram_register(mdev, cfg, pitch,
> +			retval = mdev->ops->meram_register(mdev, cfg, pitch,
>  						ch->info->var.yres,
>  						pf,
>  						base_addr_y,
> @@ -645,7 +646,7 @@ static int sh_mobile_lcdc_start(struct
> sh_mobile_lcdc_priv *priv) &icb_addr_y,
>  						&icb_addr_c,
>  						&icb_pitch);
> -			if (!ret)  {
> +			if (!retval)  {
>  				/* set LDSA1R value */
>  				base_addr_y = icb_addr_y;
>  				pitch = icb_pitch;

-- 
Regards,

Laurent Pinchart

^ permalink raw reply

* Re: [PATCH] fbdev: sh_mobile_lcdcfb: Reduce scope and rename result
From: Damian Hobson-Garcia @ 2011-05-26  9:36 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1306392790-17462-1-git-send-email-dhobsong@igel.co.jp>

Hi Laurent,
On 2011/05/26 18:32, Laurent Pinchart wrote:
> Hi Damian,
> 
> On Thursday 26 May 2011 08:53:10 Damian Hobson-Garcia wrote:
>> Commit 69843ba7f24950f8ef5dadacfbfbd08f53e3455b
>> reduces the scope of the variable that was used to get the
>> return value of ops->meram_register() in sh_mobile_lcdc_start.
>>
>> In order to avoid conflicts with that patch, the variable has been renamed
>> and scoped within the local if-clause.
> 
> Is there a need for this patch after 
> http://git.kernel.org/?p=linux/kernel/git/lethal/fbdev-2.6.git;a=commitdiff;hÀ46a54e7e98577d3f04ce9d7ef1ec43a41c9061;hpw32eeb425419599de15096ce92d7eb6a51d749a 
> ?
Nope, with this patch there is no need for mine at all.

Thanks,
Damian
> 
>> ---
>>  drivers/video/sh_mobile_lcdcfb.c |    5 +++--
>>  1 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/video/sh_mobile_lcdcfb.c
>> b/drivers/video/sh_mobile_lcdcfb.c index 404c03b..596b662 100644
>> --- a/drivers/video/sh_mobile_lcdcfb.c
>> +++ b/drivers/video/sh_mobile_lcdcfb.c
>> @@ -617,6 +617,7 @@ static int sh_mobile_lcdc_start(struct
>> sh_mobile_lcdc_priv *priv) unsigned long icb_addr_y, icb_addr_c;
>>  			int icb_pitch;
>>  			int pf;
>> +			int retval;
>>
>>  			cfg = ch->cfg.meram_cfg;
>>  			mdev = priv->meram_dev;
>> @@ -637,7 +638,7 @@ static int sh_mobile_lcdc_start(struct
>> sh_mobile_lcdc_priv *priv) pf = SH_MOBILE_MERAM_PF_RGB;
>>  			}
>>
>> -			ret = mdev->ops->meram_register(mdev, cfg, pitch,
>> +			retval = mdev->ops->meram_register(mdev, cfg, pitch,
>>  						ch->info->var.yres,
>>  						pf,
>>  						base_addr_y,
>> @@ -645,7 +646,7 @@ static int sh_mobile_lcdc_start(struct
>> sh_mobile_lcdc_priv *priv) &icb_addr_y,
>>  						&icb_addr_c,
>>  						&icb_pitch);
>> -			if (!ret)  {
>> +			if (!retval)  {
>>  				/* set LDSA1R value */
>>  				base_addr_y = icb_addr_y;
>>  				pitch = icb_pitch;


^ permalink raw reply

* Re: efifb not detected on Intel DQ67SW
From: Peter Jones @ 2011-05-26 13:56 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <BANLkTikxX577VKmPRVGcp_Chj-udCf-KaQ@mail.gmail.com>

On 05/26/2011 12:09 AM, Andrew Lutomirski wrote:
> On Wed, May 25, 2011 at 2:54 PM, Andrew Lutomirski <luto@mit.edu> wrote:
>> On Wed, May 25, 2011 at 2:32 PM, Matthew Garrett <mjg@redhat.com> wrote:
>>> On Wed, May 25, 2011 at 02:21:17PM -0400, Andrew Lutomirski wrote:
>>>
>>>> Looking at the code, I'm a little confused how it's supposed to work.
>>>> AFAICT, unless there's a DMI match, then the driver will only load
>>>> ifthe boot code sets VIDEO_TYPE_EFI, but nothing sets that.
>>>
>>> grub should be setting that.
>>
>> It looks like grub-fedora (the git version, anyway) has a function
>> set_kernel_params that tries to do this.  Peter, the git tree claims
>> that you maintain it.  Are there any experiments you'd like me to do?
>> (Dumping boot_params, perhaps?)
> 
> It's a bug in grub.  If I have a splashimage then efifb works.  If I
> don't, then efifb doesn't.  If I don't hear anything back soon, I'll
> file a bug against Fedora.

That's expected, though I admit it's not the best thing ever. We're currently
working on not needing that bootloader at all any more, in favor of grub2,
which doesn't have this limitation.

> FWIW, efifb seems really slow.

It's a non-accelerated console.  Of course it's slow.

-- 
        Peter

^ permalink raw reply

* Re: [PATCH 21/29] s3fb: use display information in info not in var
From: Tormod Volden @ 2011-05-26 14:12 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1306364301-8195-22-git-send-email-laurent.pinchart@ideasonboard.com>

On Thu, May 26, 2011 at 12:58 AM, Laurent Pinchart wrote:
> 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: Antonino Daplas <adaplas@gmail.com>
> ---
>  drivers/video/savage/savagefb_driver.c |   16 +++++++---------
>  1 files changed, 7 insertions(+), 9 deletions(-)

The patch title is misleading, this is not the s3fb driver but the
savagefb driver.

Tormod

^ permalink raw reply

* Re: efifb not detected on Intel DQ67SW
From: Andrew Lutomirski @ 2011-05-26 14:12 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <BANLkTikxX577VKmPRVGcp_Chj-udCf-KaQ@mail.gmail.com>

On Thu, May 26, 2011 at 9:56 AM, Peter Jones <pjones@redhat.com> wrote:
> On 05/26/2011 12:09 AM, Andrew Lutomirski wrote:
>> On Wed, May 25, 2011 at 2:54 PM, Andrew Lutomirski <luto@mit.edu> wrote:
>>> On Wed, May 25, 2011 at 2:32 PM, Matthew Garrett <mjg@redhat.com> wrote:
>>>> On Wed, May 25, 2011 at 02:21:17PM -0400, Andrew Lutomirski wrote:
>>>>
>>>>> Looking at the code, I'm a little confused how it's supposed to work.
>>>>> AFAICT, unless there's a DMI match, then the driver will only load
>>>>> ifthe boot code sets VIDEO_TYPE_EFI, but nothing sets that.
>>>>
>>>> grub should be setting that.
>>>
>>> It looks like grub-fedora (the git version, anyway) has a function
>>> set_kernel_params that tries to do this.  Peter, the git tree claims
>>> that you maintain it.  Are there any experiments you'd like me to do?
>>> (Dumping boot_params, perhaps?)
>>
>> It's a bug in grub.  If I have a splashimage then efifb works.  If I
>> don't, then efifb doesn't.  If I don't hear anything back soon, I'll
>> file a bug against Fedora.
>
> That's expected, though I admit it's not the best thing ever. We're currently
> working on not needing that bootloader at all any more, in favor of grub2,
> which doesn't have this limitation.
>
>> FWIW, efifb seems really slow.
>
> It's a non-accelerated console.  Of course it's slow.

Yes, but it's really really amazingly slow.  It's so slow that merely
enabling it doubles the time it takes to get i915 loaded.  A one-liner
to fix it is coming right now...

--Andy

^ permalink raw reply

* [PATCH 0/4] efifb speedup and fixes
From: Andy Lutomirski @ 2011-05-26 14:13 UTC (permalink / raw)
  To: linux-fbdev

Fbcon over efifb is so slow that I thought I needed a faster modem.
It turns out that scrolling boot messages at 1024x768 pixels with
uncached accesses can take longer than every other step of kernel
bootup *combined*.

Fixing it is a one-liner, but I found some bugs while I was digging
around.  One is a mismatched resource release (although not on my
box), one is a harmless compiler warning, and one fixes all manner of
badness that happens if you manually bind or unbind the efifb driver.

The speedup may or may not be 2.6.40 material, but the other fixes
should probably go in.  (2/4 and 4/4 are possibly -stable candidates.)

Andy Lutomirski (4):
  efifb: Enable write-combining
  efifb: Fix mismatched request/release_mem_region
  efifb: Fix an integer-to-pointer size warning
  efifb: Disallow manual bind and unbind

Andy Lutomirski (4):
  efifb: Enable write-combining
  efifb: Fix mismatched request/release_mem_region
  efifb: Fix an integer-to-pointer size warning
  efifb: Disallow manual bind and unbind

 drivers/video/efifb.c |   39 +++++++++++++++++++++++++--------------
 1 files changed, 25 insertions(+), 14 deletions(-)

-- 
1.7.5.1


^ permalink raw reply

* [PATCH 1/4] efifb: Enable write-combining
From: Andy Lutomirski @ 2011-05-26 14:13 UTC (permalink / raw)
  To: linux-fbdev

Running fbcon on an uncached framebuffer is remarkably slow.  So try
to enable write combining in efifb.

Without this patch, it takes 5.8 seconds from efifb probe to i915
probe (default options; no plymouth or quiet mode).  With this patch,
it only takes 1.7 seconds.  That means we wasted over 4 seconds just
writing to UC memory.

Signed-off-by: Andy Lutomirski <luto@mit.edu>
---
 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 4eb38db..a81c944 100644
--- a/drivers/video/efifb.c
+++ b/drivers/video/efifb.c
@@ -413,7 +413,7 @@ static int __devinit efifb_probe(struct platform_device *dev)
 	info->apertures->ranges[0].base = efifb_fix.smem_start;
 	info->apertures->ranges[0].size = size_remap;
 
-	info->screen_base = ioremap(efifb_fix.smem_start, efifb_fix.smem_len);
+	info->screen_base = ioremap_wc(efifb_fix.smem_start, efifb_fix.smem_len);
 	if (!info->screen_base) {
 		printk(KERN_ERR "efifb: abort, cannot ioremap video memory "
 				"0x%x @ 0x%lx\n",
-- 
1.7.5.1


^ permalink raw reply related

* [PATCH 2/4] efifb: Fix mismatched request/release_mem_region
From: Andy Lutomirski @ 2011-05-26 14:13 UTC (permalink / raw)
  To: linux-fbdev

Signed-off-by: Andy Lutomirski <luto@mit.edu>
---
 drivers/video/efifb.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c
index a81c944..43af770 100644
--- a/drivers/video/efifb.c
+++ b/drivers/video/efifb.c
@@ -16,6 +16,8 @@
 #include <linux/pci.h>
 #include <video/vga.h>
 
+static bool request_mem_succeeded = false;
+
 static struct fb_var_screeninfo efifb_defined __devinitdata = {
 	.activate		= FB_ACTIVATE_NOW,
 	.height			= -1,
@@ -281,7 +283,9 @@ static void efifb_destroy(struct fb_info *info)
 {
 	if (info->screen_base)
 		iounmap(info->screen_base);
-	release_mem_region(info->apertures->ranges[0].base, info->apertures->ranges[0].size);
+	if (request_mem_succeeded)
+		release_mem_region(info->apertures->ranges[0].base,
+				   info->apertures->ranges[0].size);
 	framebuffer_release(info);
 }
 
@@ -333,7 +337,6 @@ static int __devinit efifb_probe(struct platform_device *dev)
 	unsigned int size_vmode;
 	unsigned int size_remap;
 	unsigned int size_total;
-	int request_succeeded = 0;
 
 	if (!screen_info.lfb_depth)
 		screen_info.lfb_depth = 32;
@@ -387,7 +390,7 @@ static int __devinit efifb_probe(struct platform_device *dev)
 	efifb_fix.smem_len = size_remap;
 
 	if (request_mem_region(efifb_fix.smem_start, size_remap, "efifb")) {
-		request_succeeded = 1;
+		request_mem_succeeded = true;
 	} else {
 		/* We cannot make this fatal. Sometimes this comes from magic
 		   spaces our resource handlers simply don't know about */
@@ -491,7 +494,7 @@ err_unmap:
 err_release_fb:
 	framebuffer_release(info);
 err_release_mem:
-	if (request_succeeded)
+	if (request_mem_succeeded)
 		release_mem_region(efifb_fix.smem_start, size_total);
 	return err;
 }
-- 
1.7.5.1


^ permalink raw reply related

* [PATCH 3/4] efifb: Fix an integer-to-pointer size warning
From: Andy Lutomirski @ 2011-05-26 14:13 UTC (permalink / raw)
  To: linux-fbdev

Signed-off-by: Andy Lutomirski <luto@mit.edu>
---
 drivers/video/efifb.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c
index 43af770..39bbfa9 100644
--- a/drivers/video/efifb.c
+++ b/drivers/video/efifb.c
@@ -246,8 +246,9 @@ static int set_system(const struct dmi_system_id *id)
 
 	printk(KERN_INFO "efifb: dmi detected %s - framebuffer at %p "
 			 "(%dx%d, stride %d)\n", id->ident,
-			 (void *)screen_info.lfb_base, screen_info.lfb_width,
-			 screen_info.lfb_height, screen_info.lfb_linelength);
+			 (void *)(unsigned long)screen_info.lfb_base,
+			 screen_info.lfb_width, screen_info.lfb_height,
+			 screen_info.lfb_linelength);
 
 
 	return 1;
-- 
1.7.5.1


^ permalink raw reply related


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