Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	Arun R Murthy <arun.r.murthy@intel.com>
Cc: airlied@linux.ie, daniel.vetter@ffwll.ch,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: use hrtimer in wait for vblank
Date: Mon, 24 Mar 2014 11:23:58 +0200	[thread overview]
Message-ID: <8761n4vtjl.fsf@intel.com> (raw)
In-Reply-To: <20140324085134.GJ4366@nuc-i3427.alporthouse.com>

On Mon, 24 Mar 2014, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Mon, Mar 24, 2014 at 01:43:38PM +0530, Arun R Murthy wrote:
>> In wait for vblank use usleep_range, which will use hrtimers instead of
>> msleep. Using msleep(1~20) there are more chances of sleeping for 20ms.
>> Using usleep_range uses hrtimers and hence are precise, worst case will
>> trigger an interrupt at the higher/max timeout.
>> 
>> Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com>
>> ---
>>  drivers/gpu/drm/i915/intel_drv.h |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
>> index 44067bc..079280a 100644
>> --- a/drivers/gpu/drm/i915/intel_drv.h
>> +++ b/drivers/gpu/drm/i915/intel_drv.h
>> @@ -52,7 +52,7 @@
>>  			break;						\
>>  		}							\
>>  		if (W && drm_can_sleep())  {				\
>> -			msleep(W);					\
>> +			usleep_range(W * 1000, W * 2 * 1000);		\
>>  		} else {						\
>>  			cpu_relax();					\
>>  		}							\
>
> Ok. But W is still just a random value we picked for being the mininum
> legal value for msleep(). So just usleep_range(500, 2000) or somesuch
> will be fine. We can rename W to CAN_SLEEP it that helps.

We do use _wait_for directly from intel_dp.c with W == 10 to not retry
so many times on what's expected to be a long wait.

BR,
Jani.


> -Chris
>
> -- 
> Chris Wilson, Intel Open Source Technology Centre

-- 
Jani Nikula, Intel Open Source Technology Center

  parent reply	other threads:[~2014-03-24  9:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-24  8:13 [PATCH] drm/i915: use hrtimer in wait for vblank Arun R Murthy
2014-03-24  8:51 ` Chris Wilson
2014-03-24  9:22   ` Murthy, Arun R
2014-03-24  9:23   ` Jani Nikula [this message]
2014-03-24  9:34     ` Murthy, Arun R
2014-03-24  9:48       ` Chris Wilson
2014-03-24  9:55         ` Daniel Vetter
2014-03-24  9:59           ` Murthy, Arun R
2014-03-24 10:00       ` Daniel Vetter
2014-03-24 10:14         ` Murthy, Arun R

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=8761n4vtjl.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=airlied@linux.ie \
    --cc=arun.r.murthy@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --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