[RFC 3/5] modesetting: Implement an ms_drm_abort_seq() function.

Kenneth Graunke kenneth at whitecape.org
Thu Jan 29 01:51:08 PST 2015


This is a specialization of ms_drm_abort that matches based on the drm
event queue's sequence number.

Based on code by Keith Packard.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 hw/xfree86/drivers/modesetting/driver.h |  1 +
 hw/xfree86/drivers/modesetting/vblank.c | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/hw/xfree86/drivers/modesetting/driver.h b/hw/xfree86/drivers/modesetting/driver.h
index 4b6ae87..843a105 100644
--- a/hw/xfree86/drivers/modesetting/driver.h
+++ b/hw/xfree86/drivers/modesetting/driver.h
@@ -117,6 +117,7 @@ uint32_t ms_drm_queue_alloc(xf86CrtcPtr crtc,
 void ms_drm_abort(ScrnInfoPtr scrn,
                   Bool (*match)(void *data, void *match_data),
                   void *match_data);
+void ms_drm_abort_seq(ScrnInfoPtr scrn, uint32_t seq);
 
 Bool ms_crtc_on(xf86CrtcPtr crtc);
 
diff --git a/hw/xfree86/drivers/modesetting/vblank.c b/hw/xfree86/drivers/modesetting/vblank.c
index 91cfcf2..776dcef 100644
--- a/hw/xfree86/drivers/modesetting/vblank.c
+++ b/hw/xfree86/drivers/modesetting/vblank.c
@@ -323,6 +323,22 @@ ms_drm_abort_scrn(ScrnInfoPtr scrn)
     }
 }
 
+/**
+ * Abort by drm queue sequence number.
+ */
+void
+ms_drm_abort_seq(ScrnInfoPtr scrn, uint32_t seq)
+{
+    struct ms_drm_queue *q, *tmp;
+
+    xorg_list_for_each_entry_safe(q, tmp, &ms_drm_queue, list) {
+        if (q->seq == seq) {
+            ms_drm_abort_one(q);
+            break;
+        }
+    }
+}
+
 /*
  * Externally usable abort function that uses a callback to match a single
  * queued entry to abort
-- 
2.2.2



More information about the xorg-devel mailing list