Commit bf21d605 authored by Dave Airlie's avatar Dave Airlie

Merge branch 'drm-fixes-3.14' of git://people.freedesktop.org/~agd5f/linux into drm-fixes

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
parents 7aa4a064 b2b3d8d9
...@@ -4134,8 +4134,11 @@ static void cik_cp_compute_enable(struct radeon_device *rdev, bool enable) ...@@ -4134,8 +4134,11 @@ static void cik_cp_compute_enable(struct radeon_device *rdev, bool enable)
{ {
if (enable) if (enable)
WREG32(CP_MEC_CNTL, 0); WREG32(CP_MEC_CNTL, 0);
else else {
WREG32(CP_MEC_CNTL, (MEC_ME1_HALT | MEC_ME2_HALT)); WREG32(CP_MEC_CNTL, (MEC_ME1_HALT | MEC_ME2_HALT));
rdev->ring[CAYMAN_RING_TYPE_CP1_INDEX].ready = false;
rdev->ring[CAYMAN_RING_TYPE_CP2_INDEX].ready = false;
}
udelay(50); udelay(50);
} }
......
...@@ -264,6 +264,8 @@ static void cik_sdma_gfx_stop(struct radeon_device *rdev) ...@@ -264,6 +264,8 @@ static void cik_sdma_gfx_stop(struct radeon_device *rdev)
WREG32(SDMA0_GFX_RB_CNTL + reg_offset, rb_cntl); WREG32(SDMA0_GFX_RB_CNTL + reg_offset, rb_cntl);
WREG32(SDMA0_GFX_IB_CNTL + reg_offset, 0); WREG32(SDMA0_GFX_IB_CNTL + reg_offset, 0);
} }
rdev->ring[R600_RING_TYPE_DMA_INDEX].ready = false;
rdev->ring[CAYMAN_RING_TYPE_DMA1_INDEX].ready = false;
} }
/** /**
...@@ -291,6 +293,11 @@ void cik_sdma_enable(struct radeon_device *rdev, bool enable) ...@@ -291,6 +293,11 @@ void cik_sdma_enable(struct radeon_device *rdev, bool enable)
u32 me_cntl, reg_offset; u32 me_cntl, reg_offset;
int i; int i;
if (enable == false) {
cik_sdma_gfx_stop(rdev);
cik_sdma_rlc_stop(rdev);
}
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
if (i == 0) if (i == 0)
reg_offset = SDMA0_REGISTER_OFFSET; reg_offset = SDMA0_REGISTER_OFFSET;
...@@ -420,10 +427,6 @@ static int cik_sdma_load_microcode(struct radeon_device *rdev) ...@@ -420,10 +427,6 @@ static int cik_sdma_load_microcode(struct radeon_device *rdev)
if (!rdev->sdma_fw) if (!rdev->sdma_fw)
return -EINVAL; return -EINVAL;
/* stop the gfx rings and rlc compute queues */
cik_sdma_gfx_stop(rdev);
cik_sdma_rlc_stop(rdev);
/* halt the MEs */ /* halt the MEs */
cik_sdma_enable(rdev, false); cik_sdma_enable(rdev, false);
...@@ -492,9 +495,6 @@ int cik_sdma_resume(struct radeon_device *rdev) ...@@ -492,9 +495,6 @@ int cik_sdma_resume(struct radeon_device *rdev)
*/ */
void cik_sdma_fini(struct radeon_device *rdev) void cik_sdma_fini(struct radeon_device *rdev)
{ {
/* stop the gfx rings and rlc compute queues */
cik_sdma_gfx_stop(rdev);
cik_sdma_rlc_stop(rdev);
/* halt the MEs */ /* halt the MEs */
cik_sdma_enable(rdev, false); cik_sdma_enable(rdev, false);
radeon_ring_fini(rdev, &rdev->ring[R600_RING_TYPE_DMA_INDEX]); radeon_ring_fini(rdev, &rdev->ring[R600_RING_TYPE_DMA_INDEX]);
......
...@@ -33,6 +33,13 @@ ...@@ -33,6 +33,13 @@
#include <linux/vga_switcheroo.h> #include <linux/vga_switcheroo.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#if defined(CONFIG_VGA_SWITCHEROO)
bool radeon_is_px(void);
#else
static inline bool radeon_is_px(void) { return false; }
#endif
/** /**
* radeon_driver_unload_kms - Main unload function for KMS. * radeon_driver_unload_kms - Main unload function for KMS.
* *
...@@ -130,7 +137,8 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags) ...@@ -130,7 +137,8 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
"Error during ACPI methods call\n"); "Error during ACPI methods call\n");
} }
if (radeon_runtime_pm != 0) { if ((radeon_runtime_pm == 1) ||
((radeon_runtime_pm == -1) && radeon_is_px())) {
pm_runtime_use_autosuspend(dev->dev); pm_runtime_use_autosuspend(dev->dev);
pm_runtime_set_autosuspend_delay(dev->dev, 5000); pm_runtime_set_autosuspend_delay(dev->dev, 5000);
pm_runtime_set_active(dev->dev); pm_runtime_set_active(dev->dev);
......
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