diff options
author | Jerome Glisse <jglisse@redhat.com> | 2009-09-09 22:24:20 +0200 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-09-10 10:13:33 +1000 |
commit | 905b68223be18937159a29b354e6a332952ff952 (patch) | |
tree | 3a2e955e7beba517a33d5e0e7eeed350ce6a9a70 /drivers/gpu/drm/radeon/r420.c | |
parent | a18d7ea15356679f58c2fafe2957786c5f7f9201 (diff) | |
download | lwn-905b68223be18937159a29b354e6a332952ff952.tar.gz lwn-905b68223be18937159a29b354e6a332952ff952.zip |
drm/radeon/kms: add R4XX mc register access helper.
Atombios will use the mc register access helper and R4XX hw have a
bigger mc range than R3XX so add R4XX specific mc register access
helper.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r420.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r420.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c index 97426a6f370f..96303f064db7 100644 --- a/drivers/gpu/drm/radeon/r420.c +++ b/drivers/gpu/drm/radeon/r420.c @@ -29,6 +29,7 @@ #include "drmP.h" #include "radeon_reg.h" #include "radeon.h" +#include "r420d.h" /* r420,r423,rv410 depends on : */ void r100_pci_gart_disable(struct radeon_device *rdev); @@ -232,3 +233,19 @@ int r420_debugfs_pipes_info_init(struct radeon_device *rdev) return 0; #endif } + +u32 r420_mc_rreg(struct radeon_device *rdev, u32 reg) +{ + u32 r; + + WREG32(R_0001F8_MC_IND_INDEX, S_0001F8_MC_IND_ADDR(reg)); + r = RREG32(R_0001FC_MC_IND_DATA); + return r; +} + +void r420_mc_wreg(struct radeon_device *rdev, u32 reg, u32 v) +{ + WREG32(R_0001F8_MC_IND_INDEX, S_0001F8_MC_IND_ADDR(reg) | + S_0001F8_MC_IND_WR_EN(1)); + WREG32(R_0001FC_MC_IND_DATA, v); +} |