igt/gem_ppgtt: Create secondary contexts and mm

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson
2014-09-09 16:27:57 +01:00
parent 961578f471
commit 107151ce9f
3 changed files with 51 additions and 6 deletions
+14 -1
View File
@@ -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