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