public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915: s/mdelay/msleep/
Date: Mon, 8 Apr 2013 08:30:48 -0700	[thread overview]
Message-ID: <20130408083048.3012d999@jbarnes-desktop> (raw)
In-Reply-To: <1365325983-13033-1-git-send-email-daniel.vetter@ffwll.ch>

On Sun,  7 Apr 2013 11:13:03 +0200
Daniel Vetter <daniel.vetter@ffwll.ch> wrote:

> The first in wait_pipe_off is really just a delay loop to wait for the
> scanline counter to settle (which takes about a frame worth of time).
> So also shrink it a bit.
> 
> The other is in the ilk dprs code. If we need _exactly_ an 1ms wait in
> there, that's already not guaranteed with the current code (since
> especially at start-up we're likely to get scheduled away in between).
> So replace those, too.
> 
> Noticed while trying to understand why we've again broken the panel
> fitter.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/i915/intel_display.c |    2 +-
>  drivers/gpu/drm/i915/intel_pm.c      |    6 +++---
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index b884932..908f697 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -990,7 +990,7 @@ void intel_wait_for_pipe_off(struct drm_device *dev, int pipe)
>  		/* Wait for the display line to settle */
>  		do {
>  			last_line = I915_READ(reg) & line_mask;
> -			mdelay(5);
> +			msleep(1);
>  		} while (((I915_READ(reg) & line_mask) != last_line) &&
>  			 time_after(timeout, jiffies));
>  		if (time_after(jiffies, timeout))
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 17f157a..986770e 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -2380,7 +2380,7 @@ static void ironlake_enable_drps(struct drm_device *dev)
>  
>  	if (wait_for_atomic((I915_READ(MEMSWCTL) & MEMCTL_CMD_STS) == 0, 10))
>  		DRM_ERROR("stuck trying to change perf mode\n");
> -	mdelay(1);
> +	msleep(1);
>  
>  	ironlake_set_drps(dev, fstart);
>  
> @@ -2411,10 +2411,10 @@ static void ironlake_disable_drps(struct drm_device *dev)
>  
>  	/* Go back to the starting frequency */
>  	ironlake_set_drps(dev, dev_priv->ips.fstart);
> -	mdelay(1);
> +	msleep(1);
>  	rgvswctl |= MEMCTL_CMD_STS;
>  	I915_WRITE(MEMSWCTL, rgvswctl);
> -	mdelay(1);
> +	msleep(1);
>  
>  	spin_unlock_irq(&mchdev_lock);
>  }

Fine with me.  Chris is right that I probably added these, back when I
thought a few ms at startup or mode set time wasn't so long.  Now of
course it's an eternity.

-- 
Jesse Barnes, Intel Open Source Technology Center

  parent reply	other threads:[~2013-04-08 15:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-07  9:13 [PATCH] drm/i915: s/mdelay/msleep/ Daniel Vetter
2013-04-08 10:03 ` Chris Wilson
2013-04-08 11:49   ` Paulo Zanoni
2013-04-08 11:56     ` Daniel Vetter
2013-04-08 15:30 ` Jesse Barnes [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-07-07  7:10 Daniel Vetter
2015-07-07  8:03 ` Ville Syrjälä
2015-07-07  9:44   ` Daniel Vetter
2015-07-08  5:54 ` shuang.he

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=20130408083048.3012d999@jbarnes-desktop \
    --to=jbarnes@virtuousgeek.org \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.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