diff options
author | Michel Dänzer <daenzer@vmware.com> | 2009-07-18 22:23:45 +0200 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2009-07-18 22:23:45 +0200 |
commit | e38305aebdc95f80f5b4b3e5ba541ea67dc05f01 (patch) | |
tree | 48db8522ebfd9d6559f31da149778ca846d08f9d /src/radeon_kms.c | |
parent | a43c660a00147bfae5ca601f4720b2680b75211f (diff) |
Also drop DRM master in KMS CloseScreen.
The LeaveVT hook isn't always called when the server dies, e.g. when quitting
from the GDM greeter. This may cause existing servers to fall over if the dying
server process still exists when they try to re-acquire master and set a mode.
Also use drmSet/DropMaster() rather than ioctl() directly.
Diffstat (limited to 'src/radeon_kms.c')
-rw-r--r-- | src/radeon_kms.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/radeon_kms.c b/src/radeon_kms.c index 59a654f7..8a14f881 100644 --- a/src/radeon_kms.c +++ b/src/radeon_kms.c @@ -498,6 +498,8 @@ static Bool RADEONCloseScreen_KMS(int scrnIndex, ScreenPtr pScreen) info->accel_state->exa = NULL; } + drmDropMaster(info->dri->drmFD); + if (info->cursor) xf86DestroyCursorInfoRec(info->cursor); info->cursor = NULL; @@ -735,8 +737,8 @@ Bool RADEONEnterVT_KMS(int scrnIndex, int flags) "RADEONEnterVT_KMS\n"); - ret = ioctl(info->dri->drmFD, DRM_IOCTL_SET_MASTER, NULL); - if (ret == -EINVAL) + ret = drmSetMaster(info->dri->drmFD); + if (ret) ErrorF("Unable to retrieve master\n"); info->accel_state->XInited3D = FALSE; @@ -762,7 +764,7 @@ void RADEONLeaveVT_KMS(int scrnIndex, int flags) xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG, "RADEONLeaveVT_KMS\n"); - ioctl(info->dri->drmFD, DRM_IOCTL_DROP_MASTER, NULL); + drmDropMaster(info->dri->drmFD); #ifdef HAVE_FREE_SHADOW xf86RotateFreeShadow(pScrn); |