diff options
author | Kenneth Graunke <[email protected]> | 2017-08-30 00:47:03 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2017-09-14 16:17:36 -0700 |
commit | 3b812e62a19859c9cb28455ac4195fa1365ce9e1 (patch) | |
tree | 66f916497704442661c513c767233406462a3a7a /src/mesa | |
parent | 717e7539124dc459276385a02847b06ea1989973 (diff) |
i965: Drop a useless ret == 0 check.
Prior to the previous patch, we would pwrite the batchbuffer contents,
and wanted to skip the execbuffer if that failed. Now that we memcpy,
we don't set ret != 0 on failure anymore, so it will always be 0.
Reviewed-by: Matt Turner <[email protected]>
Reviewed-by: Chris Wilson <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_batchbuffer.c | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c index 9cd491b5ace..95ce4be3c11 100644 --- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c @@ -662,31 +662,29 @@ do_flush_locked(struct brw_context *brw, int in_fence_fd, int *out_fence_fd) if (batch->needs_sol_reset) flags |= I915_EXEC_GEN7_SOL_RESET; - if (ret == 0) { - uint32_t hw_ctx = batch->ring == RENDER_RING ? brw->hw_ctx : 0; - - struct drm_i915_gem_exec_object2 *entry = &batch->validation_list[0]; - assert(entry->handle == batch->bo->gem_handle); - entry->relocation_count = batch->reloc_count; - entry->relocs_ptr = (uintptr_t) batch->relocs; - - if (batch->use_batch_first) { - flags |= I915_EXEC_BATCH_FIRST | I915_EXEC_HANDLE_LUT; - } else { - /* Move the batch to the end of the validation list */ - struct drm_i915_gem_exec_object2 tmp; - const unsigned index = batch->exec_count - 1; - - tmp = *entry; - *entry = batch->validation_list[index]; - batch->validation_list[index] = tmp; - } + uint32_t hw_ctx = batch->ring == RENDER_RING ? brw->hw_ctx : 0; + + struct drm_i915_gem_exec_object2 *entry = &batch->validation_list[0]; + assert(entry->handle == batch->bo->gem_handle); + entry->relocation_count = batch->reloc_count; + entry->relocs_ptr = (uintptr_t) batch->relocs; - ret = execbuffer(dri_screen->fd, batch, hw_ctx, - 4 * USED_BATCH(*batch), - in_fence_fd, out_fence_fd, flags); + if (batch->use_batch_first) { + flags |= I915_EXEC_BATCH_FIRST | I915_EXEC_HANDLE_LUT; + } else { + /* Move the batch to the end of the validation list */ + struct drm_i915_gem_exec_object2 tmp; + const unsigned index = batch->exec_count - 1; + + tmp = *entry; + *entry = batch->validation_list[index]; + batch->validation_list[index] = tmp; } + ret = execbuffer(dri_screen->fd, batch, hw_ctx, + 4 * USED_BATCH(*batch), + in_fence_fd, out_fence_fd, flags); + throttle(brw); } |