summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--glx/glxdri.c15
-rw-r--r--glx/glxdri2.c14
-rw-r--r--glx/glxdriswrast.c14
3 files changed, 34 insertions, 9 deletions
diff --git a/glx/glxdri.c b/glx/glxdri.c
index 244eac6c2..326f53915 100644
--- a/glx/glxdri.c
+++ b/glx/glxdri.c
@@ -78,6 +78,7 @@ struct __GLXDRIscreen {
const __DRIlegacyExtension *legacy;
const __DRIcopySubBufferExtension *copySubBuffer;
const __DRIswapControlExtension *swapControl;
+ const __DRIconfig **driConfigs;
#ifdef __DRI_TEX_OFFSET
const __DRItexOffsetExtension *texOffset;
@@ -585,6 +586,8 @@ static __GLXtextureFromPixmap __glXDRItextureFromPixmap = {
static void
__glXDRIscreenDestroy(__GLXscreen *baseScreen)
{
+ int i;
+
__GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
screen->core->destroyScreen(screen->driScreen);
@@ -593,6 +596,12 @@ __glXDRIscreenDestroy(__GLXscreen *baseScreen)
__glXScreenDestroy(baseScreen);
+ if (screen->driConfigs) {
+ for (i = 0; screen->driConfigs[i] != NULL; i++)
+ free((__DRIconfig **)screen->driConfigs[i]);
+ free(screen->driConfigs);
+ }
+
free(screen);
}
@@ -967,7 +976,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
Bool isCapable;
size_t buffer_size;
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- const __DRIconfig **driConfigs;
if (!xf86LoaderCheckSymbol("DRIQueryDirectRenderingCapable") ||
!DRIQueryDirectRenderingCapable(pScreen, &isCapable) ||
@@ -1095,7 +1103,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
pSAREA,
fd,
loader_extensions,
- &driConfigs,
+ &screen->driConfigs,
screen);
if (screen->driScreen == NULL) {
@@ -1105,7 +1113,8 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
}
screen->base.fbconfigs = glxConvertConfigs(screen->core,
- driConfigs, GLX_WINDOW_BIT);
+ screen->driConfigs,
+ GLX_WINDOW_BIT);
initializeExtensions(screen);
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index e8722585b..8187a3edd 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -73,6 +73,7 @@ struct __GLXDRIscreen {
const __DRIcopySubBufferExtension *copySubBuffer;
const __DRIswapControlExtension *swapControl;
const __DRItexBufferExtension *texBuffer;
+ const __DRIconfig **driConfigs;
unsigned char glx_enable_bits[__GLX_EXT_BYTES];
};
@@ -363,6 +364,8 @@ static __GLXtextureFromPixmap __glXDRItextureFromPixmap = {
static void
__glXDRIscreenDestroy(__GLXscreen *baseScreen)
{
+ int i;
+
__GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
(*screen->core->destroyScreen)(screen->driScreen);
@@ -371,6 +374,12 @@ __glXDRIscreenDestroy(__GLXscreen *baseScreen)
__glXScreenDestroy(baseScreen);
+ if (screen->driConfigs) {
+ for (i = 0; screen->driConfigs[i] != NULL; i++)
+ free((__DRIconfig **)screen->driConfigs[i]);
+ free(screen->driConfigs);
+ }
+
free(screen);
}
@@ -688,7 +697,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
__GLXDRIscreen *screen;
size_t buffer_size;
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- const __DRIconfig **driConfigs;
screen = calloc(1, sizeof *screen);
if (screen == NULL)
@@ -720,7 +728,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
(*screen->dri2->createNewScreen)(pScreen->myNum,
screen->fd,
loader_extensions,
- &driConfigs,
+ &screen->driConfigs,
screen);
if (screen->driScreen == NULL) {
@@ -731,7 +739,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
initializeExtensions(screen);
- screen->base.fbconfigs = glxConvertConfigs(screen->core, driConfigs,
+ screen->base.fbconfigs = glxConvertConfigs(screen->core, screen->driConfigs,
GLX_WINDOW_BIT |
GLX_PIXMAP_BIT |
GLX_PBUFFER_BIT);
diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c
index ed142c167..d064a0536 100644
--- a/glx/glxdriswrast.c
+++ b/glx/glxdriswrast.c
@@ -74,6 +74,7 @@ struct __GLXDRIscreen {
const __DRIswrastExtension *swrast;
const __DRIcopySubBufferExtension *copySubBuffer;
const __DRItexBufferExtension *texBuffer;
+ const __DRIconfig **driConfigs;
};
struct __GLXDRIcontext {
@@ -240,6 +241,8 @@ static __GLXtextureFromPixmap __glXDRItextureFromPixmap = {
static void
__glXDRIscreenDestroy(__GLXscreen *baseScreen)
{
+ int i;
+
__GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
(*screen->core->destroyScreen)(screen->driScreen);
@@ -248,6 +251,12 @@ __glXDRIscreenDestroy(__GLXscreen *baseScreen)
__glXScreenDestroy(baseScreen);
+ if (screen->driConfigs) {
+ for (i = 0; screen->driConfigs[i] != NULL; i++)
+ free((__DRIconfig **)screen->driConfigs[i]);
+ free(screen->driConfigs);
+ }
+
free(screen);
}
@@ -426,7 +435,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
{
const char *driverName = "swrast";
__GLXDRIscreen *screen;
- const __DRIconfig **driConfigs;
screen = calloc(1, sizeof *screen);
if (screen == NULL)
@@ -450,7 +458,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
screen->driScreen =
(*screen->swrast->createNewScreen)(pScreen->myNum,
loader_extensions,
- &driConfigs,
+ &screen->driConfigs,
screen);
if (screen->driScreen == NULL) {
@@ -461,7 +469,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
initializeExtensions(screen);
- screen->base.fbconfigs = glxConvertConfigs(screen->core, driConfigs,
+ screen->base.fbconfigs = glxConvertConfigs(screen->core, screen->driConfigs,
GLX_WINDOW_BIT |
GLX_PIXMAP_BIT |
GLX_PBUFFER_BIT);