mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 14:00:03 +01:00
fix stale dri2 build
This commit is contained in:
parent
40b3d2972d
commit
b84acf6410
5 changed files with 28 additions and 21 deletions
|
|
@ -471,7 +471,8 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
|
||||||
char filename[128];
|
char filename[128];
|
||||||
size_t buffer_size;
|
size_t buffer_size;
|
||||||
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
||||||
unsigned int sareaHandle;
|
drm_handle_t sareaHandle;
|
||||||
|
unsigned int sareaSize;
|
||||||
const __DRIextension **extensions;
|
const __DRIextension **extensions;
|
||||||
const __DRIconfig **driConfigs;
|
const __DRIconfig **driConfigs;
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -482,7 +483,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
|
||||||
memset(screen, 0, sizeof *screen);
|
memset(screen, 0, sizeof *screen);
|
||||||
|
|
||||||
if (!xf86LoaderCheckSymbol("DRI2Connect") ||
|
if (!xf86LoaderCheckSymbol("DRI2Connect") ||
|
||||||
!DRI2Connect(pScreen, &screen->fd, &driverName, &sareaHandle)) {
|
!DRI2Connect(pScreen, &screen->fd, &driverName, &sareaHandle, &sareaSize)) {
|
||||||
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);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
@ -530,6 +531,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
|
||||||
(*screen->core->createNewScreen)(pScreen->myNum,
|
(*screen->core->createNewScreen)(pScreen->myNum,
|
||||||
screen->fd,
|
screen->fd,
|
||||||
sareaHandle,
|
sareaHandle,
|
||||||
|
sareaSize,
|
||||||
loader_extensions,
|
loader_extensions,
|
||||||
&driConfigs,
|
&driConfigs,
|
||||||
screen);
|
screen);
|
||||||
|
|
|
||||||
|
|
@ -57,8 +57,8 @@ typedef struct _DRI2DrawablePriv {
|
||||||
|
|
||||||
typedef struct _DRI2Screen {
|
typedef struct _DRI2Screen {
|
||||||
int fd;
|
int fd;
|
||||||
drmBO sareaBO;
|
|
||||||
void *sarea;
|
void *sarea;
|
||||||
|
drm_handle_t sareaHandle;
|
||||||
unsigned int sareaSize;
|
unsigned int sareaSize;
|
||||||
const char *driverName;
|
const char *driverName;
|
||||||
unsigned int nextHandle;
|
unsigned int nextHandle;
|
||||||
|
|
@ -257,8 +257,7 @@ DRI2CloseScreen(ScreenPtr pScreen)
|
||||||
pScreen->ClipNotify = ds->ClipNotify;
|
pScreen->ClipNotify = ds->ClipNotify;
|
||||||
pScreen->HandleExposures = ds->HandleExposures;
|
pScreen->HandleExposures = ds->HandleExposures;
|
||||||
|
|
||||||
drmBOUnmap(ds->fd, &ds->sareaBO);
|
drmRmMap(ds->fd, ds->sareaHandle);
|
||||||
drmBOUnreference(ds->fd, &ds->sareaBO);
|
|
||||||
|
|
||||||
xfree(ds);
|
xfree(ds);
|
||||||
dixSetPrivate(&pScreen->devPrivates, dri2ScreenPrivateKey, NULL);
|
dixSetPrivate(&pScreen->devPrivates, dri2ScreenPrivateKey, NULL);
|
||||||
|
|
@ -350,7 +349,8 @@ DRI2ReemitDrawableInfo(DrawablePtr pDraw, unsigned int *head)
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
DRI2Connect(ScreenPtr pScreen, int *fd, const char **driverName,
|
DRI2Connect(ScreenPtr pScreen, int *fd, const char **driverName,
|
||||||
unsigned int *sareaHandle)
|
drm_handle_t *sareaHandle,
|
||||||
|
drmSize *sareaSize)
|
||||||
{
|
{
|
||||||
DRI2ScreenPtr ds = DRI2GetScreen(pScreen);
|
DRI2ScreenPtr ds = DRI2GetScreen(pScreen);
|
||||||
|
|
||||||
|
|
@ -359,7 +359,8 @@ DRI2Connect(ScreenPtr pScreen, int *fd, const char **driverName,
|
||||||
|
|
||||||
*fd = ds->fd;
|
*fd = ds->fd;
|
||||||
*driverName = ds->driverName;
|
*driverName = ds->driverName;
|
||||||
*sareaHandle = ds->sareaBO.handle;
|
*sareaHandle = ds->sareaHandle;
|
||||||
|
*sareaSize = ds->sareaSize;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
@ -387,7 +388,7 @@ static void *
|
||||||
DRI2SetupSAREA(ScreenPtr pScreen, size_t driverSareaSize)
|
DRI2SetupSAREA(ScreenPtr pScreen, size_t driverSareaSize)
|
||||||
{
|
{
|
||||||
DRI2ScreenPtr ds = DRI2GetScreen(pScreen);
|
DRI2ScreenPtr ds = DRI2GetScreen(pScreen);
|
||||||
unsigned long mask;
|
|
||||||
const size_t event_buffer_size = 32 * 1024;
|
const size_t event_buffer_size = 32 * 1024;
|
||||||
|
|
||||||
ds->sareaSize =
|
ds->sareaSize =
|
||||||
|
|
@ -395,21 +396,18 @@ DRI2SetupSAREA(ScreenPtr pScreen, size_t driverSareaSize)
|
||||||
driverSareaSize +
|
driverSareaSize +
|
||||||
sizeof (unsigned int);
|
sizeof (unsigned int);
|
||||||
|
|
||||||
mask = DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE | DRM_BO_FLAG_MAPPABLE |
|
if (drmAddMap(ds->fd, 1, ds->sareaSize, DRM_SHM,
|
||||||
DRM_BO_FLAG_MEM_LOCAL | DRM_BO_FLAG_SHAREABLE;
|
DRM_CONTAINS_LOCK, &ds->sareaHandle) != 0)
|
||||||
|
|
||||||
if (drmBOCreate(ds->fd, ds->sareaSize, 1, NULL, mask, 0, &ds->sareaBO))
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (drmBOMap(ds->fd, &ds->sareaBO,
|
if (drmMap(ds->fd, ds->sareaHandle, ds->sareaSize, &ds->sarea)) {
|
||||||
DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE, 0, &ds->sarea)) {
|
drmRmMap (ds->fd, ds->sareaHandle);
|
||||||
drmBOUnreference(ds->fd, &ds->sareaBO);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
xf86DrvMsg(pScreen->myNum, X_INFO,
|
xf86DrvMsg(pScreen->myNum, X_INFO,
|
||||||
"[DRI2] Allocated %d byte SAREA, BO handle 0x%08x\n",
|
"[DRI2] Allocated %d byte SAREA, handle 0x%08x\n",
|
||||||
ds->sareaSize, ds->sareaBO.handle);
|
ds->sareaSize, ds->sareaHandle);
|
||||||
memset(ds->sarea, 0, ds->sareaSize);
|
memset(ds->sarea, 0, ds->sareaSize);
|
||||||
|
|
||||||
ds->buffer = ds->sarea;
|
ds->buffer = ds->sarea;
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,8 @@ void DRI2CloseScreen(ScreenPtr pScreen);
|
||||||
Bool DRI2Connect(ScreenPtr pScreen,
|
Bool DRI2Connect(ScreenPtr pScreen,
|
||||||
int *fd,
|
int *fd,
|
||||||
const char **driverName,
|
const char **driverName,
|
||||||
unsigned int *sareaHandle);
|
drm_handle_t *sareaHandle,
|
||||||
|
drmSize *sareaSize);
|
||||||
|
|
||||||
Bool DRI2AuthConnection(ScreenPtr pScreen, drm_magic_t magic);
|
Bool DRI2AuthConnection(ScreenPtr pScreen, drm_magic_t magic);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,8 @@ ProcDRI2Connect(ClientPtr client)
|
||||||
int fd;
|
int fd;
|
||||||
const char *driverName;
|
const char *driverName;
|
||||||
char *busId = NULL;
|
char *busId = NULL;
|
||||||
unsigned int sareaHandle;
|
drm_handle_t sareaHandle;
|
||||||
|
unsigned int sareaSize;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xDRI2ConnectReq);
|
REQUEST_SIZE_MATCH(xDRI2ConnectReq);
|
||||||
if (!validScreen(client, stuff->screen, &pScreen))
|
if (!validScreen(client, stuff->screen, &pScreen))
|
||||||
|
|
@ -127,8 +128,9 @@ ProcDRI2Connect(ClientPtr client)
|
||||||
rep.driverNameLength = 0;
|
rep.driverNameLength = 0;
|
||||||
rep.busIdLength = 0;
|
rep.busIdLength = 0;
|
||||||
rep.sareaHandle = 0;
|
rep.sareaHandle = 0;
|
||||||
|
rep.sareaSize = 0;
|
||||||
|
|
||||||
if (!DRI2Connect(pScreen, &fd, &driverName, &sareaHandle))
|
if (!DRI2Connect(pScreen, &fd, &driverName, &sareaHandle, &sareaSize))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
busId = drmGetBusid(fd);
|
busId = drmGetBusid(fd);
|
||||||
|
|
@ -137,7 +139,8 @@ ProcDRI2Connect(ClientPtr client)
|
||||||
|
|
||||||
rep.driverNameLength = strlen(driverName);
|
rep.driverNameLength = strlen(driverName);
|
||||||
rep.busIdLength = strlen(busId);
|
rep.busIdLength = strlen(busId);
|
||||||
rep.sareaHandle = sareaHandle;
|
rep.sareaHandle = (CARD32) sareaHandle;
|
||||||
|
rep.sareaSize = (CARD32) sareaSize;
|
||||||
rep.length = (rep.driverNameLength + 3) / 4 + (rep.busIdLength + 3) / 4;
|
rep.length = (rep.driverNameLength + 3) / 4 + (rep.busIdLength + 3) / 4;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
|
|
|
||||||
|
|
@ -320,6 +320,9 @@ ProcRRCreateMode (ClientPtr client)
|
||||||
swapl(&rep.mode, n);
|
swapl(&rep.mode, n);
|
||||||
}
|
}
|
||||||
WriteToClient(client, sizeof(xRRCreateModeReply), (char *)&rep);
|
WriteToClient(client, sizeof(xRRCreateModeReply), (char *)&rep);
|
||||||
|
|
||||||
|
/* Drop our reference to this mode */
|
||||||
|
RRModeDestroy (mode);
|
||||||
|
|
||||||
return client->noClientException;
|
return client->noClientException;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue