From 70887d517290060a80c7f5dd8c0ea0c834c4d91e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Mon, 19 Jul 2010 16:45:23 -0400 Subject: [PATCH] glx: Move __driScreen into the dri screen privates --- src/glx/dri2_glx.c | 22 +++++++++++----------- src/glx/dri_glx.c | 21 +++++++++++---------- src/glx/drisw_glx.c | 19 ++++++++++--------- src/glx/glxclient.h | 1 - 4 files changed, 32 insertions(+), 31 deletions(-) diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index 7d0a8603e05..3187fa16d9c 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -78,7 +78,8 @@ struct dri2_display struct dri2_screen { __GLXscreenConfigs base; - __GLXDRIscreen driScreen; + __DRIscreen *driScreen; + __GLXDRIscreen vtable; const __DRIdri2Extension *dri2; const __DRIcoreExtension *core; @@ -161,7 +162,7 @@ dri2CreateContext(__GLXscreenConfigs *base, pcp->psc = &psc->base; pcp->driContext = - (*psc->dri2->createNewContext) (psc->base.__driScreen, + (*psc->dri2->createNewContext) (psc->driScreen, config->driConfig, shared, pcp); gc->__driContext = pcp->driContext; @@ -217,7 +218,7 @@ dri2CreateDrawable(__GLXscreenConfigs *base, XID xDrawable, pdraw->have_back = 0; if (psc->config) - psc->config->configQueryi(psc->base.__driScreen, + psc->config->configQueryi(psc->driScreen, "vblank_mode", &vblank_mode); switch (vblank_mode) { @@ -238,7 +239,7 @@ dri2CreateDrawable(__GLXscreenConfigs *base, XID xDrawable, pdp = (struct dri2_display *)dpyPriv->dri2Display;; /* Create a new drawable */ pdraw->base.driDrawable = - (*psc->dri2->createNewDrawable) (psc->base.__driScreen, + (*psc->dri2->createNewDrawable) (psc->driScreen, config->driConfig, pdraw); if (!pdraw->base.driDrawable) { @@ -400,9 +401,8 @@ dri2DestroyScreen(__GLXscreenConfigs *base) struct dri2_screen *psc = (struct dri2_screen *) base; /* Free the direct rendering per screen data */ - (*psc->core->destroyScreen) (psc->base.__driScreen); + (*psc->core->destroyScreen) (psc->driScreen); close(psc->fd); - base->__driScreen = NULL; Xfree(psc); } @@ -530,7 +530,7 @@ dri2SetSwapInterval(__GLXDRIdrawable *pdraw, int interval) struct dri2_screen *psc = (struct dri2_screen *) priv->base.psc; if (psc->config) - psc->config->configQueryi(psc->base.__driScreen, + psc->config->configQueryi(psc->driScreen, "vblank_mode", &vblank_mode); switch (vblank_mode) { @@ -737,18 +737,18 @@ dri2CreateScreen(int screen, __GLXdisplayPrivate * priv) /* If the server does not support the protocol for * DRI2GetBuffersWithFormat, don't supply that interface to the driver. */ - psc->base.__driScreen = + psc->driScreen = psc->dri2->createNewScreen(screen, psc->fd, (const __DRIextension **) &pdp->loader_extensions[0], &driver_configs, psc); - if (psc->base.__driScreen == NULL) { + if (psc->driScreen == NULL) { ErrorMessageF("failed to create dri screen\n"); goto handle_error; } - extensions = psc->core->getExtensions(psc->base.__driScreen); + extensions = psc->core->getExtensions(psc->driScreen); driBindCommonExtensions(&psc->base, extensions); dri2BindExtensions(psc, extensions); @@ -759,7 +759,7 @@ dri2CreateScreen(int screen, __GLXdisplayPrivate * priv) psc->base.driver_configs = driver_configs; - psp = &psc->driScreen; + psp = &psc->vtable; psc->base.driScreen = psp; psp->destroyScreen = dri2DestroyScreen; psp->createContext = dri2CreateContext; diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c index 42d5994b2e2..373f9fb649d 100644 --- a/src/glx/dri_glx.c +++ b/src/glx/dri_glx.c @@ -63,7 +63,8 @@ struct dri_screen { __GLXscreenConfigs base; - __GLXDRIscreen driScreen; + __DRIscreen *driScreen; + __GLXDRIscreen vtable; const __DRIlegacyExtension *legacy; const __DRIcoreExtension *core; const __DRIswapControlExtension *swapControl; @@ -551,7 +552,7 @@ driCreateContext(__GLXscreenConfigs *base, } pcp->driContext = - (*psc->legacy->createNewContext) (psc->base.__driScreen, + (*psc->legacy->createNewContext) (psc->driScreen, config->driConfig, renderType, shared, hwContext, pcp); if (pcp->driContext == NULL) { @@ -607,7 +608,7 @@ driCreateDrawable(__GLXscreenConfigs *base, /* Create a new drawable */ pdraw->driDrawable = - (*psc->legacy->createNewDrawable) (psc->base.__driScreen, + (*psc->legacy->createNewDrawable) (psc->driScreen, config->driConfig, hwDrawable, GLX_WINDOW_BIT, @@ -648,9 +649,9 @@ driDestroyScreen(__GLXscreenConfigs *base) struct dri_screen *psc = (struct dri_screen *) base; /* Free the direct rendering per screen data */ - if (psc->base.__driScreen) - (*psc->core->destroyScreen) (psc->base.__driScreen); - psc->base.__driScreen = NULL; + if (psc->driScreen) + (*psc->core->destroyScreen) (psc->driScreen); + psc->driScreen = NULL; if (psc->driver) dlclose(psc->driver); } @@ -820,19 +821,19 @@ driCreateScreen(int screen, __GLXdisplayPrivate *priv) } pdp = (struct dri_display *) priv->driDisplay; - psc->base.__driScreen = + psc->driScreen = CallCreateNewScreen(psc->base.dpy, screen, psc, pdp); - if (psc->base.__driScreen == NULL) { + if (psc->driScreen == NULL) { dlclose(psc->driver); Xfree(psc); return NULL; } - extensions = psc->core->getExtensions(psc->base.__driScreen); + extensions = psc->core->getExtensions(psc->driScreen); driBindExtensions(psc, extensions); driBindCommonExtensions(&psc->base, extensions); - psp = &psc->driScreen; + psp = &psc->vtable; psc->base.driScreen = psp; if (psc->base.driCopySubBuffer) psp->copySubBuffer = driCopySubBuffer; diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c index d403b235372..e9a88e6db0c 100644 --- a/src/glx/drisw_glx.c +++ b/src/glx/drisw_glx.c @@ -44,7 +44,8 @@ struct drisw_screen { __GLXscreenConfigs base; - __GLXDRIscreen driScreen; + __DRIscreen *driScreen; + __GLXDRIscreen vtable; const __DRIcoreExtension *core; const __DRIswrastExtension *swrast; void *driver; @@ -290,7 +291,7 @@ driCreateContext(__GLXscreenConfigs *base, pcp->psc = &psc->base; pcp->driContext = - (*psc->core->createNewContext) (psc->base.__driScreen, + (*psc->core->createNewContext) (psc->driScreen, config->driConfig, shared, pcp); if (pcp->driContext == NULL) { Xfree(pcp); @@ -344,7 +345,7 @@ driCreateDrawable(__GLXscreenConfigs *base, XID xDrawable, /* Create a new drawable */ pdraw->driDrawable = - (*swrast->createNewDrawable) (psc->base.__driScreen, + (*swrast->createNewDrawable) (psc->driScreen, config->driConfig, pdp); if (!pdraw->driDrawable) { @@ -380,8 +381,8 @@ driDestroyScreen(__GLXscreenConfigs *base) struct drisw_screen *psc = (struct drisw_screen *) base; /* Free the direct rendering per screen data */ - (*psc->core->destroyScreen) (psc->base.__driScreen); - psc->base.__driScreen = NULL; + (*psc->core->destroyScreen) (psc->driScreen); + psc->driScreen = NULL; if (psc->driver) dlclose(psc->driver); } @@ -439,15 +440,15 @@ driCreateScreen(int screen, __GLXdisplayPrivate *priv) goto handle_error; } - psc->base.__driScreen = + psc->driScreen = psc->swrast->createNewScreen(screen, loader_extensions, &driver_configs, psc); - if (psc->base.__driScreen == NULL) { + if (psc->driScreen == NULL) { ErrorMessageF("failed to create dri screen\n"); goto handle_error; } - extensions = psc->core->getExtensions(psc->base.__driScreen); + extensions = psc->core->getExtensions(psc->driScreen); driBindCommonExtensions(&psc->base, extensions); psc->base.configs = @@ -457,7 +458,7 @@ driCreateScreen(int screen, __GLXdisplayPrivate *priv) psc->base.driver_configs = driver_configs; - psp = &psc->driScreen; + psp = &psc->vtable; psc->base.driScreen = psp; psp->destroyScreen = driDestroyScreen; psp->createContext = driCreateContext; diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h index b865e24b36e..d7af44470f0 100644 --- a/src/glx/glxclient.h +++ b/src/glx/glxclient.h @@ -528,7 +528,6 @@ struct __GLXscreenConfigsRec /** * Per screen direct rendering interface functions and data. */ - __DRIscreen *__driScreen; __glxHashTable *drawHash; Display *dpy; int scr; -- 2.30.2