Commit 1fac1fa9 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 350bb4be 8ee661b5
...@@ -842,7 +842,7 @@ void i915_gem_suspend_gtt_mappings(struct drm_device *dev) ...@@ -842,7 +842,7 @@ void i915_gem_suspend_gtt_mappings(struct drm_device *dev)
dev_priv->gtt.base.clear_range(&dev_priv->gtt.base, dev_priv->gtt.base.clear_range(&dev_priv->gtt.base,
dev_priv->gtt.base.start / PAGE_SIZE, dev_priv->gtt.base.start / PAGE_SIZE,
dev_priv->gtt.base.total / PAGE_SIZE, dev_priv->gtt.base.total / PAGE_SIZE,
false); true);
} }
void i915_gem_restore_gtt_mappings(struct drm_device *dev) void i915_gem_restore_gtt_mappings(struct drm_device *dev)
......
...@@ -866,13 +866,16 @@ static int nouveau_pmops_runtime_suspend(struct device *dev) ...@@ -866,13 +866,16 @@ static int nouveau_pmops_runtime_suspend(struct device *dev)
struct drm_device *drm_dev = pci_get_drvdata(pdev); struct drm_device *drm_dev = pci_get_drvdata(pdev);
int ret; int ret;
if (nouveau_runtime_pm == 0) if (nouveau_runtime_pm == 0) {
return -EINVAL; pm_runtime_forbid(dev);
return -EBUSY;
}
/* are we optimus enabled? */ /* are we optimus enabled? */
if (nouveau_runtime_pm == -1 && !nouveau_is_optimus() && !nouveau_is_v1_dsm()) { if (nouveau_runtime_pm == -1 && !nouveau_is_optimus() && !nouveau_is_v1_dsm()) {
DRM_DEBUG_DRIVER("failing to power off - not optimus\n"); DRM_DEBUG_DRIVER("failing to power off - not optimus\n");
return -EINVAL; pm_runtime_forbid(dev);
return -EBUSY;
} }
nv_debug_level(SILENT); nv_debug_level(SILENT);
...@@ -923,12 +926,15 @@ static int nouveau_pmops_runtime_idle(struct device *dev) ...@@ -923,12 +926,15 @@ static int nouveau_pmops_runtime_idle(struct device *dev)
struct nouveau_drm *drm = nouveau_drm(drm_dev); struct nouveau_drm *drm = nouveau_drm(drm_dev);
struct drm_crtc *crtc; struct drm_crtc *crtc;
if (nouveau_runtime_pm == 0) if (nouveau_runtime_pm == 0) {
pm_runtime_forbid(dev);
return -EBUSY; return -EBUSY;
}
/* are we optimus enabled? */ /* are we optimus enabled? */
if (nouveau_runtime_pm == -1 && !nouveau_is_optimus() && !nouveau_is_v1_dsm()) { if (nouveau_runtime_pm == -1 && !nouveau_is_optimus() && !nouveau_is_v1_dsm()) {
DRM_DEBUG_DRIVER("failing to power off - not optimus\n"); DRM_DEBUG_DRIVER("failing to power off - not optimus\n");
pm_runtime_forbid(dev);
return -EBUSY; return -EBUSY;
} }
......
...@@ -403,11 +403,15 @@ static int radeon_pmops_runtime_suspend(struct device *dev) ...@@ -403,11 +403,15 @@ static int radeon_pmops_runtime_suspend(struct device *dev)
struct drm_device *drm_dev = pci_get_drvdata(pdev); struct drm_device *drm_dev = pci_get_drvdata(pdev);
int ret; int ret;
if (radeon_runtime_pm == 0) if (radeon_runtime_pm == 0) {
return -EINVAL; pm_runtime_forbid(dev);
return -EBUSY;
}
if (radeon_runtime_pm == -1 && !radeon_is_px()) if (radeon_runtime_pm == -1 && !radeon_is_px()) {
return -EINVAL; pm_runtime_forbid(dev);
return -EBUSY;
}
drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
drm_kms_helper_poll_disable(drm_dev); drm_kms_helper_poll_disable(drm_dev);
...@@ -456,12 +460,15 @@ static int radeon_pmops_runtime_idle(struct device *dev) ...@@ -456,12 +460,15 @@ static int radeon_pmops_runtime_idle(struct device *dev)
struct drm_device *drm_dev = pci_get_drvdata(pdev); struct drm_device *drm_dev = pci_get_drvdata(pdev);
struct drm_crtc *crtc; struct drm_crtc *crtc;
if (radeon_runtime_pm == 0) if (radeon_runtime_pm == 0) {
pm_runtime_forbid(dev);
return -EBUSY; return -EBUSY;
}
/* are we PX enabled? */ /* are we PX enabled? */
if (radeon_runtime_pm == -1 && !radeon_is_px()) { if (radeon_runtime_pm == -1 && !radeon_is_px()) {
DRM_DEBUG_DRIVER("failing to power off - not px\n"); DRM_DEBUG_DRIVER("failing to power off - not px\n");
pm_runtime_forbid(dev);
return -EBUSY; return -EBUSY;
} }
......
...@@ -177,8 +177,10 @@ void udl_gem_free_object(struct drm_gem_object *gem_obj) ...@@ -177,8 +177,10 @@ void udl_gem_free_object(struct drm_gem_object *gem_obj)
if (obj->vmapping) if (obj->vmapping)
udl_gem_vunmap(obj); udl_gem_vunmap(obj);
if (gem_obj->import_attach) if (gem_obj->import_attach) {
drm_prime_gem_destroy(gem_obj, obj->sg); drm_prime_gem_destroy(gem_obj, obj->sg);
put_device(gem_obj->dev->dev);
}
if (obj->pages) if (obj->pages)
udl_gem_put_pages(obj); udl_gem_put_pages(obj);
...@@ -256,9 +258,12 @@ struct drm_gem_object *udl_gem_prime_import(struct drm_device *dev, ...@@ -256,9 +258,12 @@ struct drm_gem_object *udl_gem_prime_import(struct drm_device *dev,
int ret; int ret;
/* need to attach */ /* need to attach */
get_device(dev->dev);
attach = dma_buf_attach(dma_buf, dev->dev); attach = dma_buf_attach(dma_buf, dev->dev);
if (IS_ERR(attach)) if (IS_ERR(attach)) {
put_device(dev->dev);
return ERR_CAST(attach); return ERR_CAST(attach);
}
get_dma_buf(dma_buf); get_dma_buf(dma_buf);
...@@ -282,6 +287,6 @@ struct drm_gem_object *udl_gem_prime_import(struct drm_device *dev, ...@@ -282,6 +287,6 @@ struct drm_gem_object *udl_gem_prime_import(struct drm_device *dev,
fail_detach: fail_detach:
dma_buf_detach(dma_buf, attach); dma_buf_detach(dma_buf, attach);
dma_buf_put(dma_buf); dma_buf_put(dma_buf);
put_device(dev->dev);
return ERR_PTR(ret); return ERR_PTR(ret);
} }
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