GLX: Adjust to changes in DRI driver interface.
This commit is contained in:
		
							parent
							
								
									d04ea267a4
								
							
						
					
					
						commit
						13bfa5937d
					
				| 
						 | 
				
			
			@ -828,18 +828,38 @@ static void __glXReportDamage(__DRIdrawable *driDraw,
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
/* Table of functions that we export to the driver. */
 | 
			
		||||
static const __DRIinterfaceMethods interface_methods = {
 | 
			
		||||
static const __DRIcontextModesExtension contextModesExtension = {
 | 
			
		||||
    { __DRI_CONTEXT_MODES, __DRI_CONTEXT_MODES_VERSION },
 | 
			
		||||
    _gl_context_modes_create,
 | 
			
		||||
    _gl_context_modes_destroy,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
    getDrawableInfo,
 | 
			
		||||
 | 
			
		||||
static const __DRIsystemTimeExtension systemTimeExtension = {
 | 
			
		||||
    { __DRI_SYSTEM_TIME, __DRI_SYSTEM_TIME_VERSION },
 | 
			
		||||
    getUST,
 | 
			
		||||
    NULL, /* glXGetMscRateOML, */
 | 
			
		||||
    NULL,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static const __DRIgetDrawableInfoExtension getDrawableInfoExtension = {
 | 
			
		||||
    { __DRI_GET_DRAWABLE_INFO, __DRI_GET_DRAWABLE_INFO_VERSION },
 | 
			
		||||
    getDrawableInfo
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static const __DRIdamageExtension damageExtension = {
 | 
			
		||||
    { __DRI_DAMAGE, __DRI_DAMAGE_VERSION },
 | 
			
		||||
    __glXReportDamage,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static const __DRIextension *loader_extensions[] = {
 | 
			
		||||
    &contextModesExtension.base,
 | 
			
		||||
    &systemTimeExtension.base,
 | 
			
		||||
    &getDrawableInfoExtension.base,
 | 
			
		||||
    &damageExtension.base,
 | 
			
		||||
    NULL
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static const char dri_driver_path[] = DRI_DRIVER_PATH;
 | 
			
		||||
 | 
			
		||||
static Bool
 | 
			
		||||
| 
						 | 
				
			
			@ -926,7 +946,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 | 
			
		|||
    __DRIframebuffer  framebuffer;
 | 
			
		||||
    int   fd = -1;
 | 
			
		||||
    int   status;
 | 
			
		||||
    int api_ver = 20070121;
 | 
			
		||||
    drm_magic_t magic;
 | 
			
		||||
    drmVersionPtr version;
 | 
			
		||||
    int newlyopened;
 | 
			
		||||
| 
						 | 
				
			
			@ -1091,8 +1110,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 | 
			
		|||
			   &framebuffer,
 | 
			
		||||
			   pSAREA,
 | 
			
		||||
			   fd,
 | 
			
		||||
			   api_ver,
 | 
			
		||||
			   &interface_methods,
 | 
			
		||||
			   loader_extensions,
 | 
			
		||||
			   &screen->base.fbconfigs);
 | 
			
		||||
 | 
			
		||||
    if (screen->driScreen.private == NULL) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -414,18 +414,30 @@ static void __glXReportDamage(__DRIdrawable *driDraw,
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
/* Table of functions that we export to the driver. */
 | 
			
		||||
static const __DRIinterfaceMethods interface_methods = {
 | 
			
		||||
static const __DRIcontextModesExtension contextModesExtension = {
 | 
			
		||||
    { __DRI_CONTEXT_MODES, __DRI_CONTEXT_MODES_VERSION },
 | 
			
		||||
    _gl_context_modes_create,
 | 
			
		||||
    _gl_context_modes_destroy,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
    NULL,
 | 
			
		||||
 | 
			
		||||
static const __DRIsystemTimeExtension systemTimeExtension = {
 | 
			
		||||
    { __DRI_SYSTEM_TIME, __DRI_SYSTEM_TIME_VERSION },
 | 
			
		||||
    getUST,
 | 
			
		||||
    NULL,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static const __DRIdamageExtension damageExtension = {
 | 
			
		||||
    { __DRI_DAMAGE, __DRI_DAMAGE_VERSION },
 | 
			
		||||
    __glXReportDamage,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static const __DRIextension *loader_extensions[] = {
 | 
			
		||||
    &contextModesExtension.base,
 | 
			
		||||
    &systemTimeExtension.base,
 | 
			
		||||
    &damageExtension.base,
 | 
			
		||||
    NULL
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static const char dri_driver_path[] = DRI_DRIVER_PATH;
 | 
			
		||||
 | 
			
		||||
static Bool
 | 
			
		||||
| 
						 | 
				
			
			@ -502,10 +514,6 @@ static __GLXscreen *
 | 
			
		|||
__glXDRIscreenProbe(ScreenPtr pScreen)
 | 
			
		||||
{
 | 
			
		||||
    __DRI2_CREATE_NEW_SCREEN_FUNC *createNewScreen;
 | 
			
		||||
    __DRIversion   ddx_version;
 | 
			
		||||
    __DRIversion   dri_version;
 | 
			
		||||
    __DRIversion   drm_version;
 | 
			
		||||
    drmVersionPtr version;
 | 
			
		||||
    const char *driverName;
 | 
			
		||||
    __GLXDRIscreen *screen;
 | 
			
		||||
    char filename[128];
 | 
			
		||||
| 
						 | 
				
			
			@ -522,9 +530,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 | 
			
		|||
	!DRI2Connect(pScreen,
 | 
			
		||||
		     &screen->fd,
 | 
			
		||||
		     &driverName,
 | 
			
		||||
		     &ddx_version.major,
 | 
			
		||||
		     &ddx_version.minor,
 | 
			
		||||
		     &ddx_version.patch,
 | 
			
		||||
		     &sareaHandle)) {
 | 
			
		||||
	LogMessage(X_INFO,
 | 
			
		||||
		   "AIGLX: Screen %d is not DRI2 capable\n", pScreen->myNum);
 | 
			
		||||
| 
						 | 
				
			
			@ -539,24 +544,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 | 
			
		|||
 | 
			
		||||
    __glXInitExtensionEnableBits(screen->glx_enable_bits);
 | 
			
		||||
 | 
			
		||||
    /* DRI protocol version. */
 | 
			
		||||
    dri_version.major = XF86DRI_MAJOR_VERSION;
 | 
			
		||||
    dri_version.minor = XF86DRI_MINOR_VERSION;
 | 
			
		||||
    dri_version.patch = XF86DRI_PATCH_VERSION;
 | 
			
		||||
 | 
			
		||||
    version = drmGetVersion(screen->fd);
 | 
			
		||||
    if (version) {
 | 
			
		||||
	drm_version.major = version->version_major;
 | 
			
		||||
	drm_version.minor = version->version_minor;
 | 
			
		||||
	drm_version.patch = version->version_patchlevel;
 | 
			
		||||
	drmFreeVersion(version);
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
	drm_version.major = -1;
 | 
			
		||||
	drm_version.minor = -1;
 | 
			
		||||
	drm_version.patch = -1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    snprintf(filename, sizeof filename, "%s/%s_dri.so",
 | 
			
		||||
             dri_driver_path, driverName);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -577,12 +564,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 | 
			
		|||
    screen->driScreen.private =
 | 
			
		||||
	(*createNewScreen)(pScreen->myNum,
 | 
			
		||||
			   &screen->driScreen,
 | 
			
		||||
			   &ddx_version,
 | 
			
		||||
			   &dri_version,
 | 
			
		||||
			   &drm_version,
 | 
			
		||||
			   screen->fd,
 | 
			
		||||
			   sareaHandle,
 | 
			
		||||
			   &interface_methods,
 | 
			
		||||
			   loader_extensions,
 | 
			
		||||
			   &screen->base.fbconfigs);
 | 
			
		||||
 | 
			
		||||
    if (screen->driScreen.private == NULL) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -58,9 +58,6 @@ typedef struct _DRI2Screen {
 | 
			
		|||
    void			*sarea;
 | 
			
		||||
    unsigned int		 sareaSize;
 | 
			
		||||
    const char			*driverName;
 | 
			
		||||
    int				 ddxVersionMajor;
 | 
			
		||||
    int				 ddxVersionMinor;
 | 
			
		||||
    int				 ddxVersionPatch;
 | 
			
		||||
 | 
			
		||||
    __DRIEventBuffer		*buffer;
 | 
			
		||||
    int				 locked;
 | 
			
		||||
| 
						 | 
				
			
			@ -330,7 +327,6 @@ DRI2DestroyDrawable(ScreenPtr pScreen, DrawablePtr pDraw)
 | 
			
		|||
 | 
			
		||||
Bool
 | 
			
		||||
DRI2Connect(ScreenPtr pScreen, int *fd, const char **driverName,
 | 
			
		||||
	    int *ddxMajor, int *ddxMinor, int *ddxPatch,
 | 
			
		||||
	    unsigned int *sareaHandle)
 | 
			
		||||
{
 | 
			
		||||
    DRI2ScreenPtr ds = DRI2GetScreen(pScreen);
 | 
			
		||||
| 
						 | 
				
			
			@ -340,9 +336,6 @@ DRI2Connect(ScreenPtr pScreen, int *fd, const char **driverName,
 | 
			
		|||
 | 
			
		||||
    *fd = ds->fd;
 | 
			
		||||
    *driverName = ds->driverName;
 | 
			
		||||
    *ddxMajor = ds->ddxVersionMajor;
 | 
			
		||||
    *ddxMinor = ds->ddxVersionMinor;
 | 
			
		||||
    *ddxPatch = ds->ddxVersionPatch;
 | 
			
		||||
    *sareaHandle = ds->sareaBO.handle;
 | 
			
		||||
 | 
			
		||||
    return TRUE;
 | 
			
		||||
| 
						 | 
				
			
			@ -406,9 +399,6 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
 | 
			
		|||
 | 
			
		||||
    ds->fd = info->fd;
 | 
			
		||||
    ds->driverName		= info->driverName;
 | 
			
		||||
    ds->ddxVersionMajor		= info->ddxVersionMajor;
 | 
			
		||||
    ds->ddxVersionMinor		= info->ddxVersionMinor;
 | 
			
		||||
    ds->ddxVersionPatch		= info->ddxVersionPatch;
 | 
			
		||||
 | 
			
		||||
    ds->getPixmapHandle		= info->getPixmapHandle;
 | 
			
		||||
    ds->beginClipNotify		= info->beginClipNotify;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -43,7 +43,6 @@ typedef struct {
 | 
			
		|||
    int fd;
 | 
			
		||||
    size_t driverSareaSize;
 | 
			
		||||
    const char *driverName;
 | 
			
		||||
    int ddxVersionMajor, ddxVersionMinor, ddxVersionPatch;
 | 
			
		||||
    DRI2GetPixmapHandleProcPtr getPixmapHandle;
 | 
			
		||||
    DRI2BeginClipNotifyProcPtr beginClipNotify;
 | 
			
		||||
    DRI2EndClipNotifyProcPtr endClipNotify;
 | 
			
		||||
| 
						 | 
				
			
			@ -57,9 +56,6 @@ void DRI2CloseScreen(ScreenPtr pScreen);
 | 
			
		|||
Bool DRI2Connect(ScreenPtr pScreen,
 | 
			
		||||
		 int *fd,
 | 
			
		||||
		 const char **driverName,
 | 
			
		||||
		 int *ddxMajor,
 | 
			
		||||
		 int *ddxMinor,
 | 
			
		||||
		 int *ddxPatch,
 | 
			
		||||
		 unsigned int *sareaHandle);
 | 
			
		||||
 | 
			
		||||
unsigned int DRI2GetPixmapHandle(PixmapPtr pPixmap,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue