diff options
author | Rob Clark <rob@ti.com> | 2012-10-16 18:48:40 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-11-20 00:47:21 -0500 |
commit | c6eefa1750ec0308956895027c3a79eee2ef9726 (patch) | |
tree | 9bff1495c1be215c41d956578262575723c19895 /Documentation | |
parent | edec4af4c3d6d225578290a9acc38c78147df55b (diff) |
drm: add drm_send_vblank_event() helper (v5)
A helper that drivers can use to send vblank event after a pageflip.
If the driver doesn't support proper vblank irq based time/seqn then
just pass -1 for the pipe # to get do_gettimestamp() behavior (since
there are a lot of drivers that don't use drm_vblank_count_and_time())
Also an internal send_vblank_event() helper for the various other code
paths within drm_irq that also need to send vblank events.
v1: original
v2: add back 'vblwait->reply.sequence = seq' which should not have
been deleted
v3: add WARN_ON() in case lock is not held and comments
v4: use WARN_ON_SMP() instead to fix issue with !SMP && !DEBUG_SPINLOCK
as pointed out by Marcin Slusarz
v5: update docbook
Signed-off-by: Rob Clark <rob@ti.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/DocBook/drm.tmpl | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl index b0300529ab13..c9cbb3fe0e6a 100644 --- a/Documentation/DocBook/drm.tmpl +++ b/Documentation/DocBook/drm.tmpl | |||
@@ -1141,23 +1141,13 @@ int max_width, max_height;</synopsis> | |||
1141 | the <methodname>page_flip</methodname> operation will be called with a | 1141 | the <methodname>page_flip</methodname> operation will be called with a |
1142 | non-NULL <parameter>event</parameter> argument pointing to a | 1142 | non-NULL <parameter>event</parameter> argument pointing to a |
1143 | <structname>drm_pending_vblank_event</structname> instance. Upon page | 1143 | <structname>drm_pending_vblank_event</structname> instance. Upon page |
1144 | flip completion the driver must fill the | 1144 | flip completion the driver must call <methodname>drm_send_vblank_event</methodname> |
1145 | <parameter>event</parameter>::<structfield>event</structfield> | 1145 | to fill in the event and send to wake up any waiting processes. |
1146 | <structfield>sequence</structfield>, <structfield>tv_sec</structfield> | 1146 | This can be performed with |
1147 | and <structfield>tv_usec</structfield> fields with the associated | ||
1148 | vertical blanking count and timestamp, add the event to the | ||
1149 | <parameter>drm_file</parameter> list of events to be signaled, and wake | ||
1150 | up any waiting process. This can be performed with | ||
1151 | <programlisting><![CDATA[ | 1147 | <programlisting><![CDATA[ |
1152 | struct timeval now; | ||
1153 | |||
1154 | event->event.sequence = drm_vblank_count_and_time(..., &now); | ||
1155 | event->event.tv_sec = now.tv_sec; | ||
1156 | event->event.tv_usec = now.tv_usec; | ||
1157 | |||
1158 | spin_lock_irqsave(&dev->event_lock, flags); | 1148 | spin_lock_irqsave(&dev->event_lock, flags); |
1159 | list_add_tail(&event->base.link, &event->base.file_priv->event_list); | 1149 | ... |
1160 | wake_up_interruptible(&event->base.file_priv->event_wait); | 1150 | drm_send_vblank_event(dev, pipe, event); |
1161 | spin_unlock_irqrestore(&dev->event_lock, flags); | 1151 | spin_unlock_irqrestore(&dev->event_lock, flags); |
1162 | ]]></programlisting> | 1152 | ]]></programlisting> |
1163 | </para> | 1153 | </para> |