Lines Matching full:vblank
2 * drm_irq.c IRQ and vblank support
43 * DOC: vblank handling
54 * scanlines is referred to as the vertical blanking region, or vblank for
98 * this programming has to both start and end in the same vblank. To help
101 * The interrupt is in this context named the vblank interrupt.
103 * The vblank interrupt may be fired at different points depending on the
122 * drm_crtc_handle_vblank() in its vblank interrupt handler for working vblank
129 * call drm_crtc_vblank_get() and release the vblank reference again with
130 * drm_crtc_vblank_put(). In between these two calls vblank interrupts are
133 * On many hardware disabling the vblank interrupt cannot be done in a race-free
135 * &drm_driver.max_vblank_count. In that case the vblank core only disables the
141 * automatically generate fake vblank events as part of the display update.
152 * vblank irq in drm_handle_vblank(). 1 msec should be ok.
166 MODULE_PARM_DESC(vblankoffdelay, "Delay until vblank irq auto-disable [msecs] (0: never disable, <0…
173 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in store_vblank() local
177 vblank->last = last; in store_vblank()
179 write_seqlock(&vblank->seqlock); in store_vblank()
180 vblank->time = t_vblank; in store_vblank()
181 atomic64_add(vblank_count_inc, &vblank->count); in store_vblank()
182 write_sequnlock(&vblank->seqlock); in store_vblank()
187 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_max_vblank_count() local
189 return vblank->max_vblank_count ?: dev->max_vblank_count; in drm_max_vblank_count()
220 * Reset the stored timestamp for the current vblank count to correspond
221 * to the last vblank occurred.
226 * device vblank fields.
247 * Only reinitialize corresponding vblank timestamp if high-precision query in drm_reset_vblank_timestamp()
248 * available and didn't fail. Otherwise reinitialize delayed at next vblank in drm_reset_vblank_timestamp()
256 * vblank counter value before and after a modeset in drm_reset_vblank_timestamp()
264 * Call back into the driver to update the appropriate vblank counter
273 * device vblank fields.
278 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_update_vblank_count() local
283 int framedur_ns = vblank->framedur_ns; in drm_update_vblank_count()
290 * here if the register is small or we had vblank interrupts off for in drm_update_vblank_count()
293 * We repeat the hardware vblank counter & timestamp query until in drm_update_vblank_count()
296 * corresponding vblank timestamp. in drm_update_vblank_count()
305 diff = (cur_vblank - vblank->last) & max_vblank_count; in drm_update_vblank_count()
307 u64 diff_ns = ktime_to_ns(ktime_sub(t_vblank, vblank->time)); in drm_update_vblank_count()
331 * interval? If so then vblank irqs keep running and it will likely in drm_update_vblank_count()
332 * happen that the hardware vblank counter is not trustworthy as it in drm_update_vblank_count()
333 * might reset at some point in that interval and vblank timestamps in drm_update_vblank_count()
336 * random large forward jumps of the software vblank counter. in drm_update_vblank_count()
338 if (diff > 1 && (vblank->inmodeset & 0x2)) { in drm_update_vblank_count()
340 "clamping vblank bump to 1 on crtc %u: diffr=%u" in drm_update_vblank_count()
345 drm_dbg_vbl(dev, "updating vblank count on crtc %u:" in drm_update_vblank_count()
347 pipe, (unsigned long long)atomic64_read(&vblank->count), in drm_update_vblank_count()
348 diff, cur_vblank, vblank->last); in drm_update_vblank_count()
351 drm_WARN_ON_ONCE(dev, cur_vblank != vblank->last); in drm_update_vblank_count()
356 * Only reinitialize corresponding vblank timestamp if high-precision query in drm_update_vblank_count()
357 * available and didn't fail, or we were called from the vblank interrupt. in drm_update_vblank_count()
358 * Otherwise reinitialize delayed at next vblank interrupt and assign 0 in drm_update_vblank_count()
369 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_vblank_count() local
375 count = atomic64_read(&vblank->count); in drm_vblank_count()
390 * drm_crtc_accurate_vblank_count - retrieve the master vblank counter
394 * interpolates to handle a race with vblank interrupts using the high precision
404 u64 vblank; in drm_crtc_accurate_vblank_count() local
409 "This function requires support for accurate vblank timestamps."); in drm_crtc_accurate_vblank_count()
414 vblank = drm_vblank_count(dev, pipe); in drm_crtc_accurate_vblank_count()
418 return vblank; in drm_crtc_accurate_vblank_count()
438 * Disable vblank irq's on crtc, make sure that last vblank count
439 * of hardware and corresponding consistent software vblank counter
440 * are preserved, even if there are any spurious vblank irq's after
445 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_vblank_disable_and_save() local
450 /* Prevent vblank irq processing while disabling vblank irqs, in drm_vblank_disable_and_save()
457 * Update vblank count and disable vblank interrupts only if the in drm_vblank_disable_and_save()
462 if (!vblank->enabled) in drm_vblank_disable_and_save()
473 vblank->enabled = false; in drm_vblank_disable_and_save()
481 struct drm_vblank_crtc *vblank = from_timer(vblank, t, disable_timer); in vblank_disable_fn() local
482 struct drm_device *dev = vblank->dev; in vblank_disable_fn()
483 unsigned int pipe = vblank->pipe; in vblank_disable_fn()
487 if (atomic_read(&vblank->refcount) == 0 && vblank->enabled) { in vblank_disable_fn()
488 drm_dbg_core(dev, "disabling vblank on crtc %u\n", pipe); in vblank_disable_fn()
496 struct drm_vblank_crtc *vblank = ptr; in drm_vblank_init_release() local
498 drm_WARN_ON(dev, READ_ONCE(vblank->enabled) && in drm_vblank_init_release()
501 drm_vblank_destroy_worker(vblank); in drm_vblank_init_release()
502 del_timer_sync(&vblank->disable_timer); in drm_vblank_init_release()
506 * drm_vblank_init - initialize vblank support
510 * This function initializes vblank support for @num_crtcs display pipelines.
525 dev->vblank = drmm_kcalloc(dev, num_crtcs, sizeof(*dev->vblank), GFP_KERNEL); in drm_vblank_init()
526 if (!dev->vblank) in drm_vblank_init()
532 struct drm_vblank_crtc *vblank = &dev->vblank[i]; in drm_vblank_init() local
534 vblank->dev = dev; in drm_vblank_init()
535 vblank->pipe = i; in drm_vblank_init()
536 init_waitqueue_head(&vblank->queue); in drm_vblank_init()
537 timer_setup(&vblank->disable_timer, vblank_disable_fn, 0); in drm_vblank_init()
538 seqlock_init(&vblank->seqlock); in drm_vblank_init()
541 vblank); in drm_vblank_init()
545 ret = drm_vblank_worker_init(vblank); in drm_vblank_init()
559 * Drivers may call this function to test if vblank support is
577 * drm_crtc_vblank_waitqueue - get vblank waitqueue for the CRTC
578 * @crtc: which CRTC's vblank waitqueue to retrieve
580 * This function returns a pointer to the vblank waitqueue for the CRTC.
581 * Drivers can use this to implement vblank waits using wait_event() and related
586 return &crtc->dev->vblank[drm_crtc_index(crtc)].queue; in drm_crtc_vblank_waitqueue()
592 * drm_calc_timestamping_constants - calculate vblank timestamp constants
596 * Calculate and store various constants which are later needed by vblank and
607 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_calc_timestamping_constants() local
639 vblank->linedur_ns = linedur_ns; in drm_calc_timestamping_constants()
640 vblank->framedur_ns = framedur_ns; in drm_calc_timestamping_constants()
641 vblank->hwmode = *mode; in drm_calc_timestamping_constants()
653 * drm_crtc_vblank_helper_get_vblank_timestamp_internal - precise vblank
655 * @crtc: CRTC whose vblank timestamp to retrieve
661 * need to apply some workarounds for gpu-specific vblank irq quirks
667 * Implements calculation of exact vblank timestamps from given drm_display_mode
692 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_crtc_vblank_helper_get_vblank_timestamp_internal() local
712 mode = &vblank->hwmode; in drm_crtc_vblank_helper_get_vblank_timestamp_internal()
777 * vblank_time timestamp for end of vblank. in drm_crtc_vblank_helper_get_vblank_timestamp_internal()
799 * drm_crtc_vblank_helper_get_vblank_timestamp - precise vblank timestamp
801 * @crtc: CRTC whose vblank timestamp to retrieve
807 * need to apply some workarounds for gpu-specific vblank irq quirks
810 * Implements calculation of exact vblank timestamps from given drm_display_mode
842 * vblank interval
844 * @pipe: index of CRTC whose vblank timestamp to retrieve
848 * need to apply some workarounds for gpu-specific vblank irq quirks
852 * vblank interval on specified CRTC. May call into kms-driver to
856 * call, i.e., it isn't very precisely locked to the true vblank.
889 * drm_crtc_vblank_count - retrieve "cooked" vblank counter value
892 * Fetches the "cooked" vblank count value that represents the number of
893 * vblank events since the system was booted, including lost events due to
895 * vblank interrupt (since it only reports the software vblank counter), see
898 * Note that for a given vblank counter value drm_crtc_handle_vblank()
902 * functions, iff the vblank count is the same or a later one.
907 * The software vblank counter.
916 * drm_vblank_count_and_time - retrieve "cooked" vblank counter value and the
917 * system timestamp corresponding to that vblank counter value.
920 * @vblanktime: Pointer to ktime_t to receive the vblank timestamp.
922 * Fetches the "cooked" vblank count value that represents the number of
923 * vblank events since the system was booted, including lost events due to
925 * of the vblank interval that corresponds to the current vblank counter value.
932 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_vblank_count_and_time() local
942 seq = read_seqbegin(&vblank->seqlock); in drm_vblank_count_and_time()
943 vblank_count = atomic64_read(&vblank->count); in drm_vblank_count_and_time()
944 *vblanktime = vblank->time; in drm_vblank_count_and_time()
945 } while (read_seqretry(&vblank->seqlock, seq)); in drm_vblank_count_and_time()
951 * drm_crtc_vblank_count_and_time - retrieve "cooked" vblank counter value
952 * and the system timestamp corresponding to that vblank counter value
954 * @vblanktime: Pointer to time to receive the vblank timestamp.
956 * Fetches the "cooked" vblank count value that represents the number of
957 * vblank events since the system was booted, including lost events due to
959 * of the vblank interval that corresponds to the current vblank counter value.
961 * Note that for a given vblank counter value drm_crtc_handle_vblank()
965 * functions, iff the vblank count is the same or a later one.
1014 * drm_crtc_arm_vblank_event - arm vblank event after pageflip
1015 * @crtc: the source CRTC of the vblank event
1018 * A lot of drivers need to generate vblank events for the very next vblank
1020 * flip gets armed, but not when it actually executes within the next vblank
1021 * period. This helper function implements exactly the required vblank arming
1025 * atomic commit must ensure that the next vblank happens at exactly the same
1027 * does **not** protect against the next vblank interrupt racing with either this
1030 * 1. Driver commits new hardware state into vblank-synchronized registers.
1031 * 2. A vblank happens, committing the hardware state. Also the corresponding
1032 * vblank interrupt is fired off and fully processed by the interrupt
1035 * 4. The event is only send out for the next vblank, which is wrong.
1040 * The only way to make this work safely is to prevent the vblank from firing
1048 * Caller must hold a vblank reference for the event @e acquired by a
1049 * drm_crtc_vblank_get(), which will be dropped when the next vblank arrives.
1066 * drm_crtc_send_vblank_event - helper to send vblank event after pageflip
1067 * @crtc: the source CRTC of the vblank event
1071 * vblank, and sends it to userspace. Caller must hold event lock.
1115 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_vblank_enable() local
1122 if (!vblank->enabled) { in drm_vblank_enable()
1124 * Enable vblank irqs under vblank_time_lock protection. in drm_vblank_enable()
1125 * All vblank count & timestamp updates are held off in drm_vblank_enable()
1128 * prevent double-accounting of same vblank interval. in drm_vblank_enable()
1131 drm_dbg_core(dev, "enabling vblank on crtc %u, ret: %d\n", in drm_vblank_enable()
1134 atomic_dec(&vblank->refcount); in drm_vblank_enable()
1139 * to mark the vblank as enabled after the call in drm_vblank_enable()
1142 WRITE_ONCE(vblank->enabled, true); in drm_vblank_enable()
1153 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_vblank_get() local
1165 if (atomic_add_return(1, &vblank->refcount) == 1) { in drm_vblank_get()
1168 if (!vblank->enabled) { in drm_vblank_get()
1169 atomic_dec(&vblank->refcount); in drm_vblank_get()
1179 * drm_crtc_vblank_get - get a reference count on vblank events
1182 * Acquire a reference count on vblank events to avoid having them disabled
1196 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_vblank_put() local
1201 if (drm_WARN_ON(dev, atomic_read(&vblank->refcount) == 0)) in drm_vblank_put()
1205 if (atomic_dec_and_test(&vblank->refcount)) { in drm_vblank_put()
1209 vblank_disable_fn(&vblank->disable_timer); in drm_vblank_put()
1211 mod_timer(&vblank->disable_timer, in drm_vblank_put()
1217 * drm_crtc_vblank_put - give up ownership of vblank events
1220 * Release ownership of a given vblank counter, turning off interrupts
1230 * drm_wait_one_vblank - wait for one vblank
1234 * This waits for one vblank to pass on @pipe, using the irq driver interfaces.
1235 * It is a failure to call this when the vblank irq for @pipe is disabled, e.g.
1242 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_wait_one_vblank() local
1250 if (drm_WARN(dev, ret, "vblank not available on crtc %i, ret=%i\n", in drm_wait_one_vblank()
1256 ret = wait_event_timeout(vblank->queue, in drm_wait_one_vblank()
1260 drm_WARN(dev, ret == 0, "vblank wait timed out on crtc %i\n", pipe); in drm_wait_one_vblank()
1267 * drm_crtc_wait_one_vblank - wait for one vblank
1270 * This waits for one vblank to pass on @crtc, using the irq driver interfaces.
1271 * It is a failure to call this when the vblank irq for @crtc is disabled, e.g.
1281 * drm_crtc_vblank_off - disable vblank events on a CRTC
1284 * Drivers can use this function to shut down the vblank interrupt handling when
1285 * disabling a crtc. This function ensures that the latest vblank frame count is
1288 * Drivers must use this function when the hardware vblank counter can get
1295 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_crtc_vblank_off() local
1304 * Grab event_lock early to prevent vblank work from being scheduled in drm_crtc_vblank_off()
1305 * while we're in the middle of shutting down vblank interrupts in drm_crtc_vblank_off()
1310 drm_dbg_vbl(dev, "crtc %d, vblank enabled %d, inmodeset %d\n", in drm_crtc_vblank_off()
1311 pipe, vblank->enabled, vblank->inmodeset); in drm_crtc_vblank_off()
1313 /* Avoid redundant vblank disables without previous in drm_crtc_vblank_off()
1315 if (drm_core_check_feature(dev, DRIVER_ATOMIC) || !vblank->inmodeset) in drm_crtc_vblank_off()
1318 wake_up(&vblank->queue); in drm_crtc_vblank_off()
1322 * the vblank interrupt by bumping the refcount. in drm_crtc_vblank_off()
1324 if (!vblank->inmodeset) { in drm_crtc_vblank_off()
1325 atomic_inc(&vblank->refcount); in drm_crtc_vblank_off()
1326 vblank->inmodeset = 1; in drm_crtc_vblank_off()
1330 /* Send any queued vblank events, lest the natives grow disquiet */ in drm_crtc_vblank_off()
1336 drm_dbg_core(dev, "Sending premature vblank event on disable: " in drm_crtc_vblank_off()
1344 /* Cancel any leftover pending vblank work */ in drm_crtc_vblank_off()
1345 drm_vblank_cancel_pending_works(vblank); in drm_crtc_vblank_off()
1351 vblank->hwmode.crtc_clock = 0; in drm_crtc_vblank_off()
1353 /* Wait for any vblank work that's still executing to finish */ in drm_crtc_vblank_off()
1354 drm_vblank_flush_worker(vblank); in drm_crtc_vblank_off()
1359 * drm_crtc_vblank_reset - reset vblank state to off on a CRTC
1362 * Drivers can use this function to reset the vblank state to off at load time.
1365 * drm_crtc_vblank_off() is that this function doesn't save the vblank counter
1374 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_crtc_vblank_reset() local
1378 * Prevent subsequent drm_vblank_get() from enabling the vblank in drm_crtc_vblank_reset()
1381 if (!vblank->inmodeset) { in drm_crtc_vblank_reset()
1382 atomic_inc(&vblank->refcount); in drm_crtc_vblank_reset()
1383 vblank->inmodeset = 1; in drm_crtc_vblank_reset()
1388 drm_WARN_ON(dev, !list_empty(&vblank->pending_work)); in drm_crtc_vblank_reset()
1393 * drm_crtc_set_max_vblank_count - configure the hw max vblank counter value
1395 * @max_vblank_count: max hardware vblank counter value
1397 * Update the maximum hardware vblank counter value for @crtc
1399 * hardware vblank counter depends on the currently active
1402 * For example, if the hardware vblank counter does not work
1414 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_crtc_set_max_vblank_count() local
1417 drm_WARN_ON(dev, !READ_ONCE(vblank->inmodeset)); in drm_crtc_set_max_vblank_count()
1419 vblank->max_vblank_count = max_vblank_count; in drm_crtc_set_max_vblank_count()
1424 * drm_crtc_vblank_on - enable vblank events on a CRTC
1427 * This functions restores the vblank interrupt state captured with
1437 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_crtc_vblank_on() local
1443 drm_dbg_vbl(dev, "crtc %d, vblank enabled %d, inmodeset %d\n", in drm_crtc_vblank_on()
1444 pipe, vblank->enabled, vblank->inmodeset); in drm_crtc_vblank_on()
1447 if (vblank->inmodeset) { in drm_crtc_vblank_on()
1448 atomic_dec(&vblank->refcount); in drm_crtc_vblank_on()
1449 vblank->inmodeset = 0; in drm_crtc_vblank_on()
1456 * user wishes vblank interrupts to be enabled all the time. in drm_crtc_vblank_on()
1458 if (atomic_read(&vblank->refcount) != 0 || drm_vblank_offdelay == 0) in drm_crtc_vblank_on()
1465 * drm_vblank_restore - estimate missed vblanks and update vblank count.
1469 * Power manamement features can cause frame counter resets between vblank
1473 * vblank counter.
1480 struct drm_vblank_crtc *vblank; in drm_vblank_restore() local
1492 vblank = &dev->vblank[pipe]; in drm_vblank_restore()
1494 drm_debug_enabled(DRM_UT_VBL) && !vblank->framedur_ns, in drm_vblank_restore()
1496 framedur_ns = vblank->framedur_ns; in drm_vblank_restore()
1503 diff_ns = ktime_to_ns(ktime_sub(t_vblank, vblank->time)); in drm_vblank_restore()
1510 diff, diff_ns, framedur_ns, cur_vblank - vblank->last); in drm_vblank_restore()
1516 * drm_crtc_vblank_restore - estimate missed vblanks and update vblank count.
1519 * Power manamement features can cause frame counter resets between vblank
1523 * vblank counter.
1534 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_legacy_vblank_pre_modeset() local
1536 /* vblank is not initialized (IRQ not installed ?), or has been freed */ in drm_legacy_vblank_pre_modeset()
1550 if (!vblank->inmodeset) { in drm_legacy_vblank_pre_modeset()
1551 vblank->inmodeset = 0x1; in drm_legacy_vblank_pre_modeset()
1553 vblank->inmodeset |= 0x2; in drm_legacy_vblank_pre_modeset()
1560 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_legacy_vblank_post_modeset() local
1562 /* vblank is not initialized (IRQ not installed ?), or has been freed */ in drm_legacy_vblank_post_modeset()
1569 if (vblank->inmodeset) { in drm_legacy_vblank_post_modeset()
1574 if (vblank->inmodeset & 0x2) in drm_legacy_vblank_post_modeset()
1577 vblank->inmodeset = 0; in drm_legacy_vblank_post_modeset()
1618 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_queue_vblank_event() local
1647 * vblank disable, so no need for further locking. The reference from in drm_queue_vblank_event()
1648 * drm_vblank_get() protects against vblank disable from another source. in drm_queue_vblank_event()
1650 if (!READ_ONCE(vblank->enabled)) { in drm_queue_vblank_event()
1663 drm_dbg_core(dev, "event on vblank count %llu, current %llu, crtc %u\n", in drm_queue_vblank_event()
1739 struct drm_vblank_crtc *vblank; in drm_wait_vblank_ioctl() local
1788 vblank = &dev->vblank[pipe]; in drm_wait_vblank_ioctl()
1791 * queries to return the cached timestamp of the last vblank. in drm_wait_vblank_ioctl()
1795 READ_ONCE(vblank->enabled)) { in drm_wait_vblank_ioctl()
1803 "crtc %d failed to acquire vblank counter, %d\n", in drm_wait_vblank_ioctl()
1831 /* must hold on to the vblank ref until the event fires in drm_wait_vblank_ioctl()
1840 drm_dbg_core(dev, "waiting on vblank count %llu, crtc %u\n", in drm_wait_vblank_ioctl()
1842 wait = wait_event_interruptible_timeout(vblank->queue, in drm_wait_vblank_ioctl()
1844 !READ_ONCE(vblank->enabled), in drm_wait_vblank_ioctl()
1868 drm_dbg_core(dev, "crtc %d vblank wait interrupted by signal\n", in drm_wait_vblank_ioctl()
1895 drm_dbg_core(dev, "vblank event on %llu, current %llu\n", in drm_handle_vblank_events()
1910 * drm_handle_vblank - handle a vblank event
1914 * Drivers should call this routine in their vblank interrupt handlers to
1915 * update the vblank counter and send any signals that may be pending.
1921 struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; in drm_handle_vblank() local
1934 * vblank enable/disable, as this would cause inconsistent in drm_handle_vblank()
1935 * or corrupted timestamps and vblank counts. in drm_handle_vblank()
1939 /* Vblank irq handling disabled. Nothing to do. */ in drm_handle_vblank()
1940 if (!vblank->enabled) { in drm_handle_vblank()
1950 wake_up(&vblank->queue); in drm_handle_vblank()
1953 * we finish processing the following vblank after all events have in drm_handle_vblank()
1959 !atomic_read(&vblank->refcount)); in drm_handle_vblank()
1962 drm_handle_vblank_works(vblank); in drm_handle_vblank()
1967 vblank_disable_fn(&vblank->disable_timer); in drm_handle_vblank()
1974 * drm_crtc_handle_vblank - handle a vblank event
1977 * Drivers should call this routine in their vblank interrupt handlers to
1978 * update the vblank counter and send any signals that may be pending.
1982 * Note that for a given vblank counter value drm_crtc_handle_vblank()
1986 * functions, iff the vblank count is the same or a later one.
2000 * Get crtc VBLANK count.
2011 struct drm_vblank_crtc *vblank; in drm_crtc_get_sequence_ioctl() local
2030 vblank = &dev->vblank[pipe]; in drm_crtc_get_sequence_ioctl()
2031 vblank_enabled = dev->vblank_disable_immediate && READ_ONCE(vblank->enabled); in drm_crtc_get_sequence_ioctl()
2037 "crtc %d failed to acquire vblank counter, %d\n", in drm_crtc_get_sequence_ioctl()
2056 * Queue a event for VBLANK sequence
2067 struct drm_vblank_crtc *vblank; in drm_crtc_queue_sequence_ioctl() local
2095 vblank = &dev->vblank[pipe]; in drm_crtc_queue_sequence_ioctl()
2104 "crtc %d failed to acquire vblank counter, %d\n", in drm_crtc_queue_sequence_ioctl()
2128 * vblank disable, so no need for further locking. The reference from in drm_crtc_queue_sequence_ioctl()
2129 * drm_crtc_vblank_get() protects against vblank disable from another source. in drm_crtc_queue_sequence_ioctl()
2131 if (!READ_ONCE(vblank->enabled)) { in drm_crtc_queue_sequence_ioctl()