Commit cf67c70f authored by Paulo Zanoni's avatar Paulo Zanoni Committed by Daniel Vetter

drm/i915: get runtime PM at i915_reg_read_ioctl

To avoid WARNs when we call it.

Testcase: igt/pm_pc8/reg-read-ioctl
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75693Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent aa0b3b5b
...@@ -866,7 +866,7 @@ int i915_reg_read_ioctl(struct drm_device *dev, ...@@ -866,7 +866,7 @@ int i915_reg_read_ioctl(struct drm_device *dev,
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_i915_reg_read *reg = data; struct drm_i915_reg_read *reg = data;
struct register_whitelist const *entry = whitelist; struct register_whitelist const *entry = whitelist;
int i; int i, ret = 0;
for (i = 0; i < ARRAY_SIZE(whitelist); i++, entry++) { for (i = 0; i < ARRAY_SIZE(whitelist); i++, entry++) {
if (entry->offset == reg->offset && if (entry->offset == reg->offset &&
...@@ -877,6 +877,8 @@ int i915_reg_read_ioctl(struct drm_device *dev, ...@@ -877,6 +877,8 @@ int i915_reg_read_ioctl(struct drm_device *dev,
if (i == ARRAY_SIZE(whitelist)) if (i == ARRAY_SIZE(whitelist))
return -EINVAL; return -EINVAL;
intel_runtime_pm_get(dev_priv);
switch (entry->size) { switch (entry->size) {
case 8: case 8:
reg->val = I915_READ64(reg->offset); reg->val = I915_READ64(reg->offset);
...@@ -892,10 +894,13 @@ int i915_reg_read_ioctl(struct drm_device *dev, ...@@ -892,10 +894,13 @@ int i915_reg_read_ioctl(struct drm_device *dev,
break; break;
default: default:
WARN_ON(1); WARN_ON(1);
return -EINVAL; ret = -EINVAL;
goto out;
} }
return 0; out:
intel_runtime_pm_put(dev_priv);
return ret;
} }
int i915_get_reset_stats_ioctl(struct drm_device *dev, int i915_get_reset_stats_ioctl(struct drm_device *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