Skip to content

Commit

Permalink
drm/vblank: Warn when silently cancelling vblank works
Browse files Browse the repository at this point in the history
Silently cancelling vblank works is a bit rude, especially
if said works do any resource management (eg. free memory).
WARN if we ever hit this.

TODO: Maybe drm_crtc_vblank_off() should wait for any
pending work to reach its target vblank before actually
doing anything drastic?

Cc: Lyude Paul <lyude@redhat.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230920140339.28322-2-ville.syrjala@linux.intel.com
Reviewed-by: Lyude Paul <lyude@redhat.com>
  • Loading branch information
Ville Syrjälä committed Oct 3, 2023
1 parent db0f246 commit 653e248
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/drm_vblank_work.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ void drm_vblank_cancel_pending_works(struct drm_vblank_crtc *vblank)

assert_spin_locked(&vblank->dev->event_lock);

drm_WARN_ONCE(vblank->dev, !list_empty(&vblank->pending_work),
"Cancelling pending vblank works!\n");

list_for_each_entry_safe(work, next, &vblank->pending_work, node) {
list_del_init(&work->node);
drm_vblank_put(vblank->dev, vblank->pipe);
Expand Down

0 comments on commit 653e248

Please sign in to comment.