linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH] omapfb: Reorder Register_framebuffer call
@ 2009-08-20 20:12 Aguirre Rodriguez, Sergio Alberto
  2009-09-04  6:44 ` Gadiyar, Anand
  0 siblings, 1 reply; 5+ messages in thread
From: Aguirre Rodriguez, Sergio Alberto @ 2009-08-20 20:12 UTC (permalink / raw)
  To: linux-fbdev-devel@lists.sourceforge.net
  Cc: Imre Deak, linux-omap@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 1570 bytes --]

From: Sergio Aguirre <saaguirre@ti.com>

This fixes the issue in which mm_lock mutex was attempted to be
used without initializing previously.

Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
 drivers/video/omap/omapfb_main.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c
index 125e605..60f9482 100644
--- a/drivers/video/omap/omapfb_main.c
+++ b/drivers/video/omap/omapfb_main.c
@@ -1503,12 +1503,21 @@ static int fbinfo_init(struct omapfb_device *fbdev, struct fb_info *info)
 	var->rotate	  = def_rotate;
 	var->bits_per_pixel = fbdev->panel->bpp;
 
+	r = register_framebuffer(info);
+	if (r != 0) {
+		dev_err(fbdev->dev,
+			"registering framebuffer failed\n");
+		return r;
+	}
+
 	set_fb_var(info, var);
 	set_fb_fix(info);
 
 	r = fb_alloc_cmap(&info->cmap, 16, 0);
-	if (r != 0)
+	if (r != 0) {
 		dev_err(fbdev->dev, "unable to allocate color map memory\n");
+		unregister_framebuffer(info);
+	}
 
 	return r;
 }
@@ -1773,15 +1782,8 @@ static int omapfb_do_probe(struct platform_device *pdev,
 	init_state++;
 
 	vram = 0;
-	for (i = 0; i < fbdev->mem_desc.region_cnt; i++) {
-		r = register_framebuffer(fbdev->fb_info[i]);
-		if (r != 0) {
-			dev_err(fbdev->dev,
-				"registering framebuffer %d failed\n", i);
-			goto cleanup;
-		}
+	for (i = 0; i < fbdev->mem_desc.region_cnt; i++)
 		vram += fbdev->mem_desc.region[i].size;
-	}
 
 	fbdev->state = OMAPFB_ACTIVE;
 
-- 
1.6.3.2


[-- Attachment #2: 0001-omapfb-Reorder-Register_framebuffer-call.patch --]
[-- Type: application/octet-stream, Size: 1681 bytes --]

From bf68134c0d13c9df618d9ef4d3e9d065585f3d15 Mon Sep 17 00:00:00 2001
From: Sergio Aguirre <saaguirre@ti.com>
Date: Thu, 20 Aug 2009 14:58:22 -0500
Subject: [PATCH] omapfb: Reorder Register_framebuffer call

This fixes the issue in which mm_lock mutex was attempted to be
used without initializing previously.

Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
 drivers/video/omap/omapfb_main.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c
index 125e605..60f9482 100644
--- a/drivers/video/omap/omapfb_main.c
+++ b/drivers/video/omap/omapfb_main.c
@@ -1503,12 +1503,21 @@ static int fbinfo_init(struct omapfb_device *fbdev, struct fb_info *info)
 	var->rotate	  = def_rotate;
 	var->bits_per_pixel = fbdev->panel->bpp;
 
+	r = register_framebuffer(info);
+	if (r != 0) {
+		dev_err(fbdev->dev,
+			"registering framebuffer failed\n");
+		return r;
+	}
+
 	set_fb_var(info, var);
 	set_fb_fix(info);
 
 	r = fb_alloc_cmap(&info->cmap, 16, 0);
-	if (r != 0)
+	if (r != 0) {
 		dev_err(fbdev->dev, "unable to allocate color map memory\n");
+		unregister_framebuffer(info);
+	}
 
 	return r;
 }
@@ -1773,15 +1782,8 @@ static int omapfb_do_probe(struct platform_device *pdev,
 	init_state++;
 
 	vram = 0;
-	for (i = 0; i < fbdev->mem_desc.region_cnt; i++) {
-		r = register_framebuffer(fbdev->fb_info[i]);
-		if (r != 0) {
-			dev_err(fbdev->dev,
-				"registering framebuffer %d failed\n", i);
-			goto cleanup;
-		}
+	for (i = 0; i < fbdev->mem_desc.region_cnt; i++)
 		vram += fbdev->mem_desc.region[i].size;
-	}
 
 	fbdev->state = OMAPFB_ACTIVE;
 
-- 
1.6.3.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [RFC][PATCH] omapfb: Reorder Register_framebuffer call
  2009-08-20 20:12 [RFC][PATCH] omapfb: Reorder Register_framebuffer call Aguirre Rodriguez, Sergio Alberto
@ 2009-09-04  6:44 ` Gadiyar, Anand
  2009-09-04  8:33   ` Hiremath, Vaibhav
  2009-09-04 13:34   ` Peter Barada
  0 siblings, 2 replies; 5+ messages in thread
From: Gadiyar, Anand @ 2009-09-04  6:44 UTC (permalink / raw)
  To: Aguirre Rodriguez, Sergio Alberto,
	linux-fbdev-devel@lists.sourceforge.net
  Cc: Imre Deak, linux-omap@vger.kernel.org

> From: Sergio Aguirre <saaguirre@ti.com>
> 
> This fixes the issue in which mm_lock mutex was attempted to be
> used without initializing previously.
> 
> Signed-off-by: Sergio Aguirre <saaguirre@ti.com>

Tested-by: Anand Gadiyar <gadiyar@ti.com>

This patch on top of current linux-omap kernel allows me to
boot with the default SDP defconfig on a 3430 SDP.

- Anand


> ---
>  drivers/video/omap/omapfb_main.c |   20 +++++++++++---------
>  1 files changed, 11 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c
> index 125e605..60f9482 100644
> --- a/drivers/video/omap/omapfb_main.c
> +++ b/drivers/video/omap/omapfb_main.c
> @@ -1503,12 +1503,21 @@ static int fbinfo_init(struct omapfb_device *fbdev, struct fb_info *info)
>  	var->rotate	  = def_rotate;
>  	var->bits_per_pixel = fbdev->panel->bpp;
>  
> +	r = register_framebuffer(info);
> +	if (r != 0) {
> +		dev_err(fbdev->dev,
> +			"registering framebuffer failed\n");
> +		return r;
> +	}
> +
>  	set_fb_var(info, var);
>  	set_fb_fix(info);
>  
>  	r = fb_alloc_cmap(&info->cmap, 16, 0);
> -	if (r != 0)
> +	if (r != 0) {
>  		dev_err(fbdev->dev, "unable to allocate color map memory\n");
> +		unregister_framebuffer(info);
> +	}
>  
>  	return r;
>  }
> @@ -1773,15 +1782,8 @@ static int omapfb_do_probe(struct platform_device *pdev,
>  	init_state++;
>  
>  	vram = 0;
> -	for (i = 0; i < fbdev->mem_desc.region_cnt; i++) {
> -		r = register_framebuffer(fbdev->fb_info[i]);
> -		if (r != 0) {
> -			dev_err(fbdev->dev,
> -				"registering framebuffer %d failed\n", i);
> -			goto cleanup;
> -		}
> +	for (i = 0; i < fbdev->mem_desc.region_cnt; i++)
>  		vram += fbdev->mem_desc.region[i].size;
> -	}
>  
>  	fbdev->state = OMAPFB_ACTIVE;
>  
> -- 
> 1.6.3.2
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [RFC][PATCH] omapfb: Reorder Register_framebuffer call
  2009-09-04  6:44 ` Gadiyar, Anand
@ 2009-09-04  8:33   ` Hiremath, Vaibhav
  2009-09-04 13:34   ` Peter Barada
  1 sibling, 0 replies; 5+ messages in thread
From: Hiremath, Vaibhav @ 2009-09-04  8:33 UTC (permalink / raw)
  To: Gadiyar, Anand, Aguirre Rodriguez, Sergio Alberto,
	linux-fbdev-devel@lists.sourceforge.net
  Cc: Imre Deak, linux-omap@vger.kernel.org

> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> owner@vger.kernel.org] On Behalf Of Gadiyar, Anand
> Sent: Friday, September 04, 2009 12:15 PM
> To: Aguirre Rodriguez, Sergio Alberto; linux-fbdev-
> devel@lists.sourceforge.net
> Cc: Imre Deak; linux-omap@vger.kernel.org
> Subject: RE: [RFC][PATCH] omapfb: Reorder Register_framebuffer call
> 
> > From: Sergio Aguirre <saaguirre@ti.com>
> >
> > This fixes the issue in which mm_lock mutex was attempted to be
> > used without initializing previously.
> >
> > Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
> 
> Tested-by: Anand Gadiyar <gadiyar@ti.com>
> 
> This patch on top of current linux-omap kernel allows me to
> boot with the default SDP defconfig on a 3430 SDP.
> 
[Hiremath, Vaibhav] I have tried it on OMAP3EVM and it allowed me to boot, which was crashing before.

Thanks,
Vaibhav

> - Anand
> 
> 
> > ---
> >  drivers/video/omap/omapfb_main.c |   20 +++++++++++---------
> >  1 files changed, 11 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/video/omap/omapfb_main.c
> b/drivers/video/omap/omapfb_main.c
> > index 125e605..60f9482 100644
> > --- a/drivers/video/omap/omapfb_main.c
> > +++ b/drivers/video/omap/omapfb_main.c
> > @@ -1503,12 +1503,21 @@ static int fbinfo_init(struct
> omapfb_device *fbdev, struct fb_info *info)
> >  	var->rotate	  = def_rotate;
> >  	var->bits_per_pixel = fbdev->panel->bpp;
> >
> > +	r = register_framebuffer(info);
> > +	if (r != 0) {
> > +		dev_err(fbdev->dev,
> > +			"registering framebuffer failed\n");
> > +		return r;
> > +	}
> > +
> >  	set_fb_var(info, var);
> >  	set_fb_fix(info);
> >
> >  	r = fb_alloc_cmap(&info->cmap, 16, 0);
> > -	if (r != 0)
> > +	if (r != 0) {
> >  		dev_err(fbdev->dev, "unable to allocate color map
> memory\n");
> > +		unregister_framebuffer(info);
> > +	}
> >
> >  	return r;
> >  }
> > @@ -1773,15 +1782,8 @@ static int omapfb_do_probe(struct
> platform_device *pdev,
> >  	init_state++;
> >
> >  	vram = 0;
> > -	for (i = 0; i < fbdev->mem_desc.region_cnt; i++) {
> > -		r = register_framebuffer(fbdev->fb_info[i]);
> > -		if (r != 0) {
> > -			dev_err(fbdev->dev,
> > -				"registering framebuffer %d failed\n", i);
> > -			goto cleanup;
> > -		}
> > +	for (i = 0; i < fbdev->mem_desc.region_cnt; i++)
> >  		vram += fbdev->mem_desc.region[i].size;
> > -	}
> >
> >  	fbdev->state = OMAPFB_ACTIVE;
> >
> > --
> > 1.6.3.2
> >
> > --
> To unsubscribe from this list: send the line "unsubscribe linux-
> omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [RFC][PATCH] omapfb: Reorder Register_framebuffer call
  2009-09-04  6:44 ` Gadiyar, Anand
  2009-09-04  8:33   ` Hiremath, Vaibhav
@ 2009-09-04 13:34   ` Peter Barada
  2009-09-05  1:41     ` Eric Witcher
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Barada @ 2009-09-04 13:34 UTC (permalink / raw)
  To: Gadiyar, Anand
  Cc: Aguirre Rodriguez, Sergio Alberto,
	linux-fbdev-devel@lists.sourceforge.net, Imre Deak,
	linux-omap@vger.kernel.org

On Fri, 2009-09-04 at 12:14 +0530, Gadiyar, Anand wrote:
> > From: Sergio Aguirre <saaguirre@ti.com>
> > 
> > This fixes the issue in which mm_lock mutex was attempted to be
> > used without initializing previously.
> > 
> > Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
> 
> Tested-by: Anand Gadiyar <gadiyar@ti.com>
> 
> This patch on top of current linux-omap kernel allows me to
> boot with the default SDP defconfig on a 3430 SDP.

Tested-by: Peter Barada <peterb@logicpd.com>

This patch on top of current linux-omap kernel allows me to boot with
the LCD enabled on LogicPD's OMAP boards.

> > ---
> >  drivers/video/omap/omapfb_main.c |   20 +++++++++++---------
> >  1 files changed, 11 insertions(+), 9 deletions(-)
> > 
> > diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c
> > index 125e605..60f9482 100644
> > --- a/drivers/video/omap/omapfb_main.c
> > +++ b/drivers/video/omap/omapfb_main.c
> > @@ -1503,12 +1503,21 @@ static int fbinfo_init(struct omapfb_device *fbdev, struct fb_info *info)
> >  	var->rotate	  = def_rotate;
> >  	var->bits_per_pixel = fbdev->panel->bpp;
> >  
> > +	r = register_framebuffer(info);
> > +	if (r != 0) {
> > +		dev_err(fbdev->dev,
> > +			"registering framebuffer failed\n");
> > +		return r;
> > +	}
> > +
> >  	set_fb_var(info, var);
> >  	set_fb_fix(info);
> >  
> >  	r = fb_alloc_cmap(&info->cmap, 16, 0);
> > -	if (r != 0)
> > +	if (r != 0) {
> >  		dev_err(fbdev->dev, "unable to allocate color map memory\n");
> > +		unregister_framebuffer(info);
> > +	}
> >  
> >  	return r;
> >  }
> > @@ -1773,15 +1782,8 @@ static int omapfb_do_probe(struct platform_device *pdev,
> >  	init_state++;
> >  
> >  	vram = 0;
> > -	for (i = 0; i < fbdev->mem_desc.region_cnt; i++) {
> > -		r = register_framebuffer(fbdev->fb_info[i]);
> > -		if (r != 0) {
> > -			dev_err(fbdev->dev,
> > -				"registering framebuffer %d failed\n", i);
> > -			goto cleanup;
> > -		}
> > +	for (i = 0; i < fbdev->mem_desc.region_cnt; i++)
> >  		vram += fbdev->mem_desc.region[i].size;
> > -	}
> >  
> >  	fbdev->state = OMAPFB_ACTIVE;
> >  
> > -- 
> > 1.6.3.2
> > 
> > --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-- 
Peter Barada <peterb@logicpd.com>
Logic Product Development, Inc.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RFC][PATCH] omapfb: Reorder Register_framebuffer call
  2009-09-04 13:34   ` Peter Barada
@ 2009-09-05  1:41     ` Eric Witcher
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Witcher @ 2009-09-05  1:41 UTC (permalink / raw)
  To: Peter Barada
  Cc: Gadiyar, Anand, Aguirre Rodriguez, Sergio Alberto,
	linux-fbdev-devel@lists.sourceforge.net, Imre Deak,
	linux-omap@vger.kernel.org


On Sep 4, 2009, at 9:34 AM, Peter Barada wrote:

> On Fri, 2009-09-04 at 12:14 +0530, Gadiyar, Anand wrote:
>>> From: Sergio Aguirre <saaguirre@ti.com>
>>>
>>> This fixes the issue in which mm_lock mutex was attempted to be
>>> used without initializing previously.
>>>
>>> Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
>>
>> Tested-by: Anand Gadiyar <gadiyar@ti.com>
>>
>> This patch on top of current linux-omap kernel allows me to
>> boot with the default SDP defconfig on a 3430 SDP.
>
> Tested-by: Peter Barada <peterb@logicpd.com>
>
> This patch on top of current linux-omap kernel allows me to boot with
> the LCD enabled on LogicPD's OMAP boards.
>
Tested-by: Eric Witcher <ewitcher@mindspring.com>
Ditto for omap3_beagle_defconfig on Beagle Rev. C2

>>> ---
>>> drivers/video/omap/omapfb_main.c |   20 +++++++++++---------
>>> 1 files changed, 11 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/ 
>>> omapfb_main.c
>>> index 125e605..60f9482 100644
>>> --- a/drivers/video/omap/omapfb_main.c
>>> +++ b/drivers/video/omap/omapfb_main.c
>>> @@ -1503,12 +1503,21 @@ static int fbinfo_init(struct  
>>> omapfb_device *fbdev, struct fb_info *info)
>>> 	var->rotate	  = def_rotate;
>>> 	var->bits_per_pixel = fbdev->panel->bpp;
>>>
>>> +	r = register_framebuffer(info);
>>> +	if (r != 0) {
>>> +		dev_err(fbdev->dev,
>>> +			"registering framebuffer failed\n");
>>> +		return r;
>>> +	}
>>> +
>>> 	set_fb_var(info, var);
>>> 	set_fb_fix(info);
>>>
>>> 	r = fb_alloc_cmap(&info->cmap, 16, 0);
>>> -	if (r != 0)
>>> +	if (r != 0) {
>>> 		dev_err(fbdev->dev, "unable to allocate color map memory\n");
>>> +		unregister_framebuffer(info);
>>> +	}
>>>
>>> 	return r;
>>> }
>>> @@ -1773,15 +1782,8 @@ static int omapfb_do_probe(struct  
>>> platform_device *pdev,
>>> 	init_state++;
>>>
>>> 	vram = 0;
>>> -	for (i = 0; i < fbdev->mem_desc.region_cnt; i++) {
>>> -		r = register_framebuffer(fbdev->fb_info[i]);
>>> -		if (r != 0) {
>>> -			dev_err(fbdev->dev,
>>> -				"registering framebuffer %d failed\n", i);
>>> -			goto cleanup;
>>> -		}
>>> +	for (i = 0; i < fbdev->mem_desc.region_cnt; i++)
>>> 		vram += fbdev->mem_desc.region[i].size;
>>> -	}
>>>
>>> 	fbdev->state = OMAPFB_ACTIVE;
>>>
>>> -- 
>>> 1.6.3.2
>>>
>>> --
>> To unsubscribe from this list: send the line "unsubscribe linux- 
>> omap" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> -- 
> Peter Barada <peterb@logicpd.com>
> Logic Product Development, Inc.
> --
> To unsubscribe from this list: send the line "unsubscribe linux- 
> omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-09-05  1:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-20 20:12 [RFC][PATCH] omapfb: Reorder Register_framebuffer call Aguirre Rodriguez, Sergio Alberto
2009-09-04  6:44 ` Gadiyar, Anand
2009-09-04  8:33   ` Hiremath, Vaibhav
2009-09-04 13:34   ` Peter Barada
2009-09-05  1:41     ` Eric Witcher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).