Commit d396db32 authored by Alex Deucher's avatar Alex Deucher Committed by Dave Airlie

drm/radeon: fixup radeon_do_engine_reset

Cleanup do engine reset for different chip families.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 259434ac
...@@ -418,12 +418,13 @@ static void radeon_do_cp_stop(drm_radeon_private_t * dev_priv) ...@@ -418,12 +418,13 @@ static void radeon_do_cp_stop(drm_radeon_private_t * dev_priv)
static int radeon_do_engine_reset(struct drm_device * dev) static int radeon_do_engine_reset(struct drm_device * dev)
{ {
drm_radeon_private_t *dev_priv = dev->dev_private; drm_radeon_private_t *dev_priv = dev->dev_private;
u32 clock_cntl_index, mclk_cntl, rbbm_soft_reset; u32 clock_cntl_index = 0, mclk_cntl = 0, rbbm_soft_reset;
DRM_DEBUG("\n"); DRM_DEBUG("\n");
radeon_do_pixcache_flush(dev_priv); radeon_do_pixcache_flush(dev_priv);
if ((dev_priv->flags & RADEON_FAMILY_MASK) < CHIP_RV515) { if ((dev_priv->flags & RADEON_FAMILY_MASK) <= CHIP_RV410) {
/* may need something similar for newer chips */
clock_cntl_index = RADEON_READ(RADEON_CLOCK_CNTL_INDEX); clock_cntl_index = RADEON_READ(RADEON_CLOCK_CNTL_INDEX);
mclk_cntl = RADEON_READ_PLL(dev, RADEON_MCLK_CNTL); mclk_cntl = RADEON_READ_PLL(dev, RADEON_MCLK_CNTL);
...@@ -434,6 +435,7 @@ static int radeon_do_engine_reset(struct drm_device * dev) ...@@ -434,6 +435,7 @@ static int radeon_do_engine_reset(struct drm_device * dev)
RADEON_FORCEON_YCLKB | RADEON_FORCEON_YCLKB |
RADEON_FORCEON_MC | RADEON_FORCEON_MC |
RADEON_FORCEON_AIC)); RADEON_FORCEON_AIC));
}
rbbm_soft_reset = RADEON_READ(RADEON_RBBM_SOFT_RESET); rbbm_soft_reset = RADEON_READ(RADEON_RBBM_SOFT_RESET);
...@@ -456,6 +458,7 @@ static int radeon_do_engine_reset(struct drm_device * dev) ...@@ -456,6 +458,7 @@ static int radeon_do_engine_reset(struct drm_device * dev)
RADEON_SOFT_RESET_RB))); RADEON_SOFT_RESET_RB)));
RADEON_READ(RADEON_RBBM_SOFT_RESET); RADEON_READ(RADEON_RBBM_SOFT_RESET);
if ((dev_priv->flags & RADEON_FAMILY_MASK) <= CHIP_RV410) {
RADEON_WRITE_PLL(RADEON_MCLK_CNTL, mclk_cntl); RADEON_WRITE_PLL(RADEON_MCLK_CNTL, mclk_cntl);
RADEON_WRITE(RADEON_CLOCK_CNTL_INDEX, clock_cntl_index); RADEON_WRITE(RADEON_CLOCK_CNTL_INDEX, clock_cntl_index);
RADEON_WRITE(RADEON_RBBM_SOFT_RESET, rbbm_soft_reset); RADEON_WRITE(RADEON_RBBM_SOFT_RESET, rbbm_soft_reset);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment