From owner-freebsd-x11@FreeBSD.ORG Sat Dec 19 19:51:11 2009 Return-Path: Delivered-To: freebsd-x11@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DD9C1065670; Sat, 19 Dec 2009 19:51:11 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from gizmo.2hip.net (gizmo.2hip.net [64.74.207.195]) by mx1.freebsd.org (Postfix) with ESMTP id 19EAF8FC13; Sat, 19 Dec 2009 19:51:10 +0000 (UTC) Received: from [192.168.1.4] (adsl-156-16-112.bna.bellsouth.net [70.156.16.112]) (authenticated bits=0) by gizmo.2hip.net (8.14.3/8.14.3) with ESMTP id nBJJp6Mc045097 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 19 Dec 2009 14:51:07 -0500 (EST) (envelope-from rnoland@FreeBSD.org) From: Robert Noland To: greg@rowes.org In-Reply-To: <9229F0071B3A4C3FAF62E472480D8D57@GregPC> References: <200912111614.47417.greg@rowes.org> <4B22C93D.9000208@icyb.net.ua> <4B2317CF.5080900@comcast.net> <1260636181.2281.35.camel@balrog.2hip.net> <7EE7B533BABE48F7876B0560C84A8238@GregPC> <1261246173.2315.20.camel@balrog.2hip.net> <1261248448.2315.22.camel@balrog.2hip.net> <9229F0071B3A4C3FAF62E472480D8D57@GregPC> Content-Type: multipart/mixed; boundary="=-bVErumZjEYBDEbPAz/IX" Organization: FreeBSD Date: Sat, 19 Dec 2009 13:51:01 -0600 Message-Id: <1261252261.2315.25.camel@balrog.2hip.net> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 FreeBSD GNOME Team Port X-Spam-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RDNS_DYNAMIC, SPF_SOFTFAIL autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on gizmo.2hip.net Cc: freebsd-x11@FreeBSD.org, 'Andriy Gapon' , 'John Baldwin' Subject: RE: PCI Radeon 9250 - DRI/DRM in 8.0-RELEASE X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 19:51:11 -0000 --=-bVErumZjEYBDEbPAz/IX Content-Type: text/plain Content-Transfer-Encoding: 7bit On Sat, 2009-12-19 at 14:34 -0500, Greg Rowe wrote: > Hi Robert, > The patch worked! I can start X now with DRI enabled. Xvinfo now reports an > adapter present. The only thing I see is some errors being reported on the > screen when exiting a window manager (KDE & TWM). They aren't logged to > Xorg.log though and I don't see any other issues besides these errors. The > error is: > WARNING: A device driver has set "memattr" inconsistently. > And I get about 20 of these. I enabled PAT write-combining in that patch as well. Can you apply the attached patch on top and see if they go away? robert. > An Xorg.log is attached and below is the results of xvinfo. Thanks. > > Greg > > X-Video Extension version 2.2 > screen #0 > Adaptor #0: "Radeon Textured Video" > number of ports: 16 > port base: 57 > operations supported: PutImage > supported visuals: > depth 24, visualID 0x21 > number of attributes: 2 > "XV_VSYNC" (range 0 to 1) > client settable attribute > client gettable attribute (current value is 1) > "XV_HWPLANAR" (range 0 to 1) > client settable attribute > client gettable attribute (current value is 1) > maximum XvImage size: 8192 x 8192 > Number of image formats: 4 > id: 0x32595559 (YUY2) > guid: 59555932-0000-0010-8000-00aa00389b71 > bits per pixel: 16 > number of planes: 1 > type: YUV (packed) > id: 0x32315659 (YV12) > guid: 59563132-0000-0010-8000-00aa00389b71 > bits per pixel: 12 > number of planes: 3 > type: YUV (planar) > id: 0x30323449 (I420) > guid: 49343230-0000-0010-8000-00aa00389b71 > bits per pixel: 12 > number of planes: 3 > type: YUV (planar) > id: 0x59565955 (UYVY) > guid: 55595659-0000-0010-8000-00aa00389b71 > bits per pixel: 16 > number of planes: 1 > type: YUV (packed) > > > -----Original Message----- > > From: Robert Noland [mailto:rnoland@FreeBSD.org] > > Sent: Saturday, December 19, 2009 1:47 PM > > To: greg@rowes.org > > Cc: 'Steve Polyack'; 'Andriy Gapon'; freebsd-x11@FreeBSD.org; 'John > > Baldwin' > > Subject: RE: PCI Radeon 9250 - DRI/DRM in 8.0-RELEASE > > > > On Sat, 2009-12-19 at 13:44 -0500, Greg Rowe wrote: > > > Robert, > > > The patch applied cleanly (8.0 Stable from last week), but on > > rebuilding > > > the kernel (make buildkernel) I get the following: > > > > > > cc -c -O -pipe -std=c99 -g -Wall -Wredundant-decls -Wnested-externs > > > -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline > > > -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc - > > I. > > > -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL > > > -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common > > > -finline-limit=8000 --param inline-unit-growth=100 --param > > > large-function-growth=1000 -mno-align-long-strings > > > -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 > > > -mno-sse3 -ffreestanding -fstack-protector -Werror > > > /usr/src/sys/dev/drm/drm_sysctl.c > > > cc1: warnings being treated as errors > > > /usr/src/sys/dev/drm/drm_sysctl.c: In function 'drm_vm_info': > > > /usr/src/sys/dev/drm/drm_sysctl.c:206: warning: format '%016jx' expects > > type > > > 'uintmax_t', but argument 5 has type 'long unsigned int' > > > *** Error code 1 > > > > Yes, I have an i386 build running now, I'll update the patch in a > > minute. Meanwhile, you can just replace the "j" with and "l". > > > > robert. > > > > > Stop in /usr/obj/usr/src/sys/PSV. > > > *** Error code 1 > > > > > > Stop in /usr/src. > > > *** Error code 1 > > > > > > Stop in /usr/src. > > > > > > > -----Original Message----- > > > > From: Robert Noland [mailto:rnoland@FreeBSD.org] > > > > Sent: Saturday, December 19, 2009 1:10 PM > > > > To: greg@rowes.org > > > > Cc: 'Steve Polyack'; 'Andriy Gapon'; freebsd-x11@FreeBSD.org; 'John > > > > Baldwin' > > > > Subject: RE: PCI Radeon 9250 - DRI/DRM in 8.0-RELEASE > > > > > > > > On Sat, 2009-12-12 at 17:36 -0500, Greg Rowe wrote: > > > > > The system is still running the pagezero patch if that makes any > > > > difference? > > > > > > > > Ok, you can get rid of that. > > > > > > > > I wasn't able to fix this quite like I wanted to, but this should > > work. > > > > The fix that I was intending to do, ended up meaning that I had to > > work > > > > on our mmap implementation, which I did, but won't be committed until > > it > > > > is reviewed. It also required a handful of changes to userland > > (libdrm, > > > > and the DDX driver) and broke the KBI so rebuilding even more stuff > > was > > > > needed. The linux guys would not have been happy with me and I would > > > > have had a fight on my hands. > > > > > > > > This patch implements what I wanted to do on 64 bit platforms. On 32 > > > > bit platforms (i386) it comes with some consequences... On amd64, I've > > > > adapted the map handle to have an offset of 0 and a globally unique > > map > > > > number starting at bit 40. This means that there are 24 bits for maps > > > > and each map can describe 1TB of memory. On i386, I've done the same > > > > thing except I am only stealing the top 4 bits for the map id, so > > there > > > > can only be 15 maps each up to 256MB. This should be ok since > > normally > > > > there are only 6 or 7 maps. > > > > > > > > I have run tested this on r600 amd64 so far. I can test r3/5/6/700, > > > > Intel and nouveau, but haven't done so yet. This should be a kernel > > > > only fix, meaning you should not need to patch or rebuild any of your > > > > userland apps. The patch is applicable to -CURRENT, and should work > > on > > > > 8-STABLE and possibly 7-STABLE. > > > > > > > > http://people.freebsd.org/~rnoland/drm_mmap_fix.patch > > > > > > > > robert. > > > > > > > > > > -----Original Message----- > > > > > > From: Robert Noland [mailto:rnoland@FreeBSD.org] > > > > > > Sent: Saturday, December 12, 2009 11:43 AM > > > > > > To: greg@rowes.org > > > > > > Cc: 'Steve Polyack'; 'Andriy Gapon'; freebsd-x11@FreeBSD.org; > > 'John > > > > > > Baldwin' > > > > > > Subject: RE: PCI Radeon 9250 - DRI/DRM in 8.0-RELEASE > > > > > > > > > > > > On Sat, 2009-12-12 at 09:28 -0500, Greg Rowe wrote: > > > > > > > My system has a Gigabyte Radeon HD4850 1GB PCI Express Card in > > it. > > > > The > > > > > > main > > > > > > > board is an ASUS P5N7A-VM, 4GB ram (tested with 2GB also), Intel > > > > Core 2 > > > > > > Duo > > > > > > > E6850, on-board video disabled in the BIOS, and the BIOS is > > flashed > > > > to > > > > > > > ASUS's latest release. I'm using a single monitor off the DVI > > port. > > > > > > > > > > > > > > I'm running the ATI Radeon driver as it works well with the > > > > exception > > > > > > of > > > > > > > DRI. I've tried the released and development version of the > > RadeonHD > > > > > > driver > > > > > > > but both pretty much lock up X. Whether it helps or not, the > > > > background > > > > > > > garbage on the screen I see with the ATI driver is more visible > > with > > > > the > > > > > > hd > > > > > > > drivers and it's the ASUS Bios splash screen in tiny font many > > times > > > > > > across > > > > > > > the screen. Dmesg and Memcontrol.list from Xorg with DRI > > enabled is > > > > > > > attached. > > > > > > > > > > > > Actually, I think I see what is going on in your case. Your > > > > framebuffer > > > > > > is at 0xe0000000 and the ring is being allocated inside the > > > > framebuffer > > > > > > address space. I'm trying to figure out how this is occurring > > now. > > > > > > > > > > > > robert. > > > > > > > > > > > > > > -----Original Message----- > > > > > > > > From: Steve Polyack [mailto:korvus@comcast.net] > > > > > > > > Sent: Friday, December 11, 2009 11:11 PM > > > > > > > > To: Andriy Gapon > > > > > > > > Cc: Greg Rowe; rnoland@freebsd.org; freebsd-x11@freebsd.org; > > John > > > > > > Baldwin > > > > > > > > Subject: Re: PCI Radeon 9250 - DRI/DRM in 8.0-RELEASE > > > > > > > > > > > > > > > > Andriy Gapon wrote: > > > > > > > > > on 11/12/2009 23:14 Greg Rowe said the following: > > > > > > > > > > > > > > > > > >> Robert, > > > > > > > > >> I tried the pagezero patch (applied, rebuilt kernel, > > rebooted, > > > > > > Xorg > > > > > > > > with DRI > > > > > > > > >> enabled) on my system with the Radeon HD4850 and it didn't > > > > change > > > > > > > > anything. > > > > > > > > >> See the attached. Thanks. > > > > > > > > >> > > > > > > > > > > > > > > > > > > Greg, Steve, could you please describe your systems some > > more? > > > > > > > > > Type of CPU, if this is SMP. > > > > > > > > > Providing a link to your dmesg should be helpful. > > > > > > > > > 'memcontrol list' output could be useful too. > > > > > > > > > > > > > > > > > > Thanks! > > > > > > > > > > > > > > > > > > > > > > > > > > I have yet to try the patch, but my system is a a ~3Ghz > > Pentium 4 > > > > with > > > > > > > > Hyperthreading enabled. Intel chipset (not sure which, but > > the > > > > > > USB/SATA > > > > > > > > are the ICH7) with onboard graphics. The Radeon 9250 is a PCI > > > > add-on. > > > > > > > > I'm also using both outputs on the card (1 VGA, 1 DVI). I've > > > > attached > > > > > > > > the output of 'dmesg' and 'pciconf -l -v'. > > > > > > > > > > > > > -- > > > > > > Robert Noland > > > > > > FreeBSD > > > > > > > > > > > > > > > > > > > > -- > > > > Robert Noland > > > > FreeBSD > > > > > > > > > > > > -- > > Robert Noland > > FreeBSD > > > > _______________________________________________ > freebsd-x11@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-x11 > To unsubscribe, send any mail to "freebsd-x11-unsubscribe@freebsd.org" -- Robert Noland FreeBSD --=-bVErumZjEYBDEbPAz/IX Content-Disposition: attachment; filename="drm_scatter-memattr.patch" Content-Type: text/x-patch; name="drm_scatter-memattr.patch"; charset="us-ascii" Content-Transfer-Encoding: 7bit diff --git a/sys/dev/drm/drm_scatter.c b/sys/dev/drm/drm_scatter.c index 30ef27c..5521bfe 100644 --- a/sys/dev/drm/drm_scatter.c +++ b/sys/dev/drm/drm_scatter.c @@ -81,6 +81,9 @@ drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather *request) return ENOMEM; } + pmap_change_attr(dmah->vaddr, request->size, + VM_MEMATTR_WRITE_COMBINING); + entry->handle = (unsigned long)dmah->vaddr; entry->virtual = dmah->vaddr; --=-bVErumZjEYBDEbPAz/IX--