Skip to contentSkip to conversation

drm/i915: get runtime PM reference around GEM set_tiling IOCTL

PATCH In review Imre Deak 2 participants 3 messages Nov 9, 2015 – Nov 17, 2015

Subsystems (2)
lore
Share & tools
lore

Imre Deak

author
#0 lore raw

PATCH 1/1 drm/i915: get runtime PM reference around GEM set_tiling IOCTL

After fixing the same issue in the set_caching IOCTL and Chris' request to check out the possibilities for an improved RPM ref handling I noticed that we have the same issue in the set_tiling IOCTL. Fix this up.I didn't see any bug reports about this one, but the GTT unbind operation on this path accesses the HW, which needs the ref.

---
 drivers/gpu/drm/i915/i915_gem_tiling.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/i915_gem_tiling.c +4 -0
index 8a6717c..7410f6c 100644
@@ -176,6 +176,8 @@ i915_gem_set_tiling(struct drm_device *dev, void *data,
 		return -EINVAL;
 	}
 
+	intel_runtime_pm_get(dev_priv);
+
 	mutex_lock(&dev->struct_mutex);
 	if (obj->pin_display || obj->framebuffer_references) {
 		ret = -EBUSY;
@@ -269,6 +271,8 @@ err:
 	drm_gem_object_unreference(&obj->base);
 	mutex_unlock(&dev->struct_mutex);
 
+	intel_runtime_pm_put(dev_priv);
+
 	return ret;
 }
 
Signature · 6 lines
2.5.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Imre Deak

After fixing the same issue in the set_caching IOCTL and Chris' request to check out the possibilities for an improved RPM ref handling I noticed that we have the same issue in the set_tiling IOCTL. Fix this up.I didn't see any bug reports about this one, but the GTT unbind operation on this path accesses the HW, which needs the ref.

The reason why we haven't seen a bug report is that we don't get the GTT mismatch on gen4+ devices (i.e. those with runtime pm). However, for the sake of completeness, it is better to wrap all the GGTT unbind access in the rpm reference (and future patches to reduce the wakelock will be more consistent).

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
author Applied
#2 lore raw
Quoted 20 lines · Chris Wilson
Quoted 9 lines · Imre Deak

After fixing the same issue in the set_caching IOCTL and Chris' request
to check out the possibilities for an improved RPM ref handling I noticed that we have the same issue in the set_tiling IOCTL. Fix this
up.I didn't see any bug reports about this one, but the GTT unbind operation on this path accesses the HW, which needs the ref.

The reason why we haven't seen a bug report is that we don't get the GTT
mismatch on gen4+ devices (i.e. those with runtime pm). However, for the
sake of completeness, it is better to wrap all the GGTT unbind access in
the rpm reference (and future patches to reduce the wakelock will be more consistent).

Quoted 1 line

Pushed to dinq. Thanks for the review.

Quoted 2 lines

-Chris

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx