xf86-video-ati: Branch 'master'
Maarten Lankhorst
mlankhorst at kemper.freedesktop.org
Thu Mar 21 02:48:11 PDT 2013
src/radeon_kms.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
New commits:
commit 751c7259cf23a29fdd2653881e2db63ce3cf1ca5
Author: Maarten Lankhorst <maarten.lankhorst at canonical.com>
Date: Thu Mar 21 10:40:42 2013 +0100
Move fd cleanup to correct place.
Oops, just after previous commit I realized that it
needs to be done from RADEONFreeRec, because when preinit fails
info pointer can be null in FreeScreen.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst at canonical.com>
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index 763acd0..e4f586c 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;
More information about the xorg-commit
mailing list