Commit adf3761f authored by Brian's avatar Brian

remove intelScreenPrivate typedef and use cast wrapper function to be like...

remove intelScreenPrivate typedef and use cast wrapper function to be like intel_context and intel_framebuffer
parent 736baf22
......@@ -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;
......
......@@ -71,7 +71,7 @@ struct intel_context
__DRIdrawablePrivate *driDrawable;
__DRIscreenPrivate *driScreen;
intelScreenPrivate *intelScreen;
struct intel_screen *intelScreen;
drmI830Sarea *sarea;
GLuint lastStamp;
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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__);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment