diff options
author | Dave Airlie <airlied@redhat.com> | 2012-04-20 15:16:24 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-04-20 15:16:24 +0100 |
commit | 5b2b3c217c9d78ede91616a90254d71b4f75463b (patch) | |
tree | 5a3a9923c4b6531e56ebaecd59844ea9c36181f2 | |
parent | 0385a76a999c23e383aa6f89e4ed6daaad5fa054 (diff) |
dri2: split out private init
-rw-r--r-- | hw/xfree86/dri2/dri2.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index 78779544a..c9a290544 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -1203,6 +1203,22 @@ DRI2ConfigNotify(WindowPtr pWin, int x, int y, int w, int h, int bw, return Success; } +static Bool DRI2InitPrivates(void) +{ + if (!dixRegisterPrivateKey(&dri2ScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) + return FALSE; + + if (!dixRegisterPrivateKey(&dri2WindowPrivateKeyRec, PRIVATE_WINDOW, 0)) + return FALSE; + + if (!dixRegisterPrivateKey(&dri2PixmapPrivateKeyRec, PRIVATE_PIXMAP, 0)) + return FALSE; + + if (!dixRegisterPrivateKey(&dri2ClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(DRI2ClientRec))) + return FALSE; + return TRUE; +} + Bool DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) { @@ -1224,16 +1240,7 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) return FALSE; } - if (!dixRegisterPrivateKey(&dri2ScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) - return FALSE; - - if (!dixRegisterPrivateKey(&dri2WindowPrivateKeyRec, PRIVATE_WINDOW, 0)) - return FALSE; - - if (!dixRegisterPrivateKey(&dri2PixmapPrivateKeyRec, PRIVATE_PIXMAP, 0)) - return FALSE; - - if (!dixRegisterPrivateKey(&dri2ClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(DRI2ClientRec))) + if (!DRI2InitPrivates()) return FALSE; ds = calloc(1, sizeof *ds); |