diff options
author | Adam Jackson <ajax@redhat.com> | 2016-03-23 15:41:24 -0400 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2016-03-30 11:13:57 -0400 |
commit | 2e8781ead3067b195baec2e76a28091575679383 (patch) | |
tree | 66e1c22595b244106c57592df0f6d0b21857c79f /glx | |
parent | e21de4bf3c5ff8cbb9c5ea023d04162e5e56b3df (diff) |
glx: Compute the GLX extension string from __glXScreenInit
Now that the enable bits are in the screen base class we can compute
this in one place, rather than making every backend do it.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'glx')
-rw-r--r-- | glx/glxdri2.c | 12 | ||||
-rw-r--r-- | glx/glxdriswrast.c | 12 | ||||
-rw-r--r-- | glx/glxscreens.c | 8 |
3 files changed, 8 insertions, 24 deletions
diff --git a/glx/glxdri2.c b/glx/glxdri2.c index fa93da1ea..15253d19d 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -939,7 +939,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen) { const char *driverName, *deviceName; __GLXDRIscreen *screen; - size_t buffer_size; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); screen = calloc(1, sizeof *screen); @@ -988,17 +987,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen) __glXScreenInit(&screen->base, pScreen); - /* The first call simply determines the length of the extension string. - * This allows us to allocate some memory to hold the extension string, - * but it requires that we call __glXGetExtensionString a second time. - */ - buffer_size = __glXGetExtensionString(screen->base.glx_enable_bits, NULL); - if (buffer_size > 0) { - screen->base.GLXextensions = xnfalloc(buffer_size); - (void) __glXGetExtensionString(screen->base.glx_enable_bits, - screen->base.GLXextensions); - } - screen->enterVT = pScrn->EnterVT; pScrn->EnterVT = glxDRIEnterVT; screen->leaveVT = pScrn->LeaveVT; diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c index 27c98ed3e..0b5122f6f 100644 --- a/glx/glxdriswrast.c +++ b/glx/glxdriswrast.c @@ -448,7 +448,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen) { const char *driverName = "swrast"; __GLXDRIscreen *screen; - size_t buffer_size; screen = calloc(1, sizeof *screen); if (screen == NULL) @@ -490,17 +489,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen) __glXScreenInit(&screen->base, pScreen); - /* The first call simply determines the length of the extension string. - * This allows us to allocate some memory to hold the extension string, - * but it requires that we call __glXGetExtensionString a second time. - */ - buffer_size = __glXGetExtensionString(screen->base.glx_enable_bits, NULL); - if (buffer_size > 0) { - screen->base.GLXextensions = xnfalloc(buffer_size); - (void) __glXGetExtensionString(screen->base.glx_enable_bits, - screen->base.GLXextensions); - } - __glXsetGetProcAddress(glXGetProcAddressARB); LogMessage(X_INFO, "AIGLX: Loaded and initialized %s\n", driverName); diff --git a/glx/glxscreens.c b/glx/glxscreens.c index 61b8a522a..7e083cf19 100644 --- a/glx/glxscreens.c +++ b/glx/glxscreens.c @@ -383,6 +383,14 @@ __glXScreenInit(__GLXscreen * pGlxScreen, ScreenPtr pScreen) } dixSetPrivate(&pScreen->devPrivates, glxScreenPrivateKey, pGlxScreen); + + i = __glXGetExtensionString(pGlxScreen->glx_enable_bits, NULL); + if (i > 0) { + pGlxScreen->GLXextensions = xnfalloc(i); + (void) __glXGetExtensionString(pGlxScreen->glx_enable_bits, + pGlxScreen->GLXextensions); + } + } void |