public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Murthy, Arun R" <arun.r.murthy@gmail.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: airlied@linux.ie, daniel.vetter@ffwll.ch,
	intel-gfx@lists.freedesktop.org,
	Arun R Murthy <arun.r.murthy@intel.com>
Subject: Re: [PATCH v4] drm/i915: use hrtimer in wait for vblank
Date: Tue, 25 Mar 2014 15:16:28 +0530	[thread overview]
Message-ID: <53315074.6050502@gmail.com> (raw)
In-Reply-To: <87eh1qvd20.fsf@intel.com>

On Tuesday 25 March 2014 03:02 PM, Jani Nikula wrote:
> On Tue, 25 Mar 2014, Chris Wilson <chris@chris-wilson.co.uk> wrote:
>> On Tue, Mar 25, 2014 at 02:28:22PM +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.
>>>
>>> As per kernel document "Documentation/timers/timers-howto.txt" sleeping
>>> for 10us to 20ms its recomended to use usleep_range.
>>>
>>> Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com>
>> Lgtm, I still feel that our use of W=1 is fairly arbitrary and worth
>> tweaking in future.
> With the current code, this is essentially the same as the original
> patch. We never have W > 20, and thus we always take the usleep_range()
> path. So W is definitely worth tweaking if we go with this now.
>
> Nitpick, the macro params should be parenthesized. This will now break
> for _wait_for(cond, 10, 2 + 1) and such.

wait_for(COND, TIMEOUT, ATOMIC, MS)
and remove all wait_for_X

function will look like
_wait_for(COND< TIMEOUT, ATOMIC, MS)
{
     /* loop */
         /* check condition */
         if (atomic)
             cpu_relax()
         else
             if (ms > 20)
                 msleep
             else
                 usleep_range
}

caller for wait_for will be setting all the parameters and hence no tweaks.

Thanks and Regards,
Arun R Murthy
-------------------

  reply	other threads:[~2014-03-25  9:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-25  8:58 [PATCH v4] drm/i915: use hrtimer in wait for vblank Arun R Murthy
2014-03-25  9:07 ` Chris Wilson
2014-03-25  9:32   ` Jani Nikula
2014-03-25  9:46     ` Murthy, Arun R [this message]
2014-03-27  4:48       ` Murthy, Arun R
2014-04-01  4:44         ` Murthy, Arun R
2014-04-01  7:29           ` Daniel Vetter
2014-03-25 10:00     ` Daniel Vetter

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=53315074.6050502@gmail.com \
    --to=arun.r.murthy@gmail.com \
    --cc=airlied@linux.ie \
    --cc=arun.r.murthy@intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    /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