summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/intel_batchbuffer.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2017-04-03 17:32:19 -0700
committerKenneth Graunke <[email protected]>2017-04-10 14:32:20 -0700
commitf5216b25e0c2aa16653c5951089ca5f8dfb9b00c (patch)
treea4839a5319da6da1521b0405820d3eb877a81c26 /src/mesa/drivers/dri/i965/intel_batchbuffer.c
parent4cb3e4429d3868ffa2078e4cf772578418028ed1 (diff)
i965: Just use a uint32_t context handle rather than a malloc'd wrapper.
drm_bacon_context is a malloc'd struct containing a uint32_t context ID and a pointer back to the bufmgr. The bufmgr pointer is pretty useless, as everybody already has brw->bufmgr. At that point...we may as well just use the ctx_id handle directly. A number of places already had to call drm_bacon_gem_context_get_id() to extract the ID anyway. Now they just have it. Reviewed-by: Chris Wilson <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/intel_batchbuffer.c')
-rw-r--r--src/mesa/drivers/dri/i965/intel_batchbuffer.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
index 56811278cee..020c04bbdeb 100644
--- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
@@ -384,7 +384,7 @@ brw_new_batch(struct brw_context *brw)
* would otherwise be stored in the context (which for all intents and
* purposes means everything).
*/
- if (brw->hw_ctx == NULL)
+ if (brw->hw_ctx == 0)
brw->ctx.NewDriverState |= BRW_NEW_CONTEXT;
brw->ctx.NewDriverState |= BRW_NEW_BATCH;
@@ -538,15 +538,12 @@ add_exec_bo(struct intel_batchbuffer *batch, drm_bacon_bo *bo)
static int
execbuffer(int fd,
struct intel_batchbuffer *batch,
- drm_bacon_context *ctx,
+ uint32_t ctx_id,
int used,
int in_fence,
int *out_fence,
int flags)
{
- uint32_t ctx_id = 0;
- drm_bacon_gem_context_get_id(ctx, &ctx_id);
-
struct drm_i915_gem_execbuffer2 execbuf = {
.buffers_ptr = (uintptr_t) batch->exec_objects,
.buffer_count = batch->exec_count,
@@ -623,7 +620,7 @@ do_flush_locked(struct brw_context *brw, int in_fence_fd, int *out_fence_fd)
flags |= I915_EXEC_GEN7_SOL_RESET;
if (ret == 0) {
- void *hw_ctx = batch->ring != RENDER_RING ? NULL : brw->hw_ctx;
+ uint32_t hw_ctx = batch->ring == RENDER_RING ? brw->hw_ctx : 0;
/* Add the batch itself to the end of the validation list */
add_exec_bo(batch, batch->bo);