[Intel-xe] [PATCH 2/3] drm/vblank: Warn when silently cancelling vblank works
Ville Syrjälä
ville.syrjala at linux.intel.com
Tue Oct 3 13:34:49 UTC 2023
On Wed, Sep 20, 2023 at 03:55:28PM -0400, Lyude Paul wrote:
> Good point!
>
> Reviewed-by: Lyude Paul <lyude at redhat.com>
Thanks. Pushed to drm-misc-next.
>
> On Wed, 2023-09-20 at 17:03 +0300, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> >
> > 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 at redhat.com>
> > Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > ---
> > drivers/gpu/drm/drm_vblank_work.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/drm_vblank_work.c b/drivers/gpu/drm/drm_vblank_work.c
> > index bd481fdd6b87..43cd5c0f4f6f 100644
> > --- a/drivers/gpu/drm/drm_vblank_work.c
> > +++ b/drivers/gpu/drm/drm_vblank_work.c
> > @@ -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);
>
> --
> Cheers,
> Lyude Paul (she/her)
> Software Engineer at Red Hat
--
Ville Syrjälä
Intel
More information about the Intel-xe
mailing list