aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-11-05 00:36:53 -0500
committerDave Airlie <airlied@redhat.com>2009-12-01 20:36:41 -0500
commit17e15b0c719b5ec0b344d3ebe3787b48315a0218 (patch)
treede7a28574a257ef9ab5a46e0a155c863b2584663 /drivers/gpu
parentfcec570b27a47e428a9bfc8572ae4c7c230d0488 (diff)
drm/radeon/kms: AGP systems need PCI bus mastering enabled
We might not hit this yet, but when if we do any sort of writeback we really need to enable PCI bus mastering on these systems from what I can see. This enables PCI BM on all radeons that require it. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/radeon/r100.c13
-rw-r--r--drivers/gpu/drm/radeon/r300.c6
-rw-r--r--drivers/gpu/drm/radeon/r420.c3
-rw-r--r--drivers/gpu/drm/radeon/radeon.h1
-rw-r--r--drivers/gpu/drm/radeon/rs400.c1
5 files changed, 21 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index c9e93eabcf16..4e0a80467b44 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -94,6 +94,15 @@ int r100_pci_gart_init(struct radeon_device *rdev)
94 return radeon_gart_table_ram_alloc(rdev); 94 return radeon_gart_table_ram_alloc(rdev);
95} 95}
96 96
97/* required on r1xx, r2xx, r300, r(v)350, r420/r481, rs400/rs480 */
98void r100_enable_bm(struct radeon_device *rdev)
99{
100 uint32_t tmp;
101 /* Enable bus mastering */
102 tmp = RREG32(RADEON_BUS_CNTL) & ~RADEON_BUS_MASTER_DIS;
103 WREG32(RADEON_BUS_CNTL, tmp);
104}
105
97int r100_pci_gart_enable(struct radeon_device *rdev) 106int r100_pci_gart_enable(struct radeon_device *rdev)
98{ 107{
99 uint32_t tmp; 108 uint32_t tmp;
@@ -105,9 +114,6 @@ int r100_pci_gart_enable(struct radeon_device *rdev)
105 WREG32(RADEON_AIC_LO_ADDR, rdev->mc.gtt_location); 114 WREG32(RADEON_AIC_LO_ADDR, rdev->mc.gtt_location);
106 tmp = rdev->mc.gtt_location + rdev->mc.gtt_size - 1; 115 tmp = rdev->mc.gtt_location + rdev->mc.gtt_size - 1;
107 WREG32(RADEON_AIC_HI_ADDR, tmp); 116 WREG32(RADEON_AIC_HI_ADDR, tmp);
108 /* Enable bus mastering */
109 tmp = RREG32(RADEON_BUS_CNTL) & ~RADEON_BUS_MASTER_DIS;
110 WREG32(RADEON_BUS_CNTL, tmp);
111 /* set PCI GART page-table base address */ 117 /* set PCI GART page-table base address */
112 WREG32(RADEON_AIC_PT_BASE, rdev->gart.table_addr); 118 WREG32(RADEON_AIC_PT_BASE, rdev->gart.table_addr);
113 tmp = RREG32(RADEON_AIC_CNTL) | RADEON_PCIGART_TRANSLATE_EN; 119 tmp = RREG32(RADEON_AIC_CNTL) | RADEON_PCIGART_TRANSLATE_EN;
@@ -3108,6 +3114,7 @@ static int r100_startup(struct radeon_device *rdev)
3108 r100_gpu_init(rdev); 3114 r100_gpu_init(rdev);
3109 /* Initialize GART (initialize after TTM so we can allocate 3115 /* Initialize GART (initialize after TTM so we can allocate
3110 * memory through TTM but finalize after TTM) */ 3116 * memory through TTM but finalize after TTM) */
3117 r100_enable_bm(rdev);
3111 if (rdev->flags & RADEON_IS_PCI) { 3118 if (rdev->flags & RADEON_IS_PCI) {
3112 r = r100_pci_gart_enable(rdev); 3119 r = r100_pci_gart_enable(rdev);
3113 if (r) 3120 if (r)
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
index 2f43ee8e4048..9a5798544b42 100644
--- a/drivers/gpu/drm/radeon/r300.c
+++ b/drivers/gpu/drm/radeon/r300.c
@@ -1193,6 +1193,12 @@ static int r300_startup(struct radeon_device *rdev)
1193 if (r) 1193 if (r)
1194 return r; 1194 return r;
1195 } 1195 }
1196
1197 if (rdev->family == CHIP_R300 ||
1198 rdev->family == CHIP_R350 ||
1199 rdev->family == CHIP_RV350)
1200 r100_enable_bm(rdev);
1201
1196 if (rdev->flags & RADEON_IS_PCI) { 1202 if (rdev->flags & RADEON_IS_PCI) {
1197 r = r100_pci_gart_enable(rdev); 1203 r = r100_pci_gart_enable(rdev);
1198 if (r) 1204 if (r)
diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c
index 1cefdbcc0850..e7e4f5a90ebe 100644
--- a/drivers/gpu/drm/radeon/r420.c
+++ b/drivers/gpu/drm/radeon/r420.c
@@ -335,6 +335,9 @@ int r420_init(struct radeon_device *rdev)
335 if (r) { 335 if (r) {
336 return r; 336 return r;
337 } 337 }
338 if (rdev->family == CHIP_R420)
339 r100_enable_bm(rdev);
340
338 if (rdev->flags & RADEON_IS_PCIE) { 341 if (rdev->flags & RADEON_IS_PCIE) {
339 r = rv370_pcie_gart_init(rdev); 342 r = rv370_pcie_gart_init(rdev);
340 if (r) 343 if (r)
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 224506a2f7b1..9cb81a805d14 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -1029,6 +1029,7 @@ extern int r100_cs_parse_packet0(struct radeon_cs_parser *p,
1029extern int r100_cs_packet_parse(struct radeon_cs_parser *p, 1029extern int r100_cs_packet_parse(struct radeon_cs_parser *p,
1030 struct radeon_cs_packet *pkt, 1030 struct radeon_cs_packet *pkt,
1031 unsigned idx); 1031 unsigned idx);
1032extern void r100_enable_bm(struct radeon_device *rdev);
1032 1033
1033/* rv200,rv250,rv280 */ 1034/* rv200,rv250,rv280 */
1034extern void r200_set_safe_registers(struct radeon_device *rdev); 1035extern void r200_set_safe_registers(struct radeon_device *rdev);
diff --git a/drivers/gpu/drm/radeon/rs400.c b/drivers/gpu/drm/radeon/rs400.c
index ca037160a582..f1de558aeb39 100644
--- a/drivers/gpu/drm/radeon/rs400.c
+++ b/drivers/gpu/drm/radeon/rs400.c
@@ -387,6 +387,7 @@ static int rs400_startup(struct radeon_device *rdev)
387 r300_clock_startup(rdev); 387 r300_clock_startup(rdev);
388 /* Initialize GPU configuration (# pipes, ...) */ 388 /* Initialize GPU configuration (# pipes, ...) */
389 rs400_gpu_init(rdev); 389 rs400_gpu_init(rdev);
390 r100_enable_bm(rdev);
390 /* Initialize GART (initialize after TTM so we can allocate 391 /* Initialize GART (initialize after TTM so we can allocate
391 * memory through TTM but finalize after TTM) */ 392 * memory through TTM but finalize after TTM) */
392 r = rs400_gart_enable(rdev); 393 r = rs400_gart_enable(rdev);