{
__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);
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",
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);
intelCreatePools(__DRIscreenPrivate * sPriv)
{
unsigned batchPoolSize = 1024*1024;
- intelScreenPrivate *intelScreen = sPriv->private;
+ struct intel_screen *intelScreen = intel_screen(sPriv);
if (intelScreen->havePools)
return GL_TRUE;
static GLboolean
intelInitDriver(__DRIscreenPrivate * sPriv)
{
- intelScreenPrivate *intelScreen;
+ struct intel_screen *intelScreen;
I830DRIPtr gDRIPriv = (I830DRIPtr) sPriv->pDevPriv;
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
}
/* Allocate the private area */
- intelScreen = (intelScreenPrivate *) CALLOC(sizeof(intelScreenPrivate));
+ intelScreen = CALLOC_STRUCT(intel_screen);
if (!intelScreen)
return GL_FALSE;
static void
intelDestroyScreen(__DRIscreenPrivate * sPriv)
{
- intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private;
+ struct intel_screen *intelScreen = intel_screen(sPriv);
// intelUnmapScreenRegions(intelScreen);
#include "xmlconfig.h"
#include "dri_bufpool.h"
+#include "pipe/p_compiler.h"
+
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);
/** 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
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__);