linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [drivers] [fb] S3C-fb: PM fix
@ 2009-05-18  6:05 Marek Szyprowski
  2009-05-28  6:33 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Marek Szyprowski @ 2009-05-18  6:05 UTC (permalink / raw)
  To: linux-arm-kernel@lists.arm.linux.org.uk,
	linux-fbdev-devel@lists.sourceforge.net
  Cc: Antonino A. Daplas, Ben Dooks, Andrew Morton,
	kyungmin.park@samsung.com, Marek Szyprowski

Restore correctly FrameBuffer registers state in resume function.

Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

--- 

diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 5e9c630..d3a568e 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -947,7 +947,8 @@ static int __devexit s3c_fb_remove(struct platform_device *pdev)
 	int win;
 
 	for (win = 0; win <= S3C_FB_MAX_WIN; win++)
-		s3c_fb_release_win(sfb, sfb->windows[win]);
+		if (sfb->windows[win])
+			s3c_fb_release_win(sfb, sfb->windows[win]);
 
 	iounmap(sfb->regs);
 
@@ -985,11 +986,20 @@ static int s3c_fb_suspend(struct platform_device *pdev, pm_message_t state)
 static int s3c_fb_resume(struct platform_device *pdev)
 {
 	struct s3c_fb *sfb = platform_get_drvdata(pdev);
+	struct s3c_fb_platdata *pd = sfb->pdata;
 	struct s3c_fb_win *win;
 	int win_no;
 
 	clk_enable(sfb->bus_clk);
 
+	/* setup registers */
+	writel(pd->vidcon1, sfb->regs + VIDCON1);
+
+	/* zero all windows before we do anything */
+	for (win_no = 0; win_no < S3C_FB_MAX_WIN; win_no++)
+		s3c_fb_clear_win(sfb, win_no);
+
+	/* restore framebuffers */
 	for (win_no = 0; win_no < S3C_FB_MAX_WIN; win_no++) {
 		win = sfb->windows[win_no];
 		if (!win)


-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

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

* Re: [PATCH] [drivers] [fb] S3C-fb: PM fix
  2009-05-18  6:05 [PATCH] [drivers] [fb] S3C-fb: PM fix Marek Szyprowski
@ 2009-05-28  6:33 ` Andrew Morton
  2009-05-29  7:16   ` Marek Szyprowski
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2009-05-28  6:33 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: Ben Dooks, kyungmin.park@samsung.com,
	linux-fbdev-devel@lists.sourceforge.net,
	linux-arm-kernel@lists.arm.linux.org.uk, Antonino A. Daplas

On Mon, 18 May 2009 08:05:46 +0200 Marek Szyprowski <m.szyprowski@samsung.com> wrote:

> Restore correctly FrameBuffer registers state in resume function.
> 
> Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> 
> --- 
> 
> diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
> index 5e9c630..d3a568e 100644
> --- a/drivers/video/s3c-fb.c
> +++ b/drivers/video/s3c-fb.c
> @@ -947,7 +947,8 @@ static int __devexit s3c_fb_remove(struct platform_device *pdev)
>  	int win;
>  
>  	for (win = 0; win <= S3C_FB_MAX_WIN; win++)
> -		s3c_fb_release_win(sfb, sfb->windows[win]);
> +		if (sfb->windows[win])
> +			s3c_fb_release_win(sfb, sfb->windows[win]);
>  
>  	iounmap(sfb->regs);
>  
> @@ -985,11 +986,20 @@ static int s3c_fb_suspend(struct platform_device *pdev, pm_message_t state)
>  static int s3c_fb_resume(struct platform_device *pdev)
>  {
>  	struct s3c_fb *sfb = platform_get_drvdata(pdev);
> +	struct s3c_fb_platdata *pd = sfb->pdata;
>  	struct s3c_fb_win *win;
>  	int win_no;
>  
>  	clk_enable(sfb->bus_clk);
>  
> +	/* setup registers */
> +	writel(pd->vidcon1, sfb->regs + VIDCON1);
> +
> +	/* zero all windows before we do anything */
> +	for (win_no = 0; win_no < S3C_FB_MAX_WIN; win_no++)
> +		s3c_fb_clear_win(sfb, win_no);
> +
> +	/* restore framebuffers */
>  	for (win_no = 0; win_no < S3C_FB_MAX_WIN; win_no++) {
>  		win = sfb->windows[win_no];
>  		if (!win)

What are the consequences of the bug whcih you fixed?  Device
inoperative after resume, I assume?  Does it affect all supported
hardware, or just some particualr device(s)?

See, this is the sort of information whcih shuld be in the changelog,
please, so I (and others) can make decisions about which kernel
version(s) the patch should be merged into.

I assume we want it in 2.6.30.

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 

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

* Re: [PATCH] [drivers] [fb] S3C-fb: PM fix
  2009-05-28  6:33 ` Andrew Morton
@ 2009-05-29  7:16   ` Marek Szyprowski
  0 siblings, 0 replies; 3+ messages in thread
From: Marek Szyprowski @ 2009-05-29  7:16 UTC (permalink / raw)
  To: 'Andrew Morton'
  Cc: linux-fbdev-devel, 'Antonino A. Daplas', kyungmin.park,
	'Ben Dooks', linux-arm-kernel, Marek Szyprowski

Hello,

On Thursday, May 28, 2009 8:33 AM Andrew Morton wrote:

> On Mon, 18 May 2009 08:05:46 +0200 Marek Szyprowski
> <m.szyprowski@samsung.com> wrote:
> 
> > Restore correctly FrameBuffer registers state in resume function.
> >
> > Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com>
> > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> > [...]

> What are the consequences of the bug whcih you fixed?  Device
> inoperative after resume, I assume?  Does it affect all supported
> hardware, or just some particualr device(s)?

Yes, the framebuffer was inoperative after resume. This bug was triggered on
a system that has a power management circuit which disabled power in most
S3C SOC power domains in suspend mode. In such case drivers need to restore
all its registers state after resume.

> See, this is the sort of information whcih shuld be in the changelog,
> please, so I (and others) can make decisions about which kernel
> version(s) the patch should be merged into.

Ok. I will describe my patches more in detail in the future. Thanks for your
comments.

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center



------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 

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

end of thread, other threads:[~2009-05-29  7:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-18  6:05 [PATCH] [drivers] [fb] S3C-fb: PM fix Marek Szyprowski
2009-05-28  6:33 ` Andrew Morton
2009-05-29  7:16   ` Marek Szyprowski

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).