diff options
Diffstat (limited to 'drivers/char/drm/radeon_cp.c')
-rw-r--r-- | drivers/char/drm/radeon_cp.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/char/drm/radeon_cp.c b/drivers/char/drm/radeon_cp.c index 599187558abb..f5e22bfcc3cb 100644 --- a/drivers/char/drm/radeon_cp.c +++ b/drivers/char/drm/radeon_cp.c | |||
@@ -113,6 +113,27 @@ static void radeon_write_agp_location(drm_radeon_private_t *dev_priv, u32 agp_lo | |||
113 | RADEON_WRITE(RADEON_MC_AGP_LOCATION, agp_loc); | 113 | RADEON_WRITE(RADEON_MC_AGP_LOCATION, agp_loc); |
114 | } | 114 | } |
115 | 115 | ||
116 | static void radeon_write_agp_base(drm_radeon_private_t *dev_priv, u64 agp_base) | ||
117 | { | ||
118 | u32 agp_base_hi = upper_32_bits(agp_base); | ||
119 | u32 agp_base_lo = agp_base & 0xffffffff; | ||
120 | |||
121 | if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV515) { | ||
122 | R500_WRITE_MCIND(RV515_MC_AGP_BASE, agp_base_lo); | ||
123 | R500_WRITE_MCIND(RV515_MC_AGP_BASE_2, agp_base_hi); | ||
124 | } else if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS690) { | ||
125 | RS690_WRITE_MCIND(RS690_MC_AGP_BASE, agp_base_lo); | ||
126 | RS690_WRITE_MCIND(RS690_MC_AGP_BASE_2, agp_base_hi); | ||
127 | } else if ((dev_priv->flags & RADEON_FAMILY_MASK) > CHIP_RV515) { | ||
128 | R500_WRITE_MCIND(R520_MC_AGP_BASE, agp_base_lo); | ||
129 | R500_WRITE_MCIND(R520_MC_AGP_BASE_2, agp_base_hi); | ||
130 | } else { | ||
131 | RADEON_WRITE(RADEON_AGP_BASE, agp_base_lo); | ||
132 | if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R200) | ||
133 | RADEON_WRITE(RADEON_AGP_BASE_2, agp_base_hi); | ||
134 | } | ||
135 | } | ||
136 | |||
116 | static int RADEON_READ_PLL(struct drm_device * dev, int addr) | 137 | static int RADEON_READ_PLL(struct drm_device * dev, int addr) |
117 | { | 138 | { |
118 | drm_radeon_private_t *dev_priv = dev->dev_private; | 139 | drm_radeon_private_t *dev_priv = dev->dev_private; |
@@ -542,9 +563,8 @@ static void radeon_cp_init_ring_buffer(struct drm_device * dev, | |||
542 | 563 | ||
543 | #if __OS_HAS_AGP | 564 | #if __OS_HAS_AGP |
544 | if (dev_priv->flags & RADEON_IS_AGP) { | 565 | if (dev_priv->flags & RADEON_IS_AGP) { |
545 | RADEON_WRITE(RADEON_AGP_BASE, (unsigned int)dev->agp->base); | 566 | radeon_write_agp_base(dev_priv, dev->agp->base); |
546 | if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R200) | 567 | |
547 | RADEON_WRITE(RADEON_AGP_BASE_2, 0); | ||
548 | radeon_write_agp_location(dev_priv, | 568 | radeon_write_agp_location(dev_priv, |
549 | (((dev_priv->gart_vm_start - 1 + | 569 | (((dev_priv->gart_vm_start - 1 + |
550 | dev_priv->gart_size) & 0xffff0000) | | 570 | dev_priv->gart_size) & 0xffff0000) | |