aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_cp.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2008-10-16 19:21:45 -0400
committerDave Airlie <airlied@linux.ie>2008-10-17 17:10:54 -0400
commitedc6f389f6ae9cb7621270a8ddbb1892bd8df125 (patch)
tree775537e224e7eb83290df07779b3e3ab6876adab /drivers/gpu/drm/radeon/radeon_cp.c
parentb2ceddfa52cbeb244b90096f1e8d3e9f7e0ce299 (diff)
radeon: fix PCI bus mastering support enables.
Someone noticed these registers moved around for later chips, so we redo the codepaths per-chip. PCIE chips don't appear to require explicit enables. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_cp.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_cp.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_cp.c b/drivers/gpu/drm/radeon/radeon_cp.c
index a83d7615ba7f..59a2132a8f57 100644
--- a/drivers/gpu/drm/radeon/radeon_cp.c
+++ b/drivers/gpu/drm/radeon/radeon_cp.c
@@ -363,6 +363,7 @@ static void radeon_cp_load_microcode(drm_radeon_private_t * dev_priv)
363 R300_cp_microcode[i][0]); 363 R300_cp_microcode[i][0]);
364 } 364 }
365 } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R420) || 365 } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R420) ||
366 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R423) ||
366 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV410)) { 367 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV410)) {
367 DRM_INFO("Loading R400 Microcode\n"); 368 DRM_INFO("Loading R400 Microcode\n");
368 for (i = 0; i < 256; i++) { 369 for (i = 0; i < 256; i++) {
@@ -652,8 +653,18 @@ static void radeon_cp_init_ring_buffer(struct drm_device * dev,
652 RADEON_WRITE(RADEON_SCRATCH_UMSK, 0x7); 653 RADEON_WRITE(RADEON_SCRATCH_UMSK, 0x7);
653 654
654 /* Turn on bus mastering */ 655 /* Turn on bus mastering */
655 tmp = RADEON_READ(RADEON_BUS_CNTL) & ~RADEON_BUS_MASTER_DIS; 656 if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS400) ||
656 RADEON_WRITE(RADEON_BUS_CNTL, tmp); 657 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS690) ||
658 ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS740)) {
659 /* rs400, rs690/rs740 */
660 tmp = RADEON_READ(RADEON_BUS_CNTL) & ~RS400_BUS_MASTER_DIS;
661 RADEON_WRITE(RADEON_BUS_CNTL, tmp);
662 } else if (!(((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV380) ||
663 ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R423))) {
664 /* r1xx, r2xx, r300, r(v)350, r420/r481, rs480 */
665 tmp = RADEON_READ(RADEON_BUS_CNTL) & ~RADEON_BUS_MASTER_DIS;
666 RADEON_WRITE(RADEON_BUS_CNTL, tmp);
667 } /* PCIE cards appears to not need this */
657 668
658 dev_priv->sarea_priv->last_frame = dev_priv->scratch[0] = 0; 669 dev_priv->sarea_priv->last_frame = dev_priv->scratch[0] = 0;
659 RADEON_WRITE(RADEON_LAST_FRAME_REG, dev_priv->sarea_priv->last_frame); 670 RADEON_WRITE(RADEON_LAST_FRAME_REG, dev_priv->sarea_priv->last_frame);
@@ -1719,6 +1730,7 @@ int radeon_driver_load(struct drm_device *dev, unsigned long flags)
1719 case CHIP_R300: 1730 case CHIP_R300:
1720 case CHIP_R350: 1731 case CHIP_R350:
1721 case CHIP_R420: 1732 case CHIP_R420:
1733 case CHIP_R423:
1722 case CHIP_RV410: 1734 case CHIP_RV410:
1723 case CHIP_RV515: 1735 case CHIP_RV515:
1724 case CHIP_R520: 1736 case CHIP_R520: