From: Brian Date: Mon, 5 Nov 2007 18:48:54 +0000 (-0700) Subject: remove intelScreenPrivate typedef and use cast wrapper function to be like intel_cont... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=adf3761fbd193e4467b0637340709e57bdae0111;p=mesa.git remove intelScreenPrivate typedef and use cast wrapper function to be like intel_context and intel_framebuffer --- diff --git a/src/mesa/drivers/dri/intel_winsys/intel_context.c b/src/mesa/drivers/dri/intel_winsys/intel_context.c index 91ac077a482..b7bfc39f89c 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_context.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_context.c @@ -83,7 +83,7 @@ intelCreateContext(const __GLcontextModes * mesaVis, struct intel_context *intel = CALLOC_STRUCT(intel_context); __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv; - intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private; + struct intel_screen *intelScreen = intel_screen(sPriv); drmI830Sarea *saPriv = intelScreen->sarea; int fthrottle_mode; GLboolean havePools; diff --git a/src/mesa/drivers/dri/intel_winsys/intel_context.h b/src/mesa/drivers/dri/intel_winsys/intel_context.h index 32fb37dd94d..9d24ca124af 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_context.h +++ b/src/mesa/drivers/dri/intel_winsys/intel_context.h @@ -71,7 +71,7 @@ struct intel_context __DRIdrawablePrivate *driDrawable; __DRIscreenPrivate *driScreen; - intelScreenPrivate *intelScreen; + struct intel_screen *intelScreen; drmI830Sarea *sarea; GLuint lastStamp; diff --git a/src/mesa/drivers/dri/intel_winsys/intel_lock.c b/src/mesa/drivers/dri/intel_winsys/intel_lock.c index 5962b9259d1..74a7a55bd01 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_lock.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_lock.c @@ -45,7 +45,7 @@ intelContendedLock(struct intel_context *intel, GLuint flags) { __DRIdrawablePrivate *dPriv = intel->driDrawable; __DRIscreenPrivate *sPriv = intel->driScreen; - intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private; + struct intel_screen *intelScreen = intel_screen(sPriv); drmI830Sarea *sarea = intel->sarea; drmGetLock(intel->driFd, intel->hHWContext, flags); diff --git a/src/mesa/drivers/dri/intel_winsys/intel_screen.c b/src/mesa/drivers/dri/intel_winsys/intel_screen.c index 646c4ec911a..feaeb181f43 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_screen.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_screen.c @@ -64,7 +64,7 @@ PUBLIC const char __driConfigOptions[] = static void -intelPrintDRIInfo(intelScreenPrivate * intelScreen, +intelPrintDRIInfo(struct intel_screen * intelScreen, __DRIscreenPrivate * sPriv, I830DRIPtr gDRIPriv) { fprintf(stderr, "*** Front size: 0x%x offset: 0x%x pitch: %d\n", @@ -110,7 +110,7 @@ intelPrintSAREA(const drmI830Sarea * sarea) void intelUpdateScreenRotation(__DRIscreenPrivate * sPriv, drmI830Sarea * sarea) { - intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private; + struct intel_screen *intelScreen = intel_screen(sPriv); if (intelScreen->front.map) { drmUnmap(intelScreen->front.map, intelScreen->front.size); @@ -160,7 +160,7 @@ GLboolean intelCreatePools(__DRIscreenPrivate * sPriv) { unsigned batchPoolSize = 1024*1024; - intelScreenPrivate *intelScreen = sPriv->private; + struct intel_screen *intelScreen = intel_screen(sPriv); if (intelScreen->havePools) return GL_TRUE; @@ -198,7 +198,7 @@ intelCreatePools(__DRIscreenPrivate * sPriv) static GLboolean intelInitDriver(__DRIscreenPrivate * sPriv) { - intelScreenPrivate *intelScreen; + struct intel_screen *intelScreen; I830DRIPtr gDRIPriv = (I830DRIPtr) sPriv->pDevPriv; PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = @@ -213,7 +213,7 @@ intelInitDriver(__DRIscreenPrivate * sPriv) } /* Allocate the private area */ - intelScreen = (intelScreenPrivate *) CALLOC(sizeof(intelScreenPrivate)); + intelScreen = CALLOC_STRUCT(intel_screen); if (!intelScreen) return GL_FALSE; @@ -252,7 +252,7 @@ intelInitDriver(__DRIscreenPrivate * sPriv) static void intelDestroyScreen(__DRIscreenPrivate * sPriv) { - intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private; + struct intel_screen *intelScreen = intel_screen(sPriv); // intelUnmapScreenRegions(intelScreen); diff --git a/src/mesa/drivers/dri/intel_winsys/intel_screen.h b/src/mesa/drivers/dri/intel_winsys/intel_screen.h index aab745ea4d8..b0d1e8e36ad 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_screen.h +++ b/src/mesa/drivers/dri/intel_winsys/intel_screen.h @@ -33,6 +33,8 @@ #include "xmlconfig.h" #include "dri_bufpool.h" +#include "pipe/p_compiler.h" + struct intel_screen { @@ -70,7 +72,15 @@ struct intel_screen struct intel_context *dummyctxptr; }; -typedef struct intel_screen intelScreenPrivate; + + +/** cast wrapper */ +static INLINE struct intel_screen * +intel_screen(__DRIscreenPrivate *sPriv) +{ + return (struct intel_screen *) sPriv->private; +} + extern void intelUpdateScreenRotation(__DRIscreenPrivate * sPriv, drmI830Sarea * sarea); diff --git a/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c b/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c index 72ddfec40ed..f3bbbe874d0 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_swapbuffers.c @@ -41,7 +41,7 @@ /** XXX temporary - want to get rid of this */ static struct intel_context * -intelScreenContext(intelScreenPrivate *intelScreen) +intelScreenContext(struct intel_screen *intelScreen) { /* * This should probably change to have the screen allocate a dummy @@ -77,8 +77,7 @@ intelDisplaySurface(__DRIdrawablePrivate *dPriv, const drm_clip_rect_t *rect) { struct intel_context *intel; - const intelScreenPrivate *intelScreen - = (intelScreenPrivate *) dPriv->driScreenPriv->private; + const struct intel_screen *intelScreen = intel_screen(dPriv->driScreenPriv); DBG(SWAP, "%s\n", __FUNCTION__);