mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jingoo Han <jg1.han@samsung.com>
To: "'Mark Brown'" <broonie@opensource.wolfsonmicro.com>,
	"'Florian Tobias Schandinat'" <FlorianSchandinat@gmx.de>
Cc: linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: RE: [PATCH 5/6] video: s3c-fb: Hold runtime PM references when touching registers
Date: Thu, 29 Dec 2011 08:55:00 +0900	[thread overview]
Message-ID: <000a01ccc5bc$1c4d4010$54e7c030$%han@samsung.com> (raw)
In-Reply-To: <1324995372-3410-5-git-send-email-broonie@opensource.wolfsonmicro.com>

> -----Original Message-----
> From: Mark Brown [mailto:broonie@opensource.wolfsonmicro.com]
> Sent: Tuesday, December 27, 2011 11:16 PM
> To: Jingoo Han; Florian Tobias Schandinat
> Cc: linux-fbdev@vger.kernel.org; linux-kernel@vger.kernel.org; Mark Brown
> Subject: [PATCH 5/6] video: s3c-fb: Hold runtime PM references when touching registers
> 
> Take a runtime PM reference whenever updating registers in preparation
> for suspending the device when the framebuffer is blanked.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

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

> ---
>  drivers/video/s3c-fb.c |   22 ++++++++++++++++++++++
>  1 files changed, 22 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
> index 688b9d8..84cf631 100644
> --- a/drivers/video/s3c-fb.c
> +++ b/drivers/video/s3c-fb.c
> @@ -496,6 +496,8 @@ static int s3c_fb_set_par(struct fb_info *info)
> 
>  	dev_dbg(sfb->dev, "setting framebuffer parameters\n");
> 
> +	pm_runtime_get_sync(sfb->dev);
> +
>  	shadow_protect_win(win, 1);
> 
>  	switch (var->bits_per_pixel) {
> @@ -692,6 +694,8 @@ static int s3c_fb_set_par(struct fb_info *info)
> 
>  	shadow_protect_win(win, 0);
> 
> +	pm_runtime_put_sync(sfb->dev);
> +
>  	return 0;
>  }
> 
> @@ -763,6 +767,8 @@ static int s3c_fb_setcolreg(unsigned regno,
>  	dev_dbg(sfb->dev, "%s: win %d: %d => rgb=%d/%d/%d\n",
>  		__func__, win->index, regno, red, green, blue);
> 
> +	pm_runtime_get_sync(sfb->dev);
> +
>  	switch (info->fix.visual) {
>  	case FB_VISUAL_TRUECOLOR:
>  		/* true-colour, use pseudo-palette */
> @@ -790,9 +796,11 @@ static int s3c_fb_setcolreg(unsigned regno,
>  		break;
> 
>  	default:
> +		pm_runtime_put_sync(sfb->dev);
>  		return 1;	/* unknown type */
>  	}
> 
> +	pm_runtime_put_sync(sfb->dev);
>  	return 0;
>  }
> 
> @@ -812,6 +820,8 @@ static int s3c_fb_blank(int blank_mode, struct fb_info *info)
> 
>  	dev_dbg(sfb->dev, "blank mode %d\n", blank_mode);
> 
> +	pm_runtime_get_sync(sfb->dev);
> +
>  	wincon = readl(sfb->regs + sfb->variant.wincon + (index * 4));
> 
>  	switch (blank_mode) {
> @@ -839,6 +849,7 @@ static int s3c_fb_blank(int blank_mode, struct fb_info *info)
>  	case FB_BLANK_VSYNC_SUSPEND:
>  	case FB_BLANK_HSYNC_SUSPEND:
>  	default:
> +		pm_runtime_put_sync(sfb->dev);
>  		return 1;
>  	}
> 
> @@ -869,6 +880,8 @@ static int s3c_fb_blank(int blank_mode, struct fb_info *info)
>  		shadow_protect_win(win, 0);
>  	}
> 
> +	pm_runtime_put_sync(sfb->dev);
> +
>  	return 0;
>  }
> 
> @@ -891,6 +904,8 @@ static int s3c_fb_pan_display(struct fb_var_screeninfo *var,
>  	void __iomem *buf	= sfb->regs + win->index * 8;
>  	unsigned int start_boff, end_boff;
> 
> +	pm_runtime_get_sync(sfb->dev);
> +
>  	/* Offset in bytes to the start of the displayed area */
>  	start_boff = var->yoffset * info->fix.line_length;
>  	/* X offset depends on the current bpp */
> @@ -909,6 +924,7 @@ static int s3c_fb_pan_display(struct fb_var_screeninfo *var,
>  			break;
>  		default:
>  			dev_err(sfb->dev, "invalid bpp\n");
> +			pm_runtime_put_sync(sfb->dev);
>  			return -EINVAL;
>  		}
>  	}
> @@ -924,6 +940,7 @@ static int s3c_fb_pan_display(struct fb_var_screeninfo *var,
> 
>  	shadow_protect_win(win, 0);
> 
> +	pm_runtime_put_sync(sfb->dev);
>  	return 0;
>  }
> 
> @@ -1013,11 +1030,16 @@ static int s3c_fb_wait_for_vsync(struct s3c_fb *sfb, u32 crtc)
>  	if (crtc != 0)
>  		return -ENODEV;
> 
> +	pm_runtime_get_sync(sfb->dev);
> +
>  	count = sfb->vsync_info.count;
>  	s3c_fb_enable_irq(sfb);
>  	ret = wait_event_interruptible_timeout(sfb->vsync_info.wait,
>  				       count != sfb->vsync_info.count,
>  				       msecs_to_jiffies(VSYNC_TIMEOUT_MSEC));
> +
> +	pm_runtime_put_sync(sfb->dev);
> +
>  	if (ret == 0)
>  		return -ETIMEDOUT;
> 
> --
> 1.7.7.3


  reply	other threads:[~2011-12-28 23:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-27 14:15 [PATCH 0/6] video: s3c-fb: Use runtime suspend while blanked Mark Brown
2011-12-27 14:16 ` [PATCH 1/6] video: s3c-fb: Make runtime PM functional again Mark Brown
2011-12-27 14:16   ` [PATCH 2/6] video: s3c-fb: Use s3c_fb_enable() to enable the framebuffer Mark Brown
2011-12-27 14:16   ` [PATCH 3/6] video: s3c-fb: Disable runtime PM in error paths from probe Mark Brown
2011-12-28 23:54     ` Jingoo Han
2011-12-27 14:16   ` [PATCH 4/6] video: s3c-fb: Take a runtime PM reference when unblanked Mark Brown
2011-12-28 23:54     ` Jingoo Han
2011-12-27 14:16   ` [PATCH 5/6] video: s3c-fb: Hold runtime PM references when touching registers Mark Brown
2011-12-28 23:55     ` Jingoo Han [this message]
2011-12-27 14:16   ` [PATCH 6/6] video: s3c-fb: Don't keep device runtime active when open Mark Brown
2011-12-28 23:55     ` Jingoo Han
2011-12-28 23:54   ` [PATCH 1/6] video: s3c-fb: Make runtime PM functional again Jingoo Han
2012-01-09  2:35 ` [PATCH 0/6] video: s3c-fb: Use runtime suspend while blanked Florian Tobias Schandinat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000a01ccc5bc$1c4d4010$54e7c030$%han@samsung.com' \
    --to=jg1.han@samsung.com \
    --cc=FlorianSchandinat@gmx.de \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®