diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-09-09 16:27:57 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-09-09 16:28:36 +0100 |
commit | 107151ce9f82955191a7fd6a2e6bfd5ff8cc5aea (patch) | |
tree | f4cffab61eb0c3f501faec43643ba1b5244455f6 /lib/intel_batchbuffer.c | |
parent | 961578f47133d7310e9531d31e7ea5e743ed6b50 (diff) |
igt/gem_ppgtt: Create secondary contexts and mm
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/intel_batchbuffer.c')
-rw-r--r-- | lib/intel_batchbuffer.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c index 9408ad9e..952b86af 100644 --- a/lib/intel_batchbuffer.c +++ b/lib/intel_batchbuffer.c @@ -79,6 +79,7 @@ intel_batchbuffer_reset(struct intel_batchbuffer *batch) BATCH_SZ, 4096); memset(batch->buffer, 0, sizeof(batch->buffer)); + batch->ctx = NULL; batch->ptr = batch->buffer; batch->end = NULL; @@ -163,6 +164,7 @@ void intel_batchbuffer_flush_on_ring(struct intel_batchbuffer *batch, int ring) { unsigned int used = flush_on_ring_common(batch, ring); + drm_intel_context *ctx; if (used == 0) return; @@ -171,11 +173,22 @@ intel_batchbuffer_flush_on_ring(struct intel_batchbuffer *batch, int ring) batch->ptr = NULL; - do_or_die(drm_intel_bo_mrb_exec(batch->bo, used, NULL, 0, 0, ring)); + /* XXX bad kernel API */ + ctx = batch->ctx; + if (ring != I915_EXEC_RENDER) + ctx = NULL; + do_or_die(drm_intel_gem_bo_context_exec(batch->bo, ctx, used, ring)); intel_batchbuffer_reset(batch); } +void +intel_batchbuffer_set_context(struct intel_batchbuffer *batch, + drm_intel_context *context) +{ + batch->ctx = context; +} + /** * intel_batchbuffer_flush_with_context: * @batch: batchbuffer object |