fix server recycling
This commit is contained in:
parent
7847321138
commit
a4f6e661b5
|
@ -570,31 +570,17 @@ ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||||
unsigned long sys_mem;
|
unsigned long sys_mem;
|
||||||
int c;
|
int c;
|
||||||
MessageType from;
|
MessageType from;
|
||||||
|
int ret;
|
||||||
|
|
||||||
/* deal with server regeneration */
|
ErrorF("ms is %p\n", ms);
|
||||||
if (ms->fd < 0) {
|
|
||||||
char *BusID;
|
|
||||||
|
|
||||||
BusID = malloc(64);
|
|
||||||
sprintf(BusID, "PCI:%d:%d:%d",
|
|
||||||
#if XSERVER_LIBPCIACCESS
|
|
||||||
((ms->PciInfo->domain << 8) | ms->PciInfo->bus),
|
|
||||||
ms->PciInfo->dev, ms->PciInfo->func
|
|
||||||
#else
|
|
||||||
((pciConfigPtr) ms->PciInfo->thisCard)->busnum,
|
|
||||||
((pciConfigPtr) ms->PciInfo->thisCard)->devnum,
|
|
||||||
((pciConfigPtr) ms->PciInfo->thisCard)->funcnum
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
|
|
||||||
ms->fd = drmOpen(NULL, BusID);
|
|
||||||
|
|
||||||
if (ms->fd < 0)
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
pScrn->pScreen = pScreen;
|
pScrn->pScreen = pScreen;
|
||||||
|
|
||||||
|
ret = drmSetMaster(ms->fd);
|
||||||
|
if (ret) {
|
||||||
|
ErrorF("Unable to set master\n");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* HW dependent - FIXME */
|
/* HW dependent - FIXME */
|
||||||
pScrn->displayWidth = pScrn->virtualX;
|
pScrn->displayWidth = pScrn->virtualX;
|
||||||
if (!drmmode_create_initial_bos(pScrn, &ms->drmmode))
|
if (!drmmode_create_initial_bos(pScrn, &ms->drmmode))
|
||||||
|
@ -716,7 +702,9 @@ EnterVT(int scrnIndex, int flags)
|
||||||
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
|
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
|
||||||
modesettingPtr ms = modesettingPTR(pScrn);
|
modesettingPtr ms = modesettingPTR(pScrn);
|
||||||
|
|
||||||
if (!xf86SetDesiredModes(pScrn))
|
pScrn->vtSema = TRUE;
|
||||||
|
|
||||||
|
if (!drmmode_set_desired_modes(pScrn, &ms->drmmode))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -752,8 +740,8 @@ CloseScreen(int scrnIndex, ScreenPtr pScreen)
|
||||||
|
|
||||||
pScreen->CreateScreenResources = ms->createScreenResources;
|
pScreen->CreateScreenResources = ms->createScreenResources;
|
||||||
pScreen->BlockHandler = ms->BlockHandler;
|
pScreen->BlockHandler = ms->BlockHandler;
|
||||||
drmClose(ms->fd);
|
|
||||||
ms->fd = -1;
|
drmDropMaster(ms->fd);
|
||||||
|
|
||||||
pScrn->vtSema = FALSE;
|
pScrn->vtSema = FALSE;
|
||||||
pScreen->CloseScreen = ms->CloseScreen;
|
pScreen->CloseScreen = ms->CloseScreen;
|
||||||
|
|
|
@ -1329,6 +1329,12 @@ void drmmode_free_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
|
||||||
{
|
{
|
||||||
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
|
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (drmmode->fb_id) {
|
||||||
|
drmModeRmFB(drmmode->fd, drmmode->fb_id);
|
||||||
|
drmmode->fb_id = 0;
|
||||||
|
}
|
||||||
|
|
||||||
dumb_bo_destroy(drmmode->fd, drmmode->front_bo);
|
dumb_bo_destroy(drmmode->fd, drmmode->front_bo);
|
||||||
drmmode->front_bo = NULL;
|
drmmode->front_bo = NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue