diff options
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_execbuffer.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_execbuffer.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index 7941f1fe9cd2..1978633e7549 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c | |||
@@ -1142,7 +1142,7 @@ i915_reset_gen7_sol_offsets(struct drm_device *dev, | |||
1142 | struct drm_i915_gem_request *req) | 1142 | struct drm_i915_gem_request *req) |
1143 | { | 1143 | { |
1144 | struct intel_engine_cs *engine = req->engine; | 1144 | struct intel_engine_cs *engine = req->engine; |
1145 | struct drm_i915_private *dev_priv = dev->dev_private; | 1145 | struct drm_i915_private *dev_priv = to_i915(dev); |
1146 | int ret, i; | 1146 | int ret, i; |
1147 | 1147 | ||
1148 | if (!IS_GEN7(dev) || engine != &dev_priv->engine[RCS]) { | 1148 | if (!IS_GEN7(dev) || engine != &dev_priv->engine[RCS]) { |
@@ -1225,7 +1225,7 @@ i915_gem_ringbuffer_submission(struct i915_execbuffer_params *params, | |||
1225 | { | 1225 | { |
1226 | struct drm_device *dev = params->dev; | 1226 | struct drm_device *dev = params->dev; |
1227 | struct intel_engine_cs *engine = params->engine; | 1227 | struct intel_engine_cs *engine = params->engine; |
1228 | struct drm_i915_private *dev_priv = dev->dev_private; | 1228 | struct drm_i915_private *dev_priv = to_i915(dev); |
1229 | u64 exec_start, exec_len; | 1229 | u64 exec_start, exec_len; |
1230 | int instp_mode; | 1230 | int instp_mode; |
1231 | u32 instp_mask; | 1231 | u32 instp_mask; |
@@ -1328,10 +1328,10 @@ gen8_dispatch_bsd_ring(struct drm_i915_private *dev_priv, struct drm_file *file) | |||
1328 | /* Check whether the file_priv has already selected one ring. */ | 1328 | /* Check whether the file_priv has already selected one ring. */ |
1329 | if ((int)file_priv->bsd_ring < 0) { | 1329 | if ((int)file_priv->bsd_ring < 0) { |
1330 | /* If not, use the ping-pong mechanism to select one. */ | 1330 | /* If not, use the ping-pong mechanism to select one. */ |
1331 | mutex_lock(&dev_priv->dev->struct_mutex); | 1331 | mutex_lock(&dev_priv->drm.struct_mutex); |
1332 | file_priv->bsd_ring = dev_priv->mm.bsd_ring_dispatch_index; | 1332 | file_priv->bsd_ring = dev_priv->mm.bsd_ring_dispatch_index; |
1333 | dev_priv->mm.bsd_ring_dispatch_index ^= 1; | 1333 | dev_priv->mm.bsd_ring_dispatch_index ^= 1; |
1334 | mutex_unlock(&dev_priv->dev->struct_mutex); | 1334 | mutex_unlock(&dev_priv->drm.struct_mutex); |
1335 | } | 1335 | } |
1336 | 1336 | ||
1337 | return file_priv->bsd_ring; | 1337 | return file_priv->bsd_ring; |
@@ -1477,6 +1477,12 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, | |||
1477 | dispatch_flags |= I915_DISPATCH_RS; | 1477 | dispatch_flags |= I915_DISPATCH_RS; |
1478 | } | 1478 | } |
1479 | 1479 | ||
1480 | /* Take a local wakeref for preparing to dispatch the execbuf as | ||
1481 | * we expect to access the hardware fairly frequently in the | ||
1482 | * process. Upon first dispatch, we acquire another prolonged | ||
1483 | * wakeref that we hold until the GPU has been idle for at least | ||
1484 | * 100ms. | ||
1485 | */ | ||
1480 | intel_runtime_pm_get(dev_priv); | 1486 | intel_runtime_pm_get(dev_priv); |
1481 | 1487 | ||
1482 | ret = i915_mutex_lock_interruptible(dev); | 1488 | ret = i915_mutex_lock_interruptible(dev); |