pdraw->driContextPriv = NULL;
pdraw->loaderPrivate = loaderPrivate;
- pdraw->hHWDrawable = 0;
pdraw->refcount = 1;
pdraw->pStamp = NULL;
pdraw->lastStamp = 0;
- pdraw->index = 0;
pdraw->w = 0;
pdraw->h = 0;
- pdraw->vblSeq = 0;
- pdraw->vblFlags = 0;
-
pdraw->driScreenPriv = screen;
if (!(*screen->DriverAPI.CreateBuffer)(screen, pdraw, &config->modes, 0)) {
return NULL;
}
- pdraw->msc_base = 0;
-
- /* This special default value is replaced with the configured
- * default value when the drawable is first bound to a direct
- * rendering context.
- */
- pdraw->swap_interval = (unsigned)-1;
-
pdraw->pStamp = &pdraw->dri2.stamp;
*pdraw->pStamp = pdraw->lastStamp + 1;
if (psp->DriverAPI.DestroyScreen)
(*psp->DriverAPI.DestroyScreen)(psp);
- if (!psp->dri2.enabled) {
- (void)drmUnmap((drmAddress)psp->pSAREA, SAREA_MAX);
- (void)drmUnmap((drmAddress)psp->pFB, psp->fbSize);
- (void)drmCloseOnce(psp->fd);
- } else {
- driDestroyOptionCache(&psp->optionCache);
- driDestroyOptionInfo(&psp->optionInfo);
- }
+ driDestroyOptionCache(&psp->optionCache);
+ driDestroyOptionInfo(&psp->optionInfo);
free(psp);
}
int i;
for (i = 0; extensions[i]; i++) {
- if (strcmp(extensions[i]->name, __DRI_GET_DRAWABLE_INFO) == 0)
- psp->getDrawableInfo = (__DRIgetDrawableInfoExtension *) extensions[i];
- if (strcmp(extensions[i]->name, __DRI_DAMAGE) == 0)
- psp->damage = (__DRIdamageExtension *) extensions[i];
- if (strcmp(extensions[i]->name, __DRI_SYSTEM_TIME) == 0)
- psp->systemTime = (__DRIsystemTimeExtension *) extensions[i];
if (strcmp(extensions[i]->name, __DRI_DRI2_LOADER) == 0)
psp->dri2.loader = (__DRIdri2LoaderExtension *) extensions[i];
if (strcmp(extensions[i]->name, __DRI_IMAGE_LOOKUP) == 0)
* Per-drawable private DRI driver information.
*/
struct __DRIdrawableRec {
- /**
- * Kernel drawable handle
- */
- drm_drawable_t hHWDrawable;
-
/**
* Driver's private drawable information.
*
*/
int refcount;
- /**
- * Index of this drawable information in the SAREA.
- */
- unsigned int index;
-
/**
* Pointer to the "drawable has changed ID" stamp in the SAREA (or
* to dri2.stamp if DRI2 is being used).
int w, h;
- /**
- * \name Vertical blank tracking information
- * Used for waiting on vertical blank events.
- */
- /*@{*/
- unsigned int vblSeq;
- unsigned int vblFlags;
- /*@}*/
-
- /**
- * \name Monotonic MSC tracking
- *
- * Low level driver is responsible for updating msc_base and
- * vblSeq values so that higher level code can calculate
- * a new msc value or msc target for a WaitMSC call. The new value
- * will be:
- * msc = msc_base + get_vblank_count() - vblank_base;
- *
- * And for waiting on a value, core code will use:
- * actual_target = target_msc - msc_base + vblank_base;
- */
- /*@{*/
- int64_t vblank_base;
- int64_t msc_base;
- /*@}*/
-
/**
* Pointer to context to which this drawable is currently bound.
*/
*/
__DRIscreen *driScreenPriv;
- /**
- * Controls swap interval as used by GLX_SGI_swap_control and
- * GLX_MESA_swap_control.
- */
- unsigned int swap_interval;
-
struct {
unsigned int stamp;
} dri2;
* Per-context private driver information.
*/
struct __DRIcontextRec {
- /**
- * Kernel context handle used to access the device lock.
- */
- drm_context_t hHWContext;
-
/**
* Device driver's private context data. This structure is opaque.
*/
struct __DriverAPIRec DriverAPI;
const __DRIextension **extensions;
- /**
- * DDX / 2D driver version information.
- */
- __DRIversion ddx_version;
-
- /**
- * DRI X extension version information.
- */
- __DRIversion dri_version;
/**
* DRM (kernel module) version information.
*/
__DRIversion drm_version;
- /**
- * ID used when the client sets the drawable lock.
- *
- * The X server uses this value to detect if the client has died while
- * holding the drawable lock.
- */
- int drawLockID;
-
/**
* File descriptor returned when the kernel device driver is opened.
*
*/
int fd;
- /**
- * SAREA pointer
- *
- * Used to access:
- * - the device lock
- * - the device-independent per-drawable and per-context(?) information
- */
- drm_sarea_t *pSAREA;
-
- /**
- * \name Direct frame buffer access information
- * Used for software fallbacks.
- */
- /*@{*/
- unsigned char *pFB;
- int fbSize;
- int fbOrigin;
- int fbStride;
- int fbWidth;
- int fbHeight;
- int fbBPP;
- /*@}*/
-
- /**
- * \name Device-dependent private information (stored in the SAREA).
- *
- * This data is accessed by the client driver only.
- */
- /*@{*/
- void *pDevPriv;
- int devPrivSize;
- /*@}*/
-
/**
* Device-dependent private information (not stored in the SAREA).
*
void *private;
#endif
- /* Extensions provided by the loader. */
- const __DRIgetDrawableInfoExtension *getDrawableInfo;
- const __DRIsystemTimeExtension *systemTime;
- const __DRIdamageExtension *damage;
-
struct {
/* Flag to indicate that this is a DRI2 screen. Many of the above
* fields will not be valid or initializaed in that case. */
__DRIuseInvalidateExtension *useInvalidate;
} dri2;
- /* The lock actually in use, old sarea or DRI2 */
- drmLock *lock;
-
driOptionCache optionInfo;
driOptionCache optionCache;
unsigned int api_mask;