diff options
-rw-r--r-- | drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c index 1f423bb2d644..8237b2935b5f 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | |||
@@ -297,7 +297,8 @@ static inline u64 gen8_noncanonical_addr(u64 address) | |||
297 | static inline bool eb_use_cmdparser(const struct i915_execbuffer *eb) | 297 | static inline bool eb_use_cmdparser(const struct i915_execbuffer *eb) |
298 | { | 298 | { |
299 | return intel_engine_requires_cmd_parser(eb->engine) || | 299 | return intel_engine_requires_cmd_parser(eb->engine) || |
300 | (intel_engine_using_cmd_parser(eb->engine) && eb->batch_len); | 300 | (intel_engine_using_cmd_parser(eb->engine) && |
301 | eb->args->batch_len); | ||
301 | } | 302 | } |
302 | 303 | ||
303 | static int eb_create(struct i915_execbuffer *eb) | 304 | static int eb_create(struct i915_execbuffer *eb) |
@@ -2577,6 +2578,9 @@ i915_gem_do_execbuffer(struct drm_device *dev, | |||
2577 | goto err_vma; | 2578 | goto err_vma; |
2578 | } | 2579 | } |
2579 | 2580 | ||
2581 | if (eb.batch_len == 0) | ||
2582 | eb.batch_len = eb.batch->size - eb.batch_start_offset; | ||
2583 | |||
2580 | if (eb_use_cmdparser(&eb)) { | 2584 | if (eb_use_cmdparser(&eb)) { |
2581 | struct i915_vma *vma; | 2585 | struct i915_vma *vma; |
2582 | 2586 | ||
@@ -2587,9 +2591,6 @@ i915_gem_do_execbuffer(struct drm_device *dev, | |||
2587 | } | 2591 | } |
2588 | } | 2592 | } |
2589 | 2593 | ||
2590 | if (eb.batch_len == 0) | ||
2591 | eb.batch_len = eb.batch->size - eb.batch_start_offset; | ||
2592 | |||
2593 | /* | 2594 | /* |
2594 | * snb/ivb/vlv conflate the "batch in ppgtt" bit with the "non-secure | 2595 | * snb/ivb/vlv conflate the "batch in ppgtt" bit with the "non-secure |
2595 | * batch" bit. Hence we need to pin secure batches into the global gtt. | 2596 | * batch" bit. Hence we need to pin secure batches into the global gtt. |