Radeon DRM GART mapping bogosity
Dave Airlie
airlied at gmail.com
Tue May 3 03:51:50 PDT 2005
> In the meantime, here's a patch against current Linus "git" that I'm
> tempted to push asap so that at least 2.6.12 avoids the problem of
> overlapping which causes random stuffs to happen with lockups. The
> "issue" here is even if you don't have an r300-friendly DRM, it will
> still try to initialize those things, even if it ultimately fails,
> provided you have a new enough X.org, and thus will screw up the
> mapping.
If Michel Daenzer thinks this is okay, he was the last person to dig
around in that area with the changes for the IGPs, I'm away from my
setup so I can't look at this for another while, but if you can get
consensus quickly send it to Linus...
Dave.
>
> Index: linux-work/drivers/char/drm/radeon_drv.h
> ===================================================================
> --- linux-work.orig/drivers/char/drm/radeon_drv.h 2005-05-02 10:48:09.000000000 +1000
> +++ linux-work/drivers/char/drm/radeon_drv.h 2005-05-03 17:51:55.000000000 +1000
> @@ -346,6 +346,7 @@
> #define RADEON_CLOCK_CNTL_DATA 0x000c
> # define RADEON_PLL_WR_EN (1 << 7)
> #define RADEON_CLOCK_CNTL_INDEX 0x0008
> +#define RADEON_CONFIG_MEMSIZE 0x00f8
> #define RADEON_CONFIG_APER_SIZE 0x0108
> #define RADEON_CRTC_OFFSET 0x0224
> #define RADEON_CRTC_OFFSET_CNTL 0x0228
> Index: linux-work/drivers/char/drm/radeon_cp.c
> ===================================================================
> --- linux-work.orig/drivers/char/drm/radeon_cp.c 2005-05-02 10:48:09.000000000 +1000
> +++ linux-work/drivers/char/drm/radeon_cp.c 2005-05-03 17:49:25.000000000 +1000
> @@ -1269,6 +1269,7 @@
> {
> drm_radeon_private_t *dev_priv = dev->dev_private;;
> DRM_DEBUG( "\n" );
> + u32 gart_loc;
>
> dev_priv->is_pci = init->is_pci;
>
> @@ -1476,8 +1477,12 @@
>
> dev_priv->gart_size = init->gart_size;
> - dev_priv->gart_vm_start = dev_priv->fb_location
> - + RADEON_READ( RADEON_CONFIG_APER_SIZE );
> + gart_loc = dev_priv->fb_location + RADEON_READ( RADEON_CONFIG_MEMSIZE );
> + /* overflow ? */
> + if ((gart_loc + dev_priv->gart_size) < dev_priv->fb_location)
> + gart_loc = dev_priv->fb_location - dev_priv->gart_size;
> +
> + dev_priv->gart_vm_start = gart_loc;
>
> #if __OS_HAS_AGP
> if ( !dev_priv->is_pci )
>
>
More information about the xorg
mailing list