Commit 950c3707 authored by Dave Airlie's avatar Dave Airlie

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

Two regression reverts, and two fixes, one for a dpm boot freeze.

* 'drm-fixes-4.1' of git://people.freedesktop.org/~agd5f/linux:
  drm/radeon: Make sure radeon_vm_bo_set_addr always unreserves the BO
  Revert "drm/radeon: adjust pll when audio is not enabled"
  Revert "drm/radeon: don't share plls if monitors differ in audio support"
  drm/radeon: fix freeze for laptop with Turks/Thames GPU.
parents cff100f5 ee18e599
...@@ -580,9 +580,6 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, ...@@ -580,9 +580,6 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
else else
radeon_crtc->pll_flags |= RADEON_PLL_PREFER_LOW_REF_DIV; radeon_crtc->pll_flags |= RADEON_PLL_PREFER_LOW_REF_DIV;
/* if there is no audio, set MINM_OVER_MAXP */
if (!drm_detect_monitor_audio(radeon_connector_edid(connector)))
radeon_crtc->pll_flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP;
if (rdev->family < CHIP_RV770) if (rdev->family < CHIP_RV770)
radeon_crtc->pll_flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP; radeon_crtc->pll_flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP;
/* use frac fb div on APUs */ /* use frac fb div on APUs */
...@@ -1798,9 +1795,7 @@ static int radeon_get_shared_nondp_ppll(struct drm_crtc *crtc) ...@@ -1798,9 +1795,7 @@ static int radeon_get_shared_nondp_ppll(struct drm_crtc *crtc)
if ((crtc->mode.clock == test_crtc->mode.clock) && if ((crtc->mode.clock == test_crtc->mode.clock) &&
(adjusted_clock == test_adjusted_clock) && (adjusted_clock == test_adjusted_clock) &&
(radeon_crtc->ss_enabled == test_radeon_crtc->ss_enabled) && (radeon_crtc->ss_enabled == test_radeon_crtc->ss_enabled) &&
(test_radeon_crtc->pll_id != ATOM_PPLL_INVALID) && (test_radeon_crtc->pll_id != ATOM_PPLL_INVALID))
(drm_detect_monitor_audio(radeon_connector_edid(test_radeon_crtc->connector)) ==
drm_detect_monitor_audio(radeon_connector_edid(radeon_crtc->connector))))
return test_radeon_crtc->pll_id; return test_radeon_crtc->pll_id;
} }
} }
......
...@@ -1463,6 +1463,21 @@ int radeon_device_init(struct radeon_device *rdev, ...@@ -1463,6 +1463,21 @@ int radeon_device_init(struct radeon_device *rdev,
if (r) if (r)
DRM_ERROR("ib ring test failed (%d).\n", r); DRM_ERROR("ib ring test failed (%d).\n", r);
/*
* Turks/Thames GPU will freeze whole laptop if DPM is not restarted
* after the CP ring have chew one packet at least. Hence here we stop
* and restart DPM after the radeon_ib_ring_tests().
*/
if (rdev->pm.dpm_enabled &&
(rdev->pm.pm_method == PM_METHOD_DPM) &&
(rdev->family == CHIP_TURKS) &&
(rdev->flags & RADEON_IS_MOBILITY)) {
mutex_lock(&rdev->pm.mutex);
radeon_dpm_disable(rdev);
radeon_dpm_enable(rdev);
mutex_unlock(&rdev->pm.mutex);
}
if ((radeon_testing & 1)) { if ((radeon_testing & 1)) {
if (rdev->accel_working) if (rdev->accel_working)
radeon_test_moves(rdev); radeon_test_moves(rdev);
......
...@@ -458,14 +458,16 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev, ...@@ -458,14 +458,16 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev,
/* make sure object fit at this offset */ /* make sure object fit at this offset */
eoffset = soffset + size; eoffset = soffset + size;
if (soffset >= eoffset) { if (soffset >= eoffset) {
return -EINVAL; r = -EINVAL;
goto error_unreserve;
} }
last_pfn = eoffset / RADEON_GPU_PAGE_SIZE; last_pfn = eoffset / RADEON_GPU_PAGE_SIZE;
if (last_pfn > rdev->vm_manager.max_pfn) { if (last_pfn > rdev->vm_manager.max_pfn) {
dev_err(rdev->dev, "va above limit (0x%08X > 0x%08X)\n", dev_err(rdev->dev, "va above limit (0x%08X > 0x%08X)\n",
last_pfn, rdev->vm_manager.max_pfn); last_pfn, rdev->vm_manager.max_pfn);
return -EINVAL; r = -EINVAL;
goto error_unreserve;
} }
} else { } else {
...@@ -486,7 +488,8 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev, ...@@ -486,7 +488,8 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev,
"(bo %p 0x%010lx 0x%010lx)\n", bo_va->bo, "(bo %p 0x%010lx 0x%010lx)\n", bo_va->bo,
soffset, tmp->bo, tmp->it.start, tmp->it.last); soffset, tmp->bo, tmp->it.start, tmp->it.last);
mutex_unlock(&vm->mutex); mutex_unlock(&vm->mutex);
return -EINVAL; r = -EINVAL;
goto error_unreserve;
} }
} }
...@@ -497,7 +500,8 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev, ...@@ -497,7 +500,8 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev,
tmp = kzalloc(sizeof(struct radeon_bo_va), GFP_KERNEL); tmp = kzalloc(sizeof(struct radeon_bo_va), GFP_KERNEL);
if (!tmp) { if (!tmp) {
mutex_unlock(&vm->mutex); mutex_unlock(&vm->mutex);
return -ENOMEM; r = -ENOMEM;
goto error_unreserve;
} }
tmp->it.start = bo_va->it.start; tmp->it.start = bo_va->it.start;
tmp->it.last = bo_va->it.last; tmp->it.last = bo_va->it.last;
...@@ -555,7 +559,6 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev, ...@@ -555,7 +559,6 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev,
r = radeon_vm_clear_bo(rdev, pt); r = radeon_vm_clear_bo(rdev, pt);
if (r) { if (r) {
radeon_bo_unref(&pt); radeon_bo_unref(&pt);
radeon_bo_reserve(bo_va->bo, false);
return r; return r;
} }
...@@ -575,6 +578,10 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev, ...@@ -575,6 +578,10 @@ int radeon_vm_bo_set_addr(struct radeon_device *rdev,
mutex_unlock(&vm->mutex); mutex_unlock(&vm->mutex);
return 0; return 0;
error_unreserve:
radeon_bo_unreserve(bo_va->bo);
return r;
} }
/** /**
......
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