[PATCH v5 xserver 1/7] dix: Add dixPrivatesCreated helper function

Hans de Goede hdegoede at redhat.com
Tue Sep 6 11:31:11 UTC 2016


From: Dave Airlie <airlied at redhat.com>

This is a preparation patch for adding prime hw-cursor support.

Signed-off-by: Dave Airlie <airlied at redhat.com>
Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 dix/privates.c     | 9 +++++++++
 include/privates.h | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/dix/privates.c b/dix/privates.c
index 969d014..478f52c 100644
--- a/dix/privates.c
+++ b/dix/privates.c
@@ -783,3 +783,12 @@ dixResetPrivates(void)
         global_keys[t].allocated = 0;
     }
 }
+
+Bool
+dixPrivatesCreated(DevPrivateType type)
+{
+    if (global_keys[type].created)
+        return TRUE;
+    else
+        return FALSE;
+}
diff --git a/include/privates.h b/include/privates.h
index 7d1461c..a2bb1a4 100644
--- a/include/privates.h
+++ b/include/privates.h
@@ -252,6 +252,9 @@ dixFreeScreenSpecificPrivates(ScreenPtr pScreen);
 extern void
 dixInitScreenSpecificPrivates(ScreenPtr pScreen);
 
+/* is this private created - so hotplug can avoid crashing */
+Bool dixPrivatesCreated(DevPrivateType type);
+
 extern _X_EXPORT void *
 _dixAllocateScreenObjectWithPrivates(ScreenPtr pScreen,
                                      unsigned size,
-- 
2.9.3



More information about the xorg-devel mailing list