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