kern/112984: [drm] Xorg 7.2 locks up with AIGLX enabled on the r300 driver.

Stefan Sperling stsp at stsp.name
Sun Jul 15 12:10:13 UTC 2007


The following reply was made to PR kern/112984; it has been noted by GNATS.

From: Stefan Sperling <stsp at stsp.name>
To: bug-followup at freebsd.org, Adam K Kirchhoff <adamk at voicenet.com>
Cc:  
Subject: Re: kern/112984: [drm] Xorg 7.2 locks up with AIGLX enabled on the
	r300 driver.
Date: Sun, 15 Jul 2007 14:02:33 +0200

 --gatW/ieO32f1wygP
 Content-Type: multipart/mixed; boundary="LZvS9be/3tNcYl/X"
 Content-Disposition: inline
 
 
 --LZvS9be/3tNcYl/X
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 The hard lockup went away for me after applying the patches from
 http://docs.freebsd.org/cgi/getmsg.cgi?fetch=3D86381+0+archive/2006/freebsd=
 -x11/20061112.freebsd-x11
 linked from
 http://lists.freebsd.org/pipermail/freebsd-x11/2007-June/004571.html
 
 They did not apply at all on 6.2 but it was trivial to port them,
 see attachments.
 
 One patch is for the kernel (sys/dev/drm/).
 
 The other is for xorg-server, I put it into
 /usr/ports/x11-servers/xorg-server/files/patch-aiglxfix.diff
 and did "cd /usr/ports/x11-servers/xorg-server && make && make deinstall re=
 install"
 
 The only issues that still remain are:
 
 	* Minor graphic glitches (fuzzy grey lines across the screen)
 	in gdm which disappear once I log into gnome
 
 	* The fact that I'm apparently too stupid to start compiz
 	properly as my windows still have no decorations after:
 	env LIBGL_ALWAYS_INDIRECT=3D1 LIBGL_DEBUG=3Dverbose compiz --replace & # r=
 uns fine apparently
 	env LIBGL_ALWAYS_INDIRECT=3D1 LIBGL_DEBUG=3Dverbose gtk-window-decorator &=
  # does nothing???
 
 	* And the following lines occuring repeatedly in dmesg:
 
 error: [drm:pid1117:radeon_cp_indirect] *ERROR* radeon_cp_indirect called w=
 ithout lock held
 error: [drm:pid1117:radeon_cp_stop] *ERROR* radeon_cp_stop called without l=
 ock held
 error: [drm:pid1117:radeon_cp_init] *ERROR* radeon_cp_init called without l=
 ock held
 
 Again, this hasn't caused any lockups so far...
 
 The card I'm using is:
 
 drm0: <ATI Radeon AS 9550> port 0xb800-0xb8ff mem 0xc0000000-0xcfffffff,0xd=
 fef0000-0xdfefffff irq 16 at device 0.0 on pci1
 info: [drm] AGP at 0xe0000000 64MB
 info: [drm] Initialized radeon 1.24.0 20060225
 info: [drm] Setting GART location based on new memory map
 info: [drm] Loading R300 Microcode
 info: [drm] writeback test succeeded in 1 usecs
 
 --=20
 stefan
 http://stsp.name                                         PGP Key: 0xF59D25F0
 
 --LZvS9be/3tNcYl/X
 Content-Type: text/x-diff; charset=us-ascii
 Content-Disposition: attachment; filename="radeon-drm-aiglx-fix-6.2.diff"
 Content-Transfer-Encoding: quoted-printable
 
 Index: sys/dev/drm/radeon_cp.c
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 RCS file: /usr/ncvs/src/sys/dev/drm/radeon_cp.c,v
 retrieving revision 1.15.2.3
 diff -u -r1.15.2.3 radeon_cp.c
 --- sys/dev/drm/radeon_cp.c	17 May 2006 07:40:11 -0000	1.15.2.3
 +++ sys/dev/drm/radeon_cp.c	15 Jul 2007 09:00:08 -0000
 @@ -1928,8 +1928,6 @@
  	drm_radeon_private_t *dev_priv =3D dev->dev_private;
  	DRM_DEBUG("\n");
 =20
 -	LOCK_TEST_WITH_RETURN(dev, filp);
 -
  	return radeon_do_cp_idle(dev_priv);
  }
 =20
 @@ -1947,8 +1945,6 @@
  	DRM_DEVICE;
  	DRM_DEBUG("\n");
 =20
 -	LOCK_TEST_WITH_RETURN(dev, filp);
 -
  	return radeon_do_engine_reset(dev);
  }
 =20
 @@ -2141,8 +2137,6 @@
  	drm_dma_t __user *argp =3D (void __user *)data;
  	drm_dma_t d;
 =20
 -	LOCK_TEST_WITH_RETURN(dev, filp);
 -
  	DRM_COPY_FROM_USER_IOCTL(d, argp, sizeof(d));
 =20
  	/* Please don't send us buffers.
 Index: sys/dev/drm/radeon_state.c
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 RCS file: /usr/ncvs/src/sys/dev/drm/radeon_state.c,v
 retrieving revision 1.15.2.3
 diff -u -r1.15.2.3 radeon_state.c
 --- sys/dev/drm/radeon_state.c	17 May 2006 07:40:11 -0000	1.15.2.3
 +++ sys/dev/drm/radeon_state.c	15 Jul 2007 09:06:32 -0000
 @@ -2452,8 +2452,6 @@
  	int i;
  	unsigned char laststate;
 =20
 -	LOCK_TEST_WITH_RETURN(dev, filp);
 -
  	if (!dev_priv) {
  		DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
  		return DRM_ERR(EINVAL);
 @@ -2774,6 +2772,7 @@
  	drm_radeon_cmd_header_t header;
  	int orig_nbox, orig_bufsz;
  	char *kbuf =3D NULL;
 +	RING_LOCALS;
 =20
  	LOCK_TEST_WITH_RETURN(dev, filp);
 =20
 @@ -2813,7 +2812,15 @@
  	}
 =20
  	orig_nbox =3D cmdbuf.nbox;
 -
 +=20
 +        /* Wait for the engine to idle before the indirect buffer
 +         * is processed.
 +         */
 +=20
 +        BEGIN_RING(2);
 +        RADEON_WAIT_UNTIL_IDLE();
 +        ADVANCE_RING();
 +=20
  	if (dev_priv->microcode_version =3D=3D UCODE_R300) {
  		int temp;
  		temp =3D r300_do_cp_cmdbuf(dev, filp, filp_priv, &cmdbuf);
 
 --LZvS9be/3tNcYl/X
 Content-Type: text/x-diff; charset=us-ascii
 Content-Disposition: attachment; filename="patch-aiglxfix.diff"
 Content-Transfer-Encoding: quoted-printable
 
 --- hw/xfree86/dri/dri.c.orig	Sun Jul 15 11:11:55 2007
 +++ hw/xfree86/dri/dri.c	Sun Jul 15 11:10:49 2007
 @@ -1603,8 +1603,12 @@
  	/* unwrap */
  	pScreen->WindowExposures =3D pDRIPriv->wrap.WindowExposures;
 =20
 +       DRILock(pScreen, 0);
 +
  	/* call lower layers */
  	(*pScreen->WindowExposures)(pWin, prgn, bsreg);
 +
 +       DRIUnlock(pScreen);
 =20
  	/* rewrap */
  	pDRIPriv->wrap.WindowExposures =3D pScreen->WindowExposures;
 
 --LZvS9be/3tNcYl/X--
 
 --gatW/ieO32f1wygP
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.7 (FreeBSD)
 
 iD8DBQFGmgzZ5dMCc/WdJfARAgDTAJ9qHqkGb6f2O3GDkEFDWhwMypPIfwCg5zrf
 JT/TrPejaHitkahoJiOrkBc=
 =d/74
 -----END PGP SIGNATURE-----
 
 --gatW/ieO32f1wygP--


More information about the freebsd-bugs mailing list