diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-03-28 13:58:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-03-28 13:58:10 -0400 |
commit | 1fac1fa965a9fbdb38d8a4b945db3521f801c946 (patch) | |
tree | 26a1152acc6faaca6427471a3934255812bbcf38 | |
parent | 350bb4bebf5d80937eb41b39509779888bc8aa75 (diff) | |
parent | 8ee661b505613ef2747b350ca2871a31b3781bee (diff) |
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie:
"I didn't want these to wait for stable cycle.
The nouveau and radeon ones are the same problem, where the runtime pm
stuff broke non-runtime pm managed secondary GPUs.
The udl fix is for an oops on unplug, and the i915 fix is for a
regression on Sandybridge even though it may break haswell (regression
wins)"
Daniel Vetter comments:
"My apologies for the i915 regression fumble, that thing somehow fell
through the cracks here for almost half a year :( Imo that's more than
enough flailing to just go ahead with the revert, and the re-broken
hsw should get peoples attention ..."
* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
drm/i915: Undo gtt scratch pte unmapping again
drm/radeon: fix runtime suspend breaking secondary GPUs
drm/nouveau: fail runtime pm properly.
drm/udl: take reference to device struct for dma-bufs
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_gtt.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drm.c | 14 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_drv.c | 17 | ||||
-rw-r--r-- | drivers/gpu/drm/udl/udl_gem.c | 11 |
4 files changed, 31 insertions, 13 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index 40a2b36b276b..d278be110805 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c | |||
@@ -842,7 +842,7 @@ void i915_gem_suspend_gtt_mappings(struct drm_device *dev) | |||
842 | dev_priv->gtt.base.clear_range(&dev_priv->gtt.base, | 842 | dev_priv->gtt.base.clear_range(&dev_priv->gtt.base, |
843 | dev_priv->gtt.base.start / PAGE_SIZE, | 843 | dev_priv->gtt.base.start / PAGE_SIZE, |
844 | dev_priv->gtt.base.total / PAGE_SIZE, | 844 | dev_priv->gtt.base.total / PAGE_SIZE, |
845 | false); | 845 | true); |
846 | } | 846 | } |
847 | 847 | ||
848 | void i915_gem_restore_gtt_mappings(struct drm_device *dev) | 848 | void i915_gem_restore_gtt_mappings(struct drm_device *dev) |
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index 89c484d8ac26..4ee702ac8907 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c | |||
@@ -866,13 +866,16 @@ static int nouveau_pmops_runtime_suspend(struct device *dev) | |||
866 | struct drm_device *drm_dev = pci_get_drvdata(pdev); | 866 | struct drm_device *drm_dev = pci_get_drvdata(pdev); |
867 | int ret; | 867 | int ret; |
868 | 868 | ||
869 | if (nouveau_runtime_pm == 0) | 869 | if (nouveau_runtime_pm == 0) { |
870 | return -EINVAL; | 870 | pm_runtime_forbid(dev); |
871 | return -EBUSY; | ||
872 | } | ||
871 | 873 | ||
872 | /* are we optimus enabled? */ | 874 | /* are we optimus enabled? */ |
873 | if (nouveau_runtime_pm == -1 && !nouveau_is_optimus() && !nouveau_is_v1_dsm()) { | 875 | if (nouveau_runtime_pm == -1 && !nouveau_is_optimus() && !nouveau_is_v1_dsm()) { |
874 | DRM_DEBUG_DRIVER("failing to power off - not optimus\n"); | 876 | DRM_DEBUG_DRIVER("failing to power off - not optimus\n"); |
875 | return -EINVAL; | 877 | pm_runtime_forbid(dev); |
878 | return -EBUSY; | ||
876 | } | 879 | } |
877 | 880 | ||
878 | nv_debug_level(SILENT); | 881 | nv_debug_level(SILENT); |
@@ -923,12 +926,15 @@ static int nouveau_pmops_runtime_idle(struct device *dev) | |||
923 | struct nouveau_drm *drm = nouveau_drm(drm_dev); | 926 | struct nouveau_drm *drm = nouveau_drm(drm_dev); |
924 | struct drm_crtc *crtc; | 927 | struct drm_crtc *crtc; |
925 | 928 | ||
926 | if (nouveau_runtime_pm == 0) | 929 | if (nouveau_runtime_pm == 0) { |
930 | pm_runtime_forbid(dev); | ||
927 | return -EBUSY; | 931 | return -EBUSY; |
932 | } | ||
928 | 933 | ||
929 | /* are we optimus enabled? */ | 934 | /* are we optimus enabled? */ |
930 | if (nouveau_runtime_pm == -1 && !nouveau_is_optimus() && !nouveau_is_v1_dsm()) { | 935 | if (nouveau_runtime_pm == -1 && !nouveau_is_optimus() && !nouveau_is_v1_dsm()) { |
931 | DRM_DEBUG_DRIVER("failing to power off - not optimus\n"); | 936 | DRM_DEBUG_DRIVER("failing to power off - not optimus\n"); |
937 | pm_runtime_forbid(dev); | ||
932 | return -EBUSY; | 938 | return -EBUSY; |
933 | } | 939 | } |
934 | 940 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index 84a1bbb75f91..f633c2782170 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c | |||
@@ -403,11 +403,15 @@ static int radeon_pmops_runtime_suspend(struct device *dev) | |||
403 | struct drm_device *drm_dev = pci_get_drvdata(pdev); | 403 | struct drm_device *drm_dev = pci_get_drvdata(pdev); |
404 | int ret; | 404 | int ret; |
405 | 405 | ||
406 | if (radeon_runtime_pm == 0) | 406 | if (radeon_runtime_pm == 0) { |
407 | return -EINVAL; | 407 | pm_runtime_forbid(dev); |
408 | return -EBUSY; | ||
409 | } | ||
408 | 410 | ||
409 | if (radeon_runtime_pm == -1 && !radeon_is_px()) | 411 | if (radeon_runtime_pm == -1 && !radeon_is_px()) { |
410 | return -EINVAL; | 412 | pm_runtime_forbid(dev); |
413 | return -EBUSY; | ||
414 | } | ||
411 | 415 | ||
412 | drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; | 416 | drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; |
413 | drm_kms_helper_poll_disable(drm_dev); | 417 | drm_kms_helper_poll_disable(drm_dev); |
@@ -456,12 +460,15 @@ static int radeon_pmops_runtime_idle(struct device *dev) | |||
456 | struct drm_device *drm_dev = pci_get_drvdata(pdev); | 460 | struct drm_device *drm_dev = pci_get_drvdata(pdev); |
457 | struct drm_crtc *crtc; | 461 | struct drm_crtc *crtc; |
458 | 462 | ||
459 | if (radeon_runtime_pm == 0) | 463 | if (radeon_runtime_pm == 0) { |
464 | pm_runtime_forbid(dev); | ||
460 | return -EBUSY; | 465 | return -EBUSY; |
466 | } | ||
461 | 467 | ||
462 | /* are we PX enabled? */ | 468 | /* are we PX enabled? */ |
463 | if (radeon_runtime_pm == -1 && !radeon_is_px()) { | 469 | if (radeon_runtime_pm == -1 && !radeon_is_px()) { |
464 | DRM_DEBUG_DRIVER("failing to power off - not px\n"); | 470 | DRM_DEBUG_DRIVER("failing to power off - not px\n"); |
471 | pm_runtime_forbid(dev); | ||
465 | return -EBUSY; | 472 | return -EBUSY; |
466 | } | 473 | } |
467 | 474 | ||
diff --git a/drivers/gpu/drm/udl/udl_gem.c b/drivers/gpu/drm/udl/udl_gem.c index 8d67b943ac05..0394811251bd 100644 --- a/drivers/gpu/drm/udl/udl_gem.c +++ b/drivers/gpu/drm/udl/udl_gem.c | |||
@@ -177,8 +177,10 @@ void udl_gem_free_object(struct drm_gem_object *gem_obj) | |||
177 | if (obj->vmapping) | 177 | if (obj->vmapping) |
178 | udl_gem_vunmap(obj); | 178 | udl_gem_vunmap(obj); |
179 | 179 | ||
180 | if (gem_obj->import_attach) | 180 | if (gem_obj->import_attach) { |
181 | drm_prime_gem_destroy(gem_obj, obj->sg); | 181 | drm_prime_gem_destroy(gem_obj, obj->sg); |
182 | put_device(gem_obj->dev->dev); | ||
183 | } | ||
182 | 184 | ||
183 | if (obj->pages) | 185 | if (obj->pages) |
184 | udl_gem_put_pages(obj); | 186 | udl_gem_put_pages(obj); |
@@ -256,9 +258,12 @@ struct drm_gem_object *udl_gem_prime_import(struct drm_device *dev, | |||
256 | int ret; | 258 | int ret; |
257 | 259 | ||
258 | /* need to attach */ | 260 | /* need to attach */ |
261 | get_device(dev->dev); | ||
259 | attach = dma_buf_attach(dma_buf, dev->dev); | 262 | attach = dma_buf_attach(dma_buf, dev->dev); |
260 | if (IS_ERR(attach)) | 263 | if (IS_ERR(attach)) { |
264 | put_device(dev->dev); | ||
261 | return ERR_CAST(attach); | 265 | return ERR_CAST(attach); |
266 | } | ||
262 | 267 | ||
263 | get_dma_buf(dma_buf); | 268 | get_dma_buf(dma_buf); |
264 | 269 | ||
@@ -282,6 +287,6 @@ fail_unmap: | |||
282 | fail_detach: | 287 | fail_detach: |
283 | dma_buf_detach(dma_buf, attach); | 288 | dma_buf_detach(dma_buf, attach); |
284 | dma_buf_put(dma_buf); | 289 | dma_buf_put(dma_buf); |
285 | 290 | put_device(dev->dev); | |
286 | return ERR_PTR(ret); | 291 | return ERR_PTR(ret); |
287 | } | 292 | } |