From owner-freebsd-bugs@FreeBSD.ORG Sat Jul 28 06:20:09 2007 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BBF916A417 for ; Sat, 28 Jul 2007 06:20:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 681D013C457 for ; Sat, 28 Jul 2007 06:20:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l6S6K98o036733 for ; Sat, 28 Jul 2007 06:20:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l6S6K9jo036729; Sat, 28 Jul 2007 06:20:09 GMT (envelope-from gnats) Date: Sat, 28 Jul 2007 06:20:09 GMT Message-Id: <200707280620.l6S6K9jo036729@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: vehemens Cc: Subject: Re: kern/114688: [drm] RADEON/AIGLX/DRM Problem X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vehemens List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2007 06:20:09 -0000 The following reply was made to PR kern/114688; it has been noted by GNATS. From: vehemens To: bug-followup@freebsd.org, vehemens@verizon.net Cc: Subject: Re: kern/114688: [drm] RADEON/AIGLX/DRM Problem Date: Fri, 27 Jul 2007 23:16:45 -0700 There is now a driver patch that provides a reasonable workaround for the drm locking problem. It was provided by Kostik Belousov and appears below. Refer to his email for his comments on the patch. I have verified that it works. In addition, I no longer have xserver exit hangs. Note 1) This patch was not the only change I made to get aiglx with beryl running on my system. I have updated my 7.0 current system with the development branch of 1) xserver which required pixman as well as mesa, inputproto, keyboard and mouse driver updates, 2) ati driver, 3) drm driver with patches, and 4) misc xorg updates (both released and unreleased) not yet in the ports. Note 2) I still get a white screen when I restart the xserver and beryl without rebooting. I do not know if this problem with drm core, drm radeon, or something else. diff --git a/sys/dev/drm/drm_drv.c b/sys/dev/drm/drm_drv.c index dda03c1..b7c9ab9 100644 --- a/sys/dev/drm/drm_drv.c +++ b/sys/dev/drm/drm_drv.c @@ -711,6 +711,15 @@ int drm_close(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) return EINVAL; } + atomic_inc( &dev->counts[_DRM_STAT_CLOSES] ); +#ifdef __FreeBSD__ + device_unbusy(dev->device); +#endif + if (--dev->open_count != 0) { + DRM_UNLOCK(); + return (0); + } + if (dev->driver.preclose != NULL) dev->driver.preclose(dev, filp); @@ -797,13 +806,8 @@ int drm_close(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) * End inline drm_release */ - atomic_inc( &dev->counts[_DRM_STAT_CLOSES] ); -#ifdef __FreeBSD__ - device_unbusy(dev->device); -#endif - if (--dev->open_count == 0) { - retcode = drm_lastclose(dev); - } + + retcode = drm_lastclose(dev); DRM_UNLOCK();