diff options
Diffstat (limited to 'src/radeon_kms.c')
-rw-r--r-- | src/radeon_kms.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/radeon_kms.c b/src/radeon_kms.c index 763acd0d..e4f586c3 100644 --- a/src/radeon_kms.c +++ b/src/radeon_kms.c @@ -174,6 +174,20 @@ static void RADEONFreeRec(ScrnInfoPtr pScrn) info = RADEONPTR(pScrn); + if (info->dri2.drm_fd > 0) { + DevUnion *pPriv; + RADEONEntPtr pRADEONEnt; + pPriv = xf86GetEntityPrivate(pScrn->entityList[0], + getRADEONEntityIndex()); + + pRADEONEnt = pPriv->ptr; + pRADEONEnt->fd_ref--; + if (!pRADEONEnt->fd_ref) { + drmClose(pRADEONEnt->fd); + pRADEONEnt->fd = 0; + } + } + if (info->accel_state) { free(info->accel_state); info->accel_state = NULL; @@ -1083,19 +1097,10 @@ void RADEONFreeScreen_KMS(FREE_SCREEN_ARGS_DECL) { SCRN_INFO_PTR(arg); RADEONInfoPtr info = RADEONPTR(pScrn); - RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn); xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG, "RADEONFreeScreen\n"); - if (info->dri2.drm_fd > 0) { - pRADEONEnt->fd_ref--; - if (!pRADEONEnt->fd_ref) { - drmClose(pRADEONEnt->fd); - pRADEONEnt->fd = 0; - } - } - /* when server quits at PreInit, we don't need do this anymore*/ if (!info) return; |