lkml.org 
[lkml]   [2017]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 3/3] drm: Add CRTC_GET_SEQUENCE and CRTC_QUEUE_SEQUENCE ioctls
On Thu, Jul 6, 2017 at 12:16 PM, Ville Syrjälä
<ville.syrjala@linux.intel.com> wrote:
>> > + if (!dev->irq_enabled)
>> > + return -EINVAL;
>> > +
>> > + crtc = drm_crtc_find(dev, get_seq->crtc_id);
>> > + if (!crtc)
>> > + return -ENOENT;
>> > +
>> > + pipe = drm_crtc_index(crtc);
>> > +
>> > + get_seq->sequence = drm_vblank_count_and_time(dev, pipe, &now);
>>
>> This can give you and old vblank if the vblank is off (i.e. sw state
>> hasn't be regularly updated). I think we want a new
>> drm_crtc_accurate_vblank_count_and_time variant.
>
> Or better yet just do what Chris did for the old ioctl in commit
> b33b02707ba3 ("drm: Peek at the current counter/timestamp for vblank queries")

Yeah the READ_ONCE(vblank->enabled) is a nice fastpath. But we still
need the accurate one as slowpath in case the vblank irq is off.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

\
 
 \ /
  Last update: 2017-07-06 13:04    [W:0.084 / U:2.744 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site