summaryrefslogtreecommitdiff
path: root/hw/kdrive/src
diff options
context:
space:
mode:
Diffstat (limited to 'hw/kdrive/src')
-rw-r--r--hw/kdrive/src/kdrive.c6
-rw-r--r--hw/kdrive/src/kdrive.h4
-rw-r--r--hw/kdrive/src/kxv.c14
3 files changed, 17 insertions, 7 deletions
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index 27596e467..06c3661da 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -64,8 +64,7 @@ KdDepths kdDepths[] = {
#define KD_DEFAULT_BUTTONS 5
-static int kdScreenPrivateKeyIndex;
-DevPrivateKey kdScreenPrivateKey = &kdScreenPrivateKeyIndex;
+DevPrivateKeyRec kdScreenPrivateKeyRec;
unsigned long kdGeneration;
Bool kdVideoTest;
@@ -699,6 +698,9 @@ KdAllocatePrivates (ScreenPtr pScreen)
if (kdGeneration != serverGeneration)
kdGeneration = serverGeneration;
+ if (!dixRegisterPrivateKey(&kdScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
+ return FALSE;
+
pScreenPriv = calloc(1, sizeof (*pScreenPriv));
if (!pScreenPriv)
return FALSE;
diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h
index 35ce03660..3ca98146b 100644
--- a/hw/kdrive/src/kdrive.h
+++ b/hw/kdrive/src/kdrive.h
@@ -342,7 +342,9 @@ typedef struct _KdPointerMatrix {
(PixmapWidthPaddingInfo[d].padRoundUp+1)))
#endif
-extern DevPrivateKey kdScreenPrivateKey;
+extern DevPrivateKeyRec kdScreenPrivateKeyRec;
+#define kdScreenPrivateKey (&kdScreenPrivateKeyRec)
+
extern unsigned long kdGeneration;
extern Bool kdEnabled;
extern Bool kdSwitchPending;
diff --git a/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c
index 99ab2d824..24ae89eac 100644
--- a/hw/kdrive/src/kxv.c
+++ b/hw/kdrive/src/kxv.c
@@ -103,10 +103,10 @@ static void KdXVClipNotify(WindowPtr pWin, int dx, int dy);
/* misc */
static Bool KdXVInitAdaptors(ScreenPtr, KdVideoAdaptorPtr*, int);
-static int KdXVWindowKeyIndex;
-DevPrivateKey KdXVWindowKey = &KdXVWindowKeyIndex;
-static int KdXvScreenKeyIndex;
-DevPrivateKey KdXvScreenKey = &KdXvScreenKeyIndex;
+static DevPrivateKeyRec KdXVWindowKeyRec;
+#define KdXVWindowKey (&KdXVWindowKeyRec)
+static DevPrivateKeyRec KdXvScreenKeyRec;
+#define KdXvScreenKey (&KdXvScreenKeyRec)
static unsigned long KdXVGeneration = 0;
static unsigned long PortResource = 0;
@@ -199,6 +199,12 @@ KdXVScreenInit(
if(!XvGetScreenKeyProc || !XvGetRTPortProc || !XvScreenInitProc)
return FALSE;
+ if (!dixRegisterPrivateKey(&KdXVWindowKeyRec, PRIVATE_WINDOW, 0))
+ return FALSE;
+
+ if (!dixRegisterPrivateKey(&KdXVScreenKeyRec, PRIVATE_SCREEN, 0))
+ return FALSE;
+
if(Success != (*XvScreenInitProc)(pScreen)) return FALSE;
KdXvScreenKey = (*XvGetScreenKeyProc)();