Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Lyude Paul <lyude@redhat.com>
Subject: [Intel-xe] [PATCH 2/3] drm/vblank: Warn when silently cancelling vblank works
Date: Wed, 20 Sep 2023 17:03:38 +0300	[thread overview]
Message-ID: <20230920140339.28322-2-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20230920140339.28322-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@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@redhat.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@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);
-- 
2.41.0


  reply	other threads:[~2023-09-20 14:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-20 14:03 [Intel-xe] [PATCH 1/3] drm/i915: Use vblank worker to unpin old legacy cursor fb safely Ville Syrjala
2023-09-20 14:03 ` Ville Syrjala [this message]
2023-09-20 19:55   ` [Intel-xe] [PATCH 2/3] drm/vblank: Warn when silently cancelling vblank works Lyude Paul
2023-10-03 13:34     ` Ville Syrjälä
2023-09-20 14:03 ` [Intel-xe] [PATCH 3/3] maybe xe is broken enough that it gives you a new vma every time? Ville Syrjala
2023-09-20 17:27   ` [Intel-xe] [PATCH v2 " Ville Syrjala
2023-09-20 14:06 ` [Intel-xe] ✓ CI.Patch_applied: success for series starting with [1/3] drm/i915: Use vblank worker to unpin old legacy cursor fb safely Patchwork
2023-09-20 14:06 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-09-20 14:07 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-09-20 14:14 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-09-20 14:15 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-09-20 14:16 ` [Intel-xe] ✗ CI.checksparse: warning " Patchwork
2023-09-20 14:48 ` [Intel-xe] ✗ CI.BAT: failure " Patchwork
2023-09-20 18:45 ` [Intel-xe] ✓ CI.Patch_applied: success for series starting with [1/3] drm/i915: Use vblank worker to unpin old legacy cursor fb safely (rev2) Patchwork
2023-09-20 18:45 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-09-20 18:46 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-09-20 18:53 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-09-20 18:54 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-09-20 18:55 ` [Intel-xe] ✗ CI.checksparse: warning " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230920140339.28322-2-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lyude@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox