diff options
Diffstat (limited to 'hw/kdrive/src/kaa.c')
-rw-r--r-- | hw/kdrive/src/kaa.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/hw/kdrive/src/kaa.c b/hw/kdrive/src/kaa.c index c9805ddb6..da618bee5 100644 --- a/hw/kdrive/src/kaa.c +++ b/hw/kdrive/src/kaa.c @@ -42,9 +42,8 @@ #define DBG_PIXMAP(a) #endif -int kaaGeneration; -int kaaScreenPrivateIndex; -int kaaPixmapPrivateIndex; +DevPrivateKey kaaScreenPrivateKey = &kaaScreenPrivateKey; +DevPrivateKey kaaPixmapPrivateKey = &kaaPixmapPrivateKey; #define KAA_PIXMAP_SCORE_MOVE_IN 10 #define KAA_PIXMAP_SCORE_MAX 20 @@ -1066,13 +1065,6 @@ kaaDrawInit (ScreenPtr pScreen, PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); #endif - if (kaaGeneration != serverGeneration) - { - kaaScreenPrivateIndex = AllocateScreenPrivateIndex(); - kaaPixmapPrivateIndex = AllocatePixmapPrivateIndex(); - kaaGeneration = serverGeneration; - } - pKaaScr = xalloc (sizeof (KaaScreenPrivRec)); if (!pKaaScr) @@ -1080,7 +1072,7 @@ kaaDrawInit (ScreenPtr pScreen, pKaaScr->info = pScreenInfo; - pScreen->devPrivates[kaaScreenPrivateIndex].ptr = (pointer) pKaaScr; + dixSetPrivate(&pScreen->devPrivates, kaaScreenPrivateKey, pKaaScr); /* * Hook up asynchronous drawing @@ -1106,17 +1098,11 @@ kaaDrawInit (ScreenPtr pScreen, if ((pKaaScr->info->flags & KAA_OFFSCREEN_PIXMAPS) && screen->off_screen_base < screen->memory_size) { - if (!AllocatePixmapPrivate(pScreen, kaaPixmapPrivateIndex, - sizeof (KaaPixmapPrivRec))) + if (!dixRequestPrivate(kaaPixmapPrivateKey, sizeof (KaaPixmapPrivRec))) return FALSE; pScreen->CreatePixmap = kaaCreatePixmap; pScreen->DestroyPixmap = kaaDestroyPixmap; } - else - { - if (!AllocatePixmapPrivate(pScreen, kaaPixmapPrivateIndex, 0)) - return FALSE; - } return TRUE; } |