A few more radeon fixes. * 'drm-fixes-3.14' of git://people.freedesktop.org/~agd5f/linux: drm/radeon/cik: properly set compute ring status on disable drm/radeon/cik: stop the sdma engines in the enable() function drm/radeon/cik: properly set sdma ring status on disable drm/radeon: fix runpm disabling on non-PX harder
Unified · Split
| @@ -4134,8 +4134,11 @@ static void cik_cp_compute_enable(struct radeon_device *rdev, bool enable) · 4133 unmodified lines | ||
| 4134 | 4134 | { |
| 4135 | 4135 | if (enable) |
| 4136 | 4136 | WREG32(CP_MEC_CNTL, 0); |
| 4137 | − else | |
| 4137 | + else { | |
| 4138 | 4138 | WREG32(CP_MEC_CNTL, (MEC_ME1_HALT | MEC_ME2_HALT)); |
| 4139 | + rdev->ring[CAYMAN_RING_TYPE_CP1_INDEX].ready = false; | |
| 4140 | + rdev->ring[CAYMAN_RING_TYPE_CP2_INDEX].ready = false; | |
| 4141 | + } | |
| 4139 | 4142 | udelay(50); |
| 4140 | 4143 | } |
| 4141 | 4144 | |
| @@ -264,6 +264,8 @@ static void cik_sdma_gfx_stop(struct radeon_device *rdev) · 263 unmodified lines | ||
| 264 | 264 | WREG32(SDMA0_GFX_RB_CNTL + reg_offset, rb_cntl); |
| 265 | 265 | WREG32(SDMA0_GFX_IB_CNTL + reg_offset, 0); |
| 266 | 266 | } |
| 267 | + rdev->ring[R600_RING_TYPE_DMA_INDEX].ready = false; | |
| 268 | + rdev->ring[CAYMAN_RING_TYPE_DMA1_INDEX].ready = false; | |
| 267 | 269 | } |
| 268 | 270 | |
| 269 | 271 | /** |
| @@ -291,6 +293,11 @@ void cik_sdma_enable(struct radeon_device *rdev, bool enable) · 21 unmodified lines | ||
| 291 | 293 | u32 me_cntl, reg_offset; |
| 292 | 294 | int i; |
| 293 | 295 | |
| 296 | + if (enable == false) { | |
| 297 | + cik_sdma_gfx_stop(rdev); | |
| 298 | + cik_sdma_rlc_stop(rdev); | |
| 299 | + } | |
| 300 | + | |
| 294 | 301 | for (i = 0; i < 2; i++) { |
| 295 | 302 | if (i == 0) |
| 296 | 303 | reg_offset = SDMA0_REGISTER_OFFSET; |
| @@ -420,10 +427,6 @@ static int cik_sdma_load_microcode(struct radeon_device *rdev) · 123 unmodified lines | ||
| 420 | 427 | if (!rdev->sdma_fw) |
| 421 | 428 | return -EINVAL; |
| 422 | 429 | |
| 423 | − /* stop the gfx rings and rlc compute queues */ | |
| 424 | − cik_sdma_gfx_stop(rdev); | |
| 425 | − cik_sdma_rlc_stop(rdev); | |
| 426 | − | |
| 427 | 430 | /* halt the MEs */ |
| 428 | 431 | cik_sdma_enable(rdev, false); |
| 429 | 432 | |
| @@ -492,9 +495,6 @@ int cik_sdma_resume(struct radeon_device *rdev) · 62 unmodified lines | ||
| 492 | 495 | */ |
| 493 | 496 | void cik_sdma_fini(struct radeon_device *rdev) |
| 494 | 497 | { |
| 495 | − /* stop the gfx rings and rlc compute queues */ | |
| 496 | − cik_sdma_gfx_stop(rdev); | |
| 497 | − cik_sdma_rlc_stop(rdev); | |
| 498 | 498 | /* halt the MEs */ |
| 499 | 499 | cik_sdma_enable(rdev, false); |
| 500 | 500 | radeon_ring_fini(rdev, &rdev->ring[R600_RING_TYPE_DMA_INDEX]); |
| @@ -33,6 +33,13 @@ · 32 unmodified lines | ||
| 33 | 33 | #include <linux/vga_switcheroo.h> |
| 34 | 34 | #include <linux/slab.h> |
| 35 | 35 | #include <linux/pm_runtime.h> |
| 36 | + | |
| 37 | +#if defined(CONFIG_VGA_SWITCHEROO) | |
| 38 | +bool radeon_is_px(void); | |
| 39 | +#else | |
| 40 | +static inline bool radeon_is_px(void) { return false; } | |
| 41 | +#endif | |
| 42 | + | |
| 36 | 43 | /** |
| 37 | 44 | * radeon_driver_unload_kms - Main unload function for KMS. |
| 38 | 45 | * |
| @@ -130,7 +137,8 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags) · 91 unmodified lines | ||
| 130 | 137 | "Error during ACPI methods call\n"); |
| 131 | 138 | } |
| 132 | 139 | |
| 133 | − if (radeon_runtime_pm != 0) { | |
| 140 | + if ((radeon_runtime_pm == 1) || | |
| 141 | + ((radeon_runtime_pm == -1) && radeon_is_px())) { | |
| 134 | 142 | pm_runtime_use_autosuspend(dev->dev); |
| 135 | 143 | pm_runtime_set_autosuspend_delay(dev->dev, 5000); |
| 136 | 144 | pm_runtime_set_active(dev->dev); |