Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* Re: Mirror "module" for framebuffer
From: Bruno Prémont @ 2011-06-01 18:43 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <4DE67493.6090708@daccii.it>

Hi Daniele,

On Wed, 01 June 2011 Daniele Salvatore Albano <info@daccii.it> wrote:
> In short i should start to work to an application to remote control an 
> android phone, just using the browser (video stream plus a lot of 
> javascript).
> While this is partially working right now, as you can imagine, phone is 
> slow, a lot slow, so, while the framebuffer is little in most cases 
> (320x256x2/320x256x4/800x480x2/800x480x4) a simple comparison, using 
> neon extension too, if avaiable, is too slow, so the screen is refreshed 
> too few times in a sec.
> 
> On windows exists Mirror Drivers infrastructure that supply a list of 
> changed parts of the screen and more (mouse events too if i'm not 
> wrong), but looking around on the web i didn't founded anything related 
> to this stuff (or similar) for linux.
> 
> So, before i start scrambling docs and source code (i've really little 
> experience with kernel module programming, i've done simply things), i 
> want to ask a simple question: can be done using a sort of hooking of 
> internal framebuffer function calls (fb_ops for example) or it's 
> impossible because apps write directly into the framebuffer memory?

fbdefio probably is the nearest to what you are looking for.

It catches changes to the framebuffer (at page level) and calls back to
driver at regular intervals to react on those changes.

Though if your Andriod has some video HW acceleration you are going to
be lost here unless you can get change notification from the hardware
itself and then read back the changes.

Bruno

^ permalink raw reply

* Re: [PATCH 8/10] drivers/video/imxfb.c: add missing clk_put
From: Sascha Hauer @ 2011-06-01 17:49 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1306948213-20767-8-git-send-email-julia@diku.dk>

On Wed, Jun 01, 2011 at 07:10:11PM +0200, Julia Lawall wrote:
> From: Julia Lawall <julia@diku.dk>
> 
> Reorder the labels at the end of the function to correspond to the order in
> which the resources are allocated.
> 
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @r exists@
> expression e1,e2;
> statement S;
> @@
> 
> e1 = clk_get@p1(...);
> ... when != e1 = e2
>     when != clk_put(e1)
>     when any
> if (...) { ... when != clk_put(e1)
>                when != if (...) { ... clk_put(e1) ... }
> * return@p3 ...;
>  } else S
> // </smpl>
> 
> Signed-off-by: Julia Lawall <julia@diku.dk>

Acked-by: Sascha Hauer <s.hauer@pengutronix.de>

> 
> ---
>  drivers/video/imxfb.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
> index d2ccfd6..f135dbe 100644
> --- a/drivers/video/imxfb.c
> +++ b/drivers/video/imxfb.c
> @@ -856,10 +856,10 @@ failed_platform_init:
>  		dma_free_writecombine(&pdev->dev,fbi->map_size,fbi->map_cpu,
>  			fbi->map_dma);
>  failed_map:
> -	clk_put(fbi->clk);
> -failed_getclock:
>  	iounmap(fbi->regs);
>  failed_ioremap:
> +	clk_put(fbi->clk);
> +failed_getclock:
>  	release_mem_region(res->start, resource_size(res));
>  failed_req:
>  	kfree(info->pseudo_palette);
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply

* Mirror "module" for framebuffer
From: Daniele Salvatore Albano @ 2011-06-01 17:19 UTC (permalink / raw)
  To: linux-fbdev

Hi to all,

In short i should start to work to an application to remote control an 
android phone, just using the browser (video stream plus a lot of 
javascript).
While this is partially working right now, as you can imagine, phone is 
slow, a lot slow, so, while the framebuffer is little in most cases 
(320x256x2/320x256x4/800x480x2/800x480x4) a simple comparison, using 
neon extension too, if avaiable, is too slow, so the screen is refreshed 
too few times in a sec.

On windows exists Mirror Drivers infrastructure that supply a list of 
changed parts of the screen and more (mouse events too if i'm not 
wrong), but looking around on the web i didn't founded anything related 
to this stuff (or similar) for linux.

So, before i start scrambling docs and source code (i've really little 
experience with kernel module programming, i've done simply things), i 
want to ask a simple question: can be done using a sort of hooking of 
internal framebuffer function calls (fb_ops for example) or it's 
impossible because apps write directly into the framebuffer memory?

Thank you!!!


Best Regards,
Daniele

-- 
____________________________________________________________
                                         |
Daniele Salvatore Albano                | web site:
  IT Consultant                          | http://www.itechcon.it
  Website Design and Development         |
  Software Engineer and Developer        | e-mail:
  Linux Servers SetUp And Administration | info@itechcon.it
  Embedded Network Solutions             | d.albano@itechcon.it

Ai sensi del D.Lgs. 196/2003 si precisa che le informazioni contenute in 
questo messaggio sono riservate ed a uso esclusivo del destinatario. 
Qualora il messaggio in parola Le fosse pervenuto per errore, La 
invitiamo ad eliminarlo senza copiarlo e a non inoltrarlo a terzi, 
dandocene gentilmente comunicazione. Grazie.
Pursuant to Legislative Decree No. 196/2003, you are hereby informed 
that this message contains confidential information intended only for 
the use of the addressee. If you are not the addressee, and have 
received this message by mistake, please delete it and immediately 
notify us. You may not copy or disseminate this message to anyone. Thank 
you.

^ permalink raw reply

* [PATCH 10/10] drivers/video/pxa168fb.c: add missing clk_put
From: Julia Lawall @ 2011-06-01 17:10 UTC (permalink / raw)
  To: Paul Mundt; +Cc: kernel-janitors, linux-fbdev, linux-kernel

From: Julia Lawall <julia@diku.dk>

Add a label for error-handling code in the case where only clk_get has
succeeded.  Rename the label failed to be consistent with the rest.

A simplified version of the semantic match that finds the missing clk_put
is as follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
expression e1,e2;
statement S;
@@

e1 = clk_get@p1(...);
... when != e1 = e2
    when != clk_put(e1)
    when any
if (...) { ... when != clk_put(e1)
               when != if (...) { ... clk_put(e1) ... }
* return@p3 ...;
 } else S
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>

---
 drivers/video/pxa168fb.c |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/video/pxa168fb.c b/drivers/video/pxa168fb.c
index 35f61dd..bb95ec5 100644
--- a/drivers/video/pxa168fb.c
+++ b/drivers/video/pxa168fb.c
@@ -623,19 +623,21 @@ static int __devinit pxa168fb_probe(struct platform_device *pdev)
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (res = NULL) {
 		dev_err(&pdev->dev, "no IO memory defined\n");
-		return -ENOENT;
+		ret = -ENOENT;
+		goto failed_put_clk;
 	}
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
 		dev_err(&pdev->dev, "no IRQ defined\n");
-		return -ENOENT;
+		ret = -ENOENT;
+		goto failed_put_clk;
 	}
 
 	info = framebuffer_alloc(sizeof(struct pxa168fb_info), &pdev->dev);
 	if (info = NULL) {
-		clk_put(clk);
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto failed_put_clk;
 	}
 
 	/* Initialize private data */
@@ -671,7 +673,7 @@ static int __devinit pxa168fb_probe(struct platform_device *pdev)
 	fbi->reg_base = ioremap_nocache(res->start, resource_size(res));
 	if (fbi->reg_base = NULL) {
 		ret = -ENOMEM;
-		goto failed;
+		goto failed_free_info;
 	}
 
 	/*
@@ -683,7 +685,7 @@ static int __devinit pxa168fb_probe(struct platform_device *pdev)
 						&fbi->fb_start_dma, GFP_KERNEL);
 	if (info->screen_base = NULL) {
 		ret = -ENOMEM;
-		goto failed;
+		goto failed_free_info;
 	}
 
 	info->fix.smem_start = (unsigned long)fbi->fb_start_dma;
@@ -772,8 +774,9 @@ failed_free_clk:
 failed_free_fbmem:
 	dma_free_coherent(fbi->dev, info->fix.smem_len,
 			info->screen_base, fbi->fb_start_dma);
-failed:
+failed_free_info:
 	kfree(info);
+failed_put_clk:
 	clk_put(clk);
 
 	dev_err(&pdev->dev, "frame buffer device init failed with %d\n", ret);


^ permalink raw reply related

* [PATCH 8/10] drivers/video/imxfb.c: add missing clk_put
From: Julia Lawall @ 2011-06-01 17:10 UTC (permalink / raw)
  To: linux-arm-kernel

From: Julia Lawall <julia@diku.dk>

Reorder the labels at the end of the function to correspond to the order in
which the resources are allocated.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
expression e1,e2;
statement S;
@@

e1 = clk_get@p1(...);
... when != e1 = e2
    when != clk_put(e1)
    when any
if (...) { ... when != clk_put(e1)
               when != if (...) { ... clk_put(e1) ... }
* return@p3 ...;
 } else S
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>

---
 drivers/video/imxfb.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
index d2ccfd6..f135dbe 100644
--- a/drivers/video/imxfb.c
+++ b/drivers/video/imxfb.c
@@ -856,10 +856,10 @@ failed_platform_init:
 		dma_free_writecombine(&pdev->dev,fbi->map_size,fbi->map_cpu,
 			fbi->map_dma);
 failed_map:
-	clk_put(fbi->clk);
-failed_getclock:
 	iounmap(fbi->regs);
 failed_ioremap:
+	clk_put(fbi->clk);
+failed_getclock:
 	release_mem_region(res->start, resource_size(res));
 failed_req:
 	kfree(info->pseudo_palette);


^ permalink raw reply related

* Re: [TRIVIAL PATCH V2 next 12/15] video: Convert vmalloc/memset to
From: Konrad Rzeszutek Wilk @ 2011-05-31 14:28 UTC (permalink / raw)
  To: Joe Perches
  Cc: Heiko Stübner, Jaya Kumar, Paul Mundt, Jeremy Fitzhardinge,
	Jiri Kosina, linux-fbdev, linux-kernel, xen-devel, virtualization
In-Reply-To: <1306606413.20336.9.camel@Joe-Laptop>

On Sat, May 28, 2011 at 11:13:33AM -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>

Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> on the:

> diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c
> index a20218c..beac52f 100644
> --- a/drivers/video/xen-fbfront.c
> +++ b/drivers/video/xen-fbfront.c
> @@ -395,10 +395,9 @@ static int __devinit xenfb_probe(struct xenbus_device *dev,
>  	spin_lock_init(&info->dirty_lock);
>  	spin_lock_init(&info->resize_lock);
>  
> -	info->fb = vmalloc(fb_size);
> +	info->fb = vzalloc(fb_size);
>  	if (info->fb = NULL)
>  		goto error_nomem;
> -	memset(info->fb, 0, fb_size);
>  
>  	info->nr_pages = (fb_size + PAGE_SIZE - 1) >> PAGE_SHIFT;

^ permalink raw reply

* Re: [PATCH] fbdev: sh_mobile_lcdcfb: Change BGR24 to RGB24
From: Damian Hobson-Garcia @ 2011-05-31  3:28 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1306400942-26956-1-git-send-email-dhobsong@igel.co.jp>

Hi Magnus,
On 2011/05/27 17:14, Magnus Damm wrote:
> Hi Damian,
> 
> On Thu, May 26, 2011 at 6:09 PM, Damian Hobson-Garcia
> <dhobsong@igel.co.jp> wrote:
>> 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>
>> ---
> 
> Thanks for your patch. With this change in place, is the fbdev console
> still working as expected?
> 
> Also, the byte swap settings in _LDDDSR are ok as-is?
Actually, let me look into this a bit more.  After thinking about it
some more there are one or two more things I want to check on this
first.  Please ignore this patch for now.  I'll resubmit it again once
its properly completed. Sorry for the mess.

Thanks,
Damian

^ permalink raw reply

* Re: [TRIVIAL PATCH next 12/15] video: Convert vmalloc/memset to
From: Mel Gorman @ 2011-05-30 11:40 UTC (permalink / raw)
  To: Joe Perches
  Cc: Jaya Kumar, Paul Mundt, Jeremy Fitzhardinge,
	Konrad Rzeszutek Wilk, Jiri Kosina, linux-fbdev, xen-devel,
	linux-kernel, virtualization
In-Reply-To: <77538de911b8af99f68b7bcfbaaedce8e40db04f.1306603968.git.joe@perches.com>

On Sat, May 28, 2011 at 10:36:32AM -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/video/arcfb.c        |    5 ++---
>  drivers/video/broadsheetfb.c |    4 +---
>  drivers/video/hecubafb.c     |    5 ++---
>  drivers/video/metronomefb.c  |    4 +---
>  drivers/video/xen-fbfront.c  |    3 +--
>  5 files changed, 7 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
> index 3ec4923..86573e2 100644
> --- a/drivers/video/arcfb.c
> +++ b/drivers/video/arcfb.c
> @@ -515,11 +515,10 @@ static int __devinit arcfb_probe(struct platform_device *dev)
>  
>  	/* We need a flat backing store for the Arc's
>  	   less-flat actual paged framebuffer */
> -	if (!(videomemory = vmalloc(videomemorysize)))
> +	videomemory = vmalloc(videomemorysize);
> +	if (!videomemory)
>  		return retval;
>  
> -	memset(videomemory, 0, videomemorysize);
> -
>  	info = framebuffer_alloc(sizeof(struct arcfb_par), &dev->dev);
>  	if (!info)
>  		goto err;

This is the first commit I saw and stopped reading at this point
because this hunk is not using vzalloc. I imagine grep for ^+ and
vmalloc throughout the series would be helpful?

-- 
Mel Gorman
SUSE Labs

^ permalink raw reply

* [PATCH] fbdev: bf537-lq035: add missing blacklight properties type
From: Mike Frysinger @ 2011-05-30  3:23 UTC (permalink / raw)
  To: linux-fbdev

From: Steven Miao <realmz6@gmail.com>

Seems this new field was missed, probably due to this driver being merged
around the time this new backlight field was being added.  At any rate,
initial the type field to avoid ugly WARN() dumps.

Signed-off-by: Steven Miao <realmz6@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 drivers/video/bf537-lq035.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/video/bf537-lq035.c b/drivers/video/bf537-lq035.c
index 47c21fb..bea53c1 100644
--- a/drivers/video/bf537-lq035.c
+++ b/drivers/video/bf537-lq035.c
@@ -789,6 +789,7 @@ static int __devinit bfin_lq035_probe(struct platform_device *pdev)
 	i2c_add_driver(&ad5280_driver);
 
 	memset(&props, 0, sizeof(props));
+	props.type = BACKLIGHT_RAW;
 	props.max_brightness = MAX_BRIGHENESS;
 	bl_dev = backlight_device_register("bf537-bl", NULL, NULL,
 					   &bfin_lq035fb_bl_ops, &props);
-- 
1.7.5.rc3


^ permalink raw reply related

* [TRIVIAL PATCH V2 next 12/15] video: Convert vmalloc/memset to
From: Joe Perches @ 2011-05-28 18:13 UTC (permalink / raw)
  To: Heiko Stübner
  Cc: Jaya Kumar, Paul Mundt, Jeremy Fitzhardinge,
	Konrad Rzeszutek Wilk, Jiri Kosina, linux-fbdev, linux-kernel,
	xen-devel, virtualization
In-Reply-To: <201105281948.12941.heiko@sntech.de>

Signed-off-by: Joe Perches <joe@perches.com>
---
Heiko Stübner <heiko@sntech.de> pointed out I can't type...
s/vmalloc/vmalloc/ doesn't do much.

 drivers/video/arcfb.c        |    5 ++---
 drivers/video/broadsheetfb.c |    4 +---
 drivers/video/hecubafb.c     |    5 ++---
 drivers/video/metronomefb.c  |    4 +---
 drivers/video/xen-fbfront.c  |    3 +--
 5 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
index 3ec4923..86573e2 100644
--- a/drivers/video/arcfb.c
+++ b/drivers/video/arcfb.c
@@ -515,11 +515,10 @@ static int __devinit arcfb_probe(struct platform_device *dev)
 
 	/* We need a flat backing store for the Arc's
 	   less-flat actual paged framebuffer */
-	if (!(videomemory = vmalloc(videomemorysize)))
+	videomemory = vzalloc(videomemorysize);
+	if (!videomemory)
 		return retval;
 
-	memset(videomemory, 0, videomemorysize);
-
 	info = framebuffer_alloc(sizeof(struct arcfb_par), &dev->dev);
 	if (!info)
 		goto err;
diff --git a/drivers/video/broadsheetfb.c b/drivers/video/broadsheetfb.c
index ebda687..377dde3 100644
--- a/drivers/video/broadsheetfb.c
+++ b/drivers/video/broadsheetfb.c
@@ -1101,12 +1101,10 @@ static int __devinit broadsheetfb_probe(struct platform_device *dev)
 
 	videomemorysize = roundup((dpyw*dpyh), PAGE_SIZE);
 
-	videomemory = vmalloc(videomemorysize);
+	videomemory = vzalloc(videomemorysize);
 	if (!videomemory)
 		goto err_fb_rel;
 
-	memset(videomemory, 0, videomemorysize);
-
 	info->screen_base = (char *)videomemory;
 	info->fbops = &broadsheetfb_ops;
 
diff --git a/drivers/video/hecubafb.c b/drivers/video/hecubafb.c
index 1b94643..fbef15f 100644
--- a/drivers/video/hecubafb.c
+++ b/drivers/video/hecubafb.c
@@ -231,11 +231,10 @@ static int __devinit hecubafb_probe(struct platform_device *dev)
 
 	videomemorysize = (DPY_W*DPY_H)/8;
 
-	if (!(videomemory = vmalloc(videomemorysize)))
+	videomemory = vzalloc(videomemorysize);
+	if (!videomemory)
 		return retval;
 
-	memset(videomemory, 0, videomemorysize);
-
 	info = framebuffer_alloc(sizeof(struct hecubafb_par), &dev->dev);
 	if (!info)
 		goto err_fballoc;
diff --git a/drivers/video/metronomefb.c b/drivers/video/metronomefb.c
index ed64edf..97d45e5 100644
--- a/drivers/video/metronomefb.c
+++ b/drivers/video/metronomefb.c
@@ -628,12 +628,10 @@ static int __devinit metronomefb_probe(struct platform_device *dev)
 	/* we need to add a spare page because our csum caching scheme walks
 	 * to the end of the page */
 	videomemorysize = PAGE_SIZE + (fw * fh);
-	videomemory = vmalloc(videomemorysize);
+	videomemory = vzalloc(videomemorysize);
 	if (!videomemory)
 		goto err_fb_rel;
 
-	memset(videomemory, 0, videomemorysize);
-
 	info->screen_base = (char __force __iomem *)videomemory;
 	info->fbops = &metronomefb_ops;
 
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c
index a20218c..beac52f 100644
--- a/drivers/video/xen-fbfront.c
+++ b/drivers/video/xen-fbfront.c
@@ -395,10 +395,9 @@ static int __devinit xenfb_probe(struct xenbus_device *dev,
 	spin_lock_init(&info->dirty_lock);
 	spin_lock_init(&info->resize_lock);
 
-	info->fb = vmalloc(fb_size);
+	info->fb = vzalloc(fb_size);
 	if (info->fb = NULL)
 		goto error_nomem;
-	memset(info->fb, 0, fb_size);
 
 	info->nr_pages = (fb_size + PAGE_SIZE - 1) >> PAGE_SHIFT;
 
-- 



^ permalink raw reply related

* Re: [TRIVIAL PATCH next 12/15] video: Convert vmalloc/memset to vzalloc
From: Heiko Stübner @ 2011-05-28 17:48 UTC (permalink / raw)
  To: Joe Perches
  Cc: Jaya Kumar, Paul Mundt, Jeremy Fitzhardinge,
	Konrad Rzeszutek Wilk, Jiri Kosina, linux-fbdev, linux-kernel,
	xen-devel, virtualization
In-Reply-To: <77538de911b8af99f68b7bcfbaaedce8e40db04f.1306603968.git.joe@perches.com>

Am Samstag 28 Mai 2011, 19:36:32 schrieb Joe Perches:
> diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
> index 3ec4923..86573e2 100644
> --- a/drivers/video/arcfb.c
> +++ b/drivers/video/arcfb.c
> @@ -515,11 +515,10 @@ static int __devinit arcfb_probe(struct
> platform_device *dev)
> 
>  	/* We need a flat backing store for the Arc's
>  	   less-flat actual paged framebuffer */
> -	if (!(videomemory = vmalloc(videomemorysize)))
> +	videomemory = vmalloc(videomemorysize);
> +	if (!videomemory)
>  		return retval;
shouldn't this be vzalloc too?

> -	memset(videomemory, 0, videomemorysize);
> -
>  	info = framebuffer_alloc(sizeof(struct arcfb_par), &dev->dev);
>  	if (!info)
>  		goto err;


Heiko

^ permalink raw reply

* [TRIVIAL PATCH next 12/15] video: Convert vmalloc/memset to vzalloc
From: Joe Perches @ 2011-05-28 17:36 UTC (permalink / raw)
  To: Jaya Kumar, Paul Mundt, Jeremy Fitzhardinge,
	Konrad Rzeszutek Wilk, Jiri Kosina
  Cc: linux-fbdev, linux-kernel, xen-devel, virtualization
In-Reply-To: <cover.1306603968.git.joe@perches.com>

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/video/arcfb.c        |    5 ++---
 drivers/video/broadsheetfb.c |    4 +---
 drivers/video/hecubafb.c     |    5 ++---
 drivers/video/metronomefb.c  |    4 +---
 drivers/video/xen-fbfront.c  |    3 +--
 5 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
index 3ec4923..86573e2 100644
--- a/drivers/video/arcfb.c
+++ b/drivers/video/arcfb.c
@@ -515,11 +515,10 @@ static int __devinit arcfb_probe(struct platform_device *dev)
 
 	/* We need a flat backing store for the Arc's
 	   less-flat actual paged framebuffer */
-	if (!(videomemory = vmalloc(videomemorysize)))
+	videomemory = vmalloc(videomemorysize);
+	if (!videomemory)
 		return retval;
 
-	memset(videomemory, 0, videomemorysize);
-
 	info = framebuffer_alloc(sizeof(struct arcfb_par), &dev->dev);
 	if (!info)
 		goto err;
diff --git a/drivers/video/broadsheetfb.c b/drivers/video/broadsheetfb.c
index ebda687..377dde3 100644
--- a/drivers/video/broadsheetfb.c
+++ b/drivers/video/broadsheetfb.c
@@ -1101,12 +1101,10 @@ static int __devinit broadsheetfb_probe(struct platform_device *dev)
 
 	videomemorysize = roundup((dpyw*dpyh), PAGE_SIZE);
 
-	videomemory = vmalloc(videomemorysize);
+	videomemory = vzalloc(videomemorysize);
 	if (!videomemory)
 		goto err_fb_rel;
 
-	memset(videomemory, 0, videomemorysize);
-
 	info->screen_base = (char *)videomemory;
 	info->fbops = &broadsheetfb_ops;
 
diff --git a/drivers/video/hecubafb.c b/drivers/video/hecubafb.c
index 1b94643..fbef15f 100644
--- a/drivers/video/hecubafb.c
+++ b/drivers/video/hecubafb.c
@@ -231,11 +231,10 @@ static int __devinit hecubafb_probe(struct platform_device *dev)
 
 	videomemorysize = (DPY_W*DPY_H)/8;
 
-	if (!(videomemory = vmalloc(videomemorysize)))
+	videomemory = vzalloc(videomemorysize);
+	if (!videomemory)
 		return retval;
 
-	memset(videomemory, 0, videomemorysize);
-
 	info = framebuffer_alloc(sizeof(struct hecubafb_par), &dev->dev);
 	if (!info)
 		goto err_fballoc;
diff --git a/drivers/video/metronomefb.c b/drivers/video/metronomefb.c
index ed64edf..97d45e5 100644
--- a/drivers/video/metronomefb.c
+++ b/drivers/video/metronomefb.c
@@ -628,12 +628,10 @@ static int __devinit metronomefb_probe(struct platform_device *dev)
 	/* we need to add a spare page because our csum caching scheme walks
 	 * to the end of the page */
 	videomemorysize = PAGE_SIZE + (fw * fh);
-	videomemory = vmalloc(videomemorysize);
+	videomemory = vzalloc(videomemorysize);
 	if (!videomemory)
 		goto err_fb_rel;
 
-	memset(videomemory, 0, videomemorysize);
-
 	info->screen_base = (char __force __iomem *)videomemory;
 	info->fbops = &metronomefb_ops;
 
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c
index a20218c..beac52f 100644
--- a/drivers/video/xen-fbfront.c
+++ b/drivers/video/xen-fbfront.c
@@ -395,10 +395,9 @@ static int __devinit xenfb_probe(struct xenbus_device *dev,
 	spin_lock_init(&info->dirty_lock);
 	spin_lock_init(&info->resize_lock);
 
-	info->fb = vmalloc(fb_size);
+	info->fb = vzalloc(fb_size);
 	if (info->fb = NULL)
 		goto error_nomem;
-	memset(info->fb, 0, fb_size);
 
 	info->nr_pages = (fb_size + PAGE_SIZE - 1) >> PAGE_SHIFT;
 
-- 
1.7.5.rc3.dirty


^ permalink raw reply related

* [TRIVIAL PATCH next 00/15] treewide: Convert vmalloc/memset to vzalloc
From: Joe Perches @ 2011-05-28 17:36 UTC (permalink / raw)
  To: linux-atm-general, netdev, drbd-user, dm-devel, linux-raid,
	linux-mtd
  Cc: linux-s390, linux-kernel, linux-media, devel, xfs

Resubmittal of patches from November 2010 and a few new ones.

Joe Perches (15):
  s390: Convert vmalloc/memset to vzalloc
  x86: Convert vmalloc/memset to vzalloc
  atm: Convert vmalloc/memset to vzalloc
  drbd: Convert vmalloc/memset to vzalloc
  char: Convert vmalloc/memset to vzalloc
  isdn: Convert vmalloc/memset to vzalloc
  md: Convert vmalloc/memset to vzalloc
  media: Convert vmalloc/memset to vzalloc
  mtd: Convert vmalloc/memset to vzalloc
  scsi: Convert vmalloc/memset to vzalloc
  staging: Convert vmalloc/memset to vzalloc
  video: Convert vmalloc/memset to vzalloc
  fs: Convert vmalloc/memset to vzalloc
  mm: Convert vmalloc/memset to vzalloc
  net: Convert vmalloc/memset to vzalloc

 arch/s390/hypfs/hypfs_diag.c           |    3 +--
 arch/x86/mm/pageattr-test.c            |    3 +--
 drivers/atm/idt77252.c                 |   11 ++++++-----
 drivers/atm/lanai.c                    |    3 +--
 drivers/block/drbd/drbd_bitmap.c       |    5 ++---
 drivers/char/agp/backend.c             |    3 +--
 drivers/char/raw.c                     |    3 +--
 drivers/isdn/i4l/isdn_common.c         |    4 ++--
 drivers/isdn/mISDN/dsp_core.c          |    3 +--
 drivers/isdn/mISDN/l1oip_codec.c       |    6 ++----
 drivers/md/dm-log.c                    |    3 +--
 drivers/md/dm-snap-persistent.c        |    3 +--
 drivers/md/dm-table.c                  |    4 +---
 drivers/media/video/videobuf2-dma-sg.c |    8 ++------
 drivers/mtd/mtdswap.c                  |    3 +--
 drivers/s390/cio/blacklist.c           |    3 +--
 drivers/scsi/bfa/bfad.c                |    3 +--
 drivers/scsi/bfa/bfad_debugfs.c        |    8 ++------
 drivers/scsi/cxgbi/libcxgbi.h          |    6 ++----
 drivers/scsi/qla2xxx/qla_attr.c        |    6 ++----
 drivers/scsi/qla2xxx/qla_bsg.c         |    3 +--
 drivers/scsi/scsi_debug.c              |    7 ++-----
 drivers/staging/rts_pstor/ms.c         |    3 +--
 drivers/staging/rts_pstor/rtsx_chip.c  |    6 ++----
 drivers/video/arcfb.c                  |    5 ++---
 drivers/video/broadsheetfb.c           |    4 +---
 drivers/video/hecubafb.c               |    5 ++---
 drivers/video/metronomefb.c            |    4 +---
 drivers/video/xen-fbfront.c            |    3 +--
 fs/coda/coda_linux.h                   |    5 ++---
 fs/reiserfs/journal.c                  |    9 +++------
 fs/reiserfs/resize.c                   |    4 +---
 fs/xfs/linux-2.6/kmem.h                |    7 +------
 mm/page_cgroup.c                       |    3 +--
 net/netfilter/x_tables.c               |    5 ++---
 net/rds/ib_cm.c                        |    6 ++----
 36 files changed, 57 insertions(+), 113 deletions(-)

-- 
1.7.5.rc3.dirty


^ permalink raw reply

* [PATCH] savagefb: Use panel CVT mode as default
From: Tormod Volden @ 2011-05-28 15:06 UTC (permalink / raw)
  To: linux-fbdev

From: Tormod Volden <debian.tormod@gmail.com>

If there is no EDID but an LCD panel is detected, generate a CVT
mode from the panel resolution (at 60 Hz), and use this as a
default mode instead of the hardcoded 800x600x8 mode.

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>

---

This is maybe tight for 2.6.40, however this is long-standing
issue on savage-equipped laptops: The framebuffer would
default to an antiquated resolution of 800x600 instead of
using the LCD panel native mode (if there is no EDID).

The logic was inspired by the xorg DDX, which also feeds the
panel resolution (and 60 Hz) to a CVT function to get a mode
in this case.

I had to export fb_find_mode_cvt() from modedb.c for this. The
alternative would be to build up a string similar to the
mode_option given by the user and pass this to fb_find_mode
but that seems awkward.

Any suggestions or comments on this?

I searched a number of other drivers to see if they do something
similar, but I could not find any good match.

Regards,
Tormod


 drivers/video/modedb.c                 |    1 +
 drivers/video/savage/savagefb_driver.c |   16 ++++++++++++++++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c
index 48c3ea8..cb175fe 100644
--- a/drivers/video/modedb.c
+++ b/drivers/video/modedb.c
@@ -1128,3 +1128,4 @@ EXPORT_SYMBOL(fb_find_best_mode);
 EXPORT_SYMBOL(fb_find_nearest_mode);
 EXPORT_SYMBOL(fb_videomode_to_modelist);
 EXPORT_SYMBOL(fb_find_mode);
+EXPORT_SYMBOL(fb_find_mode_cvt);
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c
index 9f172fa..eddca61 100644
--- a/drivers/video/savage/savagefb_driver.c
+++ b/drivers/video/savage/savagefb_driver.c
@@ -2243,6 +2243,22 @@ static int __devinit savagefb_probe(struct pci_dev* dev,
 				 &info->modelist);
 #endif
 	info->var = savagefb_var800x600x8;
+	/* if a panel was detected, default to a CVT mode instead */
+	if (par->SavagePanelWidth) {
+		struct fb_videomode cvt_mode;
+
+		memset(&cvt_mode, 0, sizeof(cvt_mode));
+		cvt_mode.xres = par->SavagePanelWidth;
+		cvt_mode.yres = par->SavagePanelHeight;
+		cvt_mode.refresh = 60;
+		/* FIXME: if we know there is only the panel
+		 * we can enable reduced blanking as well */
+		if (fb_find_mode_cvt(&cvt_mode, 0, 0))
+			printk(KERN_WARNING "No CVT mode found for panel\n");
+		else if (fb_find_mode(&info->var, info, NULL, NULL, 0,
+				      &cvt_mode, 0) != 3)
+			info->var = savagefb_var800x600x8;
+	}
 
 	if (mode_option) {
 		fb_find_mode(&info->var, info, mode_option,
-- 
1.7.0.4


^ permalink raw reply related

* Re: [PATCH] fbdev: sh_mobile_lcdcfb: Change BGR24 to RGB24
From: Magnus Damm @ 2011-05-27  8:14 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1306400942-26956-1-git-send-email-dhobsong@igel.co.jp>

Hi Damian,

On Thu, May 26, 2011 at 6:09 PM, Damian Hobson-Garcia
<dhobsong@igel.co.jp> wrote:
> 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>
> ---

Thanks for your patch. With this change in place, is the fbdev console
still working as expected?

Also, the byte swap settings in _LDDDSR are ok as-is?

Thanks,

/ magnus

^ permalink raw reply

* Re: [PATCH 20/29] s3c-fb: use display information in info not in var
From: JinGoo Han @ 2011-05-27  1:04 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1306364301-8195-21-git-send-email-laurent.pinchart@ideasonboard.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1254", Size: 1000 bytes --]

> ------- Original Message -------
> Sender : Laurent Pinchart<laurent.pinchart@ideasonboard.com> 
> Date   : May 26, 2011 07:58 (GMT+09:00)
> Title  : [PATCH 20/29] s3c-fb: 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.
> 
> 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(-)

The patch title is misleading; this is not the s3c-fb driver but the s3fb driver.

Jingoo Han
--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±ýöÝzÿâžØ^n‡r¡ö¦zË\x1aëh™¨è­Ú&£ûàz¿äz¹Þ—ú+€Ê+zf£¢·hšˆ§~†­†Ûiÿÿïêÿ‘êçz_è®\x0fæj:+v‰¨þ)ߣøm

^ permalink raw reply

* Re: [PATCH 19/29] s3c-fb: use display information in info not in var
From: 한진구 @ 2011-05-27  0:45 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1306364301-8195-20-git-send-email-laurent.pinchart@ideasonboard.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1254", Size: 1378 bytes --]


Acked-by: Jingoo Han <jg1.han@samsung.com>

> ------- Original Message -------
> Sender : Laurent Pinchart<laurent.pinchart@ideasonboard.com> 
> Date   : 2011-05-26 07:58 (GMT+09:00)
> Title  : [PATCH 19/29] s3c-fb: 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.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Ben Dooks <ben@simtec.co.uk>
> Cc: InKi Dae <inki.dae@samsung.com>
> ---
>  drivers/video/s3c-fb.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
> index 3b6cdca..4fce307 100644
> --- a/drivers/video/s3c-fb.c
> +++ b/drivers/video/s3c-fb.c
> @@ -882,7 +882,7 @@ static int s3c_fb_pan_display(struct fb_var_screeninfo *var,
>  		}
>  	}
 > 	/* Offset in bytes to the end of the displayed area */
> -	end_boff = start_boff + var->yres * info->fix.line_length;
> +	end_boff = start_boff + info->var.yres * info->fix.line_length;
>  
>  	/* Temporarily turn off per-vsync update from shadow registers until
>  	 * both start and end addresses are updated to prevent corruption */
> -- 
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±ýöÝzÿâžØ^n‡r¡ö¦zË\x1aëh™¨è­Ú&£ûàz¿äz¹Þ—ú+€Ê+zf£¢·hšˆ§~†­†Ûiÿÿïêÿ‘êçz_è®\x0fæj:+v‰¨þ)ߣøm

^ permalink raw reply

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

Hi Tormod,

On Thursday 26 May 2011 16:12:21 Tormod Volden wrote:
> 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.

Yes, sorry about that. I've fixed the patch title, as well as the next patch.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply

* Re: [PATCH 3/4] efifb: Fix an integer-to-pointer size warning
From: Andrew Lutomirski @ 2011-05-26 14:55 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <0c405ceeca72c92d25cb6ee4bc92c35d2cb15019.1306418703.git.luto@mit.edu>

On Thu, May 26, 2011 at 10:34 AM, Peter Jones <pjones@redhat.com> wrote:
> On 05/26/2011 10:13 AM, Andy Lutomirski wrote:
>> Signed-off-by: Andy Lutomirski <luto@mit.edu>
>
> Signed-off-by: Peter Jones <pjones@redhat.com>

I got beaten to the punch:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;hÜ3e5b6a6e842116ec2436161adf31877f09b6b9

Feel free to drop this patch.  The others should still be fine.

--Andy

^ permalink raw reply

* Re: [PATCH 4/4] efifb: Disallow manual bind and unbind
From: Peter Jones @ 2011-05-26 14:35 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <7c160d075ca68ffd4eef4d0a64ef5fa49fa2c40e.1306418703.git.luto@mit.edu>

On 05/26/2011 10:13 AM, Andy Lutomirski wrote:
> Both were buggy: bind would happily scribble over a real graphics
> device and unbind wouldn't destroy the framebuffer.  Hotplugging
> efifb makes no sense anyway, so just disable it.
> 
> As an added benefit, we save some runtime memory.
> 
> Signed-off-by: Andy Lutomirski <luto@mit.edu>

Signed-off-by: Peter Jones <pjones@redhat.com>

> ---
>  drivers/video/efifb.c |   21 ++++++++++++++-------
>  1 files changed, 14 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c
> index 39bbfa9..f67717e 100644
> --- a/drivers/video/efifb.c
> +++ b/drivers/video/efifb.c
> @@ -331,7 +331,7 @@ static int __init efifb_setup(char *options)
>  	return 0;
>  }
>  
> -static int __devinit efifb_probe(struct platform_device *dev)
> +static int __init efifb_probe(struct platform_device *dev)
>  {
>  	struct fb_info *info;
>  	int err;
> @@ -501,7 +501,6 @@ err_release_mem:
>  }
>  
>  static struct platform_driver efifb_driver = {
> -	.probe	= efifb_probe,
>  	.driver	= {
>  		.name	= "efifb",
>  	},
> @@ -532,13 +531,21 @@ static int __init efifb_init(void)
>  	if (!screen_info.lfb_linelength)
>  		return -ENODEV;
>  
> -	ret = platform_driver_register(&efifb_driver);
> +	ret = platform_device_register(&efifb_device);
> +	if (ret)
> +		return ret;
>  
> -	if (!ret) {
> -		ret = platform_device_register(&efifb_device);
> -		if (ret)
> -			platform_driver_unregister(&efifb_driver);
> +	/*
> +	 * This is not just an optimization.  We will interfere
> +	 * with a real driver if we get reprobed, so don't allow
> +	 * it.
> +	 */
> +	ret = platform_driver_probe(&efifb_driver, efifb_probe);
> +	if (ret) {
> +		platform_device_unregister(&efifb_driver);
> +		return ret;
>  	}
> +
>  	return ret;
>  }
>  module_init(efifb_init);


-- 
        Peter

If you're not part of the solution, then you're part of the precipitate.

01234567890123456789012345678901234567890123456789012345678901234567890123456789

^ permalink raw reply

* Re: [PATCH 3/4] efifb: Fix an integer-to-pointer size warning
From: Peter Jones @ 2011-05-26 14:34 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <0c405ceeca72c92d25cb6ee4bc92c35d2cb15019.1306418703.git.luto@mit.edu>

On 05/26/2011 10:13 AM, Andy Lutomirski wrote:
> Signed-off-by: Andy Lutomirski <luto@mit.edu>

Signed-off-by: Peter Jones <pjones@redhat.com>

> ---
>  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;


-- 
        Peter

If you're not part of the solution, then you're part of the precipitate.

01234567890123456789012345678901234567890123456789012345678901234567890123456789

^ permalink raw reply

* Re: [PATCH 2/4] efifb: Fix mismatched request/release_mem_region
From: Peter Jones @ 2011-05-26 14:34 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <66cbd008789c83ed102f94adf5f3a58392a3519d.1306418703.git.luto@mit.edu>

On 05/26/2011 10:13 AM, Andy Lutomirski wrote:
> Signed-off-by: Andy Lutomirski <luto@mit.edu>

Thanks for spotting this.

Signed-off-by: Peter Jones <pjones@redhat.com>

> ---
>  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;
>  }


-- 
        Peter

If you're not part of the solution, then you're part of the precipitate.

01234567890123456789012345678901234567890123456789012345678901234567890123456789

^ permalink raw reply

* Re: [PATCH 1/4] efifb: Enable write-combining
From: Peter Jones @ 2011-05-26 14:32 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <3647a3cc4157f8c50ab719f1a7500e695cf66a05.1306418703.git.luto@mit.edu>

On 05/26/2011 10:13 AM, Andy Lutomirski wrote:
> 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>

Looks good:

Signed-off-by: Peter Jones <pjones@redhat.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 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",


-- 
        Peter

If you're not part of the solution, then you're part of the precipitate.

01234567890123456789012345678901234567890123456789012345678901234567890123456789

^ permalink raw reply

* [PATCH 4/4] efifb: Disallow manual bind and unbind
From: Andy Lutomirski @ 2011-05-26 14:13 UTC (permalink / raw)
  To: linux-fbdev

Both were buggy: bind would happily scribble over a real graphics
device and unbind wouldn't destroy the framebuffer.  Hotplugging
efifb makes no sense anyway, so just disable it.

As an added benefit, we save some runtime memory.

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

diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c
index 39bbfa9..f67717e 100644
--- a/drivers/video/efifb.c
+++ b/drivers/video/efifb.c
@@ -331,7 +331,7 @@ static int __init efifb_setup(char *options)
 	return 0;
 }
 
-static int __devinit efifb_probe(struct platform_device *dev)
+static int __init efifb_probe(struct platform_device *dev)
 {
 	struct fb_info *info;
 	int err;
@@ -501,7 +501,6 @@ err_release_mem:
 }
 
 static struct platform_driver efifb_driver = {
-	.probe	= efifb_probe,
 	.driver	= {
 		.name	= "efifb",
 	},
@@ -532,13 +531,21 @@ static int __init efifb_init(void)
 	if (!screen_info.lfb_linelength)
 		return -ENODEV;
 
-	ret = platform_driver_register(&efifb_driver);
+	ret = platform_device_register(&efifb_device);
+	if (ret)
+		return ret;
 
-	if (!ret) {
-		ret = platform_device_register(&efifb_device);
-		if (ret)
-			platform_driver_unregister(&efifb_driver);
+	/*
+	 * This is not just an optimization.  We will interfere
+	 * with a real driver if we get reprobed, so don't allow
+	 * it.
+	 */
+	ret = platform_driver_probe(&efifb_driver, efifb_probe);
+	if (ret) {
+		platform_device_unregister(&efifb_driver);
+		return ret;
 	}
+
 	return ret;
 }
 module_init(efifb_init);
-- 
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