From nobody@FreeBSD.org  Tue Dec  5 11:35:26 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id F270416A415
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  5 Dec 2006 11:35:25 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 2BE5743CA3
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  5 Dec 2006 11:34:47 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id kB5BZPAf002558
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 5 Dec 2006 11:35:25 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id kB5BZPIN002557;
	Tue, 5 Dec 2006 11:35:25 GMT
	(envelope-from nobody)
Message-Id: <200612051135.kB5BZPIN002557@www.freebsd.org>
Date: Tue, 5 Dec 2006 11:35:25 GMT
From: Adam K Kirchhoff<adamk@voicenet.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Screen corruption when using Direct Rendering on a PCIe x800
X-Send-Pr-Version: www-3.0

>Number:         106370
>Category:       ports
>Synopsis:       Screen corruption when using Direct Rendering on a PCIe x800
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-x11
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 05 11:40:10 GMT 2006
>Closed-Date:    Thu Mar 19 13:17:57 UTC 2009
>Last-Modified:  Thu Mar 19 13:17:57 UTC 2009
>Originator:     Adam K Kirchhoff
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD sorrow.ashke.com 7.0-CURRENT FreeBSD 7.0-CURRENT #7: Tue Nov 14 08:33:41 EST 2006 root@sorrow.ashke.com:/usr/obj/usr/src/sys/GENERIC i386
>Description:
I'm having a problem getting direct rendering working on one of my 
workstations.  I'm running -CURRENT from November 17th with Xorg 
installed from the modular Xorg ports tree yesterday (though I first 
noticed this a couple weeks back when I built modular Xorg using jhbuild):

[ adamk@sorrow - ~ ]: Xorg -version

X Window System Version 7.1.1
Release Date: 12 May 2006
X Protocol Version 11, Revision 0, Release 7.1.1
Build Operating System: FreeBSD 7.0-CURRENT i386
Current Operating System: FreeBSD sorrow.ashke.com 7.0-CURRENT FreeBSD 
7.0-CURRENT #7: Tue Nov 14 08:33:41 EST 2006     
root@sorrow.ashke.com:/usr/obj/usr/src/sys/GENERIC i386
Build Date: 28 November 2006
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Module Loader present

If I boot up with DRI enabled in the config file, the server starts, but 
the very top of the screen shows some visual corruption. 


http://www.visualtech.com/screenshot.png

I dropped the resolution of the image from 2304x864 to 1600x800, but you 
can still make out the corruption.  What's particularly odd, though, is 
that the root window is never drawn.  The background you see is actually 
the background from my previous X session (when I had DRI disabled), 
using windowmaker.  This time I launched X and had fvwm2 in my .xinitrc 
file (you can see the outline of the fvwm pager in the screenshot, 
though that never finished drawing, either).

After that nothing else gets drawn.  I can move the mouse pointer, but 
that's about it.  I can safely kill X and restart it, but the same thing 
happens unless I disable DRI.

In comparison, I have another workstation with an AGP x700.  -CURRENT 
from the same date, and modular Xorg from the ports tree from yesterday, 
too.  It works just fine (start up fine, and the mesa demos run with 
acceleration). 

You can find the Xorg log file from the PCIe system at 
http://www.visualtech.com/Xorg.0.log.gz

I've asked on the freebsd-x11 and dri-devel mailing lists, but have not had
any luck.  It did occurr to me recently that I've seen these same symptoms
before when trying to get DRI working on FreeBSD a long time ago... On
another machine, if I accidentally had the AGPSize set to a value higher
than was set in the BIOS, I saw the exact same problem in FreeBSD (but
not in Linux, which didn't have any problem with that particular
situation).

Michel Dnzer, from tungstengraphics, answered on the dri-devel mailing
list that he thinks it's probably something related to GART since the
configuration works on linux, and that FreeBSD might set up something
different in regards to PCIe.
>How-To-Repeat:

Upgrade to -CURRENT, upgrade to modular Xorg from the modular Xorg ports tree.  Enable DRI on an X800, startx.
>Fix:

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-x11 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue Dec 5 17:13:43 UTC 2006 
Responsible-Changed-Why:  
Sounds like the problem may be in xorg. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106370 

From: Adam K Kirchhoff <adamk@voicenet.com>
To: bug-followup@FreeBSD.org, adamk@voicenet.com
Cc:  
Subject: Re: ports/106370: Screen corruption when using Direct Rendering on
	a PCIe x800
Date: Sun, 17 Dec 2006 07:12:29 -0500

 Dave Airlie believes that PCIE GART support in ati_pcigart.c is probably
 broken.  Eric Anholt agreed, stating: "that's a very good guess.  it's
 been broken in the past, and I don't know if anyone ever fixed it."
 
 
State-Changed-From-To: open->suspended 
State-Changed-By: flz 
State-Changed-When: Mon Apr 16 12:58:18 UTC 2007 
State-Changed-Why:  
Waiting for a PCI GART fix. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106370 

From: Adam K Kirchhoff <adamk@voicenet.com>
To: bug-followup@FreeBSD.org, adamk@voicenet.com
Cc:  
Subject: Re: ports/106370: Screen corruption when using Direct Rendering on
 a PCIe x800
Date: Tue, 22 May 2007 17:28:57 -0400

 FYI, Still broken with:
 
 FreeBSD sorrow.ashke.com 7.0-CURRENT FreeBSD 7.0-CURRENT #6: Sun May 20 
 11:54:27 EDT 2007     
 root@sorrow.ashke.com:/usr/obj/usr/src/sys/GENERIC  i386
 
 Running newly merged into ports Xorg 7.2

From: Adam K Kirchhoff <adamk@voicenet.com>
To: bug-followup@freebsd.org, adamk@voicenet.com
Cc:  
Subject: Re: ports/106370: Screen corruption when using Direct Rendering on a PCIe x800
Date: Wed, 30 May 2007 06:04:47 -0400

 Just some followup:
 
 Jung-uk Kim suggested trying the drm code available here:
 
 http://people.freebsd.org/~jkim/drm-20070511.tar.gz
 
 It's version radeon DRM version 1.27.0  Gives the same results as 1.25.0 
 
 He also noticed the following problem in my /var/log/Xorg.0.log file:
 
 (II) RADEON(0): [pci] 8192 kB allocated with handle 0x00000000
 
 And then suggested that I add some printf's to drm_sg_alloc in drm_scatter.c.  
 The results was:
 
 sg size=8388608 pages=2048
 sg alloc handle  = cca86000
 

From: Adam K Kirchhoff <adamk@voicenet.com>
To: bug-followup@freebsd.org, adamk@voicenet.com
Cc:  
Subject: Re: ports/106370: Screen corruption when using Direct Rendering on a PCIe x800
Date: Fri, 1 Jun 2007 15:56:35 -0400

 Also, just wanted to note that the original x800 died and has been replaced by 
 an x850XT, so this problem is not specific to a particular card (though it 
 might possibly be specific to this particular motherboard).
 

From: Adam K Kirchhoff <adamk@voicenet.com>
To: bug-followup@FreeBSD.org, adamk@voicenet.com
Cc:  
Subject: Re: ports/106370: Screen corruption when using Direct Rendering on
	a PCIe x800
Date: Sun, 02 Sep 2007 12:52:12 -0400

 FYI, I wiped the x86 version I had installed and installed the amd64
 version of 6.2.  I then did a update to -CURRENT, and Xorg 7.2.0.
 Suddenly direct rendering is working again.  I don't know if this bug
 was fixed, or simply not present in the amd64 version.
 
 Adam
 
 

From: Adam K Kirchhoff <adamk@voicenet.com>
To: bug-followup@FreeBSD.org, adamk@voicenet.com
Cc:  
Subject: Re: ports/106370: Screen corruption when using Direct Rendering on
	a PCIe x800
Date: Tue, 04 Sep 2007 06:05:08 -0400

 FYI, I installed the i386 version on a separate disk and updated it to
 -CURRENT with Xorg 7.2.0.  While I don't get the same distortion at the
 top of the screen as I previously had with direct rendering enabled, all
 opengl applications are simply black.  glxgears, for example, opens up a
 black window with no content.  The same is true for all the mesa demos.
 
 However, on the amd64 installation, everything is fine.
 
 Adam
 
 

From: Adam K Kirchhoff <adamk@voicenet.com>
To: bug-followup@FreeBSD.org, adamk@voicenet.com
Cc:  
Subject: Re: ports/106370: Screen corruption when using Direct Rendering on
	a PCIe x800
Date: Tue, 04 Sep 2007 07:02:41 -0400

 I updated another i386 machine over the weekend (with an AGP x700) and
 finally had a chance to sit down in front of it.  It's experiencing the
 same black window problem as the PCIe x850 machine, so it appears to be
 completely unrelated to the screen corruption I used to get on the x850
 machine.  Since it's a separate issue, and since the screen corruption
 is gone, I see no problem with closing this bug.
 
 If I can't resolve the black window problem (which isn't really an
 accurate description as fire demo appears all white except for the text,
 which shows up fine), I'll open up a separate pr for it.
 
 Adam
 
 

From: Adam K Kirchhoff <adamk@voicenet.com>
To: bug-followup@FreeBSD.org, adamk@voicenet.com
Cc:  
Subject: Re: ports/106370: Screen corruption when using Direct Rendering on
	a PCIe x800
Date: Tue, 04 Sep 2007 10:30:31 -0400

 FYI, I quick compile of mesa from git got direct rendering working
 properly on this card.  
 
 
State-Changed-From-To: suspended->feedback 
State-Changed-By: flz 
State-Changed-When: Fri Sep 14 13:06:20 UTC 2007 
State-Changed-Why:  
I understand it doesn't work with Mesa 7.0.1 from ports. right? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106370 
State-Changed-From-To: feedback->closed 
State-Changed-By: pav 
State-Changed-When: Thu Mar 19 13:14:43 UTC 2009 
State-Changed-Why:  
No follow-ups since 2007, is probably resolved by now.  If not, please notify 
me, will reopen. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106370 
>Unformatted:
