Bug#508999: more on 508999 (lenny with wrong frequencies on Radeon Xpress 200)

Michel Dänzer daenzer at debian.org
Mon Dec 22 01:41:12 PST 2008


On Sat, 2008-12-20 at 19:48 +0100, Bernhard R. Link wrote:
> Looking at the radeon_drv sources, it looks like those are only
> accessing 8 bit at RADEON_CLOCK_CNTL_INDEX and not the whole int that
> radeontool is writing, changing that in the driver via
> 
> --- xserver-xorg-video-ati-6.9.0/src/radeon_driver.c	2008-12-20 19:06:32.000000000 +0100
> +++ xserver-xorg-video-ati-6.9.0/src/radeon_driver.c	2008-12-20 18:29:24.000000000 +0100
> @@ -544,7 +544,7 @@
>      unsigned char *RADEONMMIO = info->MMIO;
>      uint32_t       data;
>  
> -    OUTREG8(RADEON_CLOCK_CNTL_INDEX, addr & 0x3f);
> +    OUTREG(RADEON_CLOCK_CNTL_INDEX, addr & 0x3f);
>      RADEONPllErrataAfterIndex(info);
>      data = INREG(RADEON_CLOCK_CNTL_DATA);
>      RADEONPllErrataAfterData(info);
> @@ -558,7 +558,7 @@
>      RADEONInfoPtr  info       = RADEONPTR(pScrn);
>      unsigned char *RADEONMMIO = info->MMIO;
>  
> -    OUTREG8(RADEON_CLOCK_CNTL_INDEX, (((addr) & 0x3f) |
> +    OUTREG(RADEON_CLOCK_CNTL_INDEX, (((addr) & 0x3f) |
>  				      RADEON_PLL_WR_EN));
>      RADEONPllErrataAfterIndex(info);
>      OUTREG(RADEON_CLOCK_CNTL_DATA, data);
> 
> fixes my problem (i.e. I get a working display, and it still works after
> switching to virtual console and back and changing resolutions and all those
> things).
> 
> I fear that might be the case because it is overwriting some other data
> in there that causes this, but I guess to know this someone with
> knowledge about this registers is needed...

Register specs are available from
http://developer.amd.com/documentation/guides/Pages/default.aspx#open_gpu or http://www.x.org/docs/AMD/ .

As can be seen there, CLOCK_CNTL_INDEX is indeed a 32 bit register with
more than 8 functional bits, so this looks like a valid fix.

In fact, I can't seem to find any non-32-bit MMIO registers we would
(need to) use, so I'm not sure the IN/OUTREG8 and IN/OUTREG16 macros
have any reason to live.


-- 
Earthling Michel Dänzer           |                http://www.vmware.com
Libre software enthusiast         |          Debian, X and DRI developer





More information about the xorg-driver-ati mailing list