From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <589116.91988.qm@web1202.biz.mail.gq1.yahoo.com> References: <7caa7a0a-fb6d-4ffa-81ef-ad3256100f2c@g21g2000yqk.googlegroups.co> <9e5fc5ec-43d5-4cf3-be92-3fc8c4829ba0@l32g2000yqm.googlegroups.co> <589116.91988.qm@web1202.biz.mail.gq1.yahoo.com> From: Venkatesh Srinivas Date: Sat, 1 May 2010 09:53:28 -0400 Message-ID: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] ctrl radeon: not working for ATI Radeon 9600 Mobility? Topicbox-Message-UUID: 15db95cc-ead6-11e9-9d60-3106f5b1d025 erik quanstrom wrote: > /sys/src/cmd/aux/vga/radeon.c uses radeon_pciids in radeon.h. > it ignores the vids and dids in /lib/vgadb. this is probablly a > mistake. Agreed. erik quanstrom wrote: > i think it's mainly a question of getting the best graphics > performance. but these days the 2d accelleration (especially > for radeon) is fairly poor. Do you happen to have any workloads where this is a problem? There is a lot more we can do for the radeon, particularly the r100-r300 chips, which could improve draw performance. Have you ever tried enabling HW_ACCEL in the Radeon driver? It accelerates fill/scroll to some degree, which would certainly be a first step. Gabriel D=C3=ADaz wrote: > I guess the radeon driver is unable to work with modern ati cards no? Right now the Radeon driver can deal with r100-r300; it is missing PCI VID/DIDs for a number of r200 cards, mostly the later 9200 and 9250 series. It is also missing a number of r300s (9600, 9800) and the PCIe X1050, X3xx, X5xx, and X6xx. I don't know how well the later cards will work, but they are nominally the same as the 9500/9700, which are supported. Sean Stangl at CMU started working on support for more modern (R500/R600 iirc) cards; I believe he got most of ATOMBIOS support and snarf() routines for the r600 done. > I would love a book recommendation to learn something about graphics prog= ramming, so at least i can guess what or where to look to try to debug the = problem. I don't know of a book that describes any modern graphics hardware, sorry. However, here is a bit of an overview of what is going on with the radeon, at least: The radeon exposes a pair of bus-accessible memory regions (BARs), the framebuffer and the MMIO region; these regions appear in physical memory and are mapped by vgaradeon.c (take a look at radeonenable()). On the Radeon, BAR 0 holds the framebuffer, IIRC; vgalinearpci() searches the card for the largest region and guesses that that is the framebuffer. BAR 2 holds the MMIO region. We ask that the framebuffer segment is set to write-combining via the MTRRs; we cannot do the same for the MMIO region. To just draw, you can write to the framebuffer region. To ask the radeon gpu to do anything interesting for you, you must carry out a series of register writes - for example, to fill a rectangle with a solid color, you write the rectangle's color to DP_BRUSH_FGRD_CLR (register 0x147c), the start to DST_X_Y, and the width and height to DST_WIDTH_HEIGHT. Everything you can ask the radeon to do is ultimately done via register writes. agd5f's blog has two entries that are pretty useful: http://www.botchco.com/agd5f/?p=3D50 and http://www.botchco.com/agd5f/?p=3D16. -- vs