i965: Move intel_context::hw_ctx to brw_context.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 3 Jul 2013 21:12:41 +0000 (14:12 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 9 Jul 2013 21:09:07 +0000 (14:09 -0700)
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_queryobj.c
src/mesa/drivers/dri/i965/brw_state_upload.c
src/mesa/drivers/dri/i965/brw_vtbl.c
src/mesa/drivers/dri/i965/intel_batchbuffer.c
src/mesa/drivers/dri/i965/intel_context.h

index 0b3dc35b4ba6b9041afc417afd8f84ed4d38d625..d170b24b76c2fa5b0c6efd14a0e3c0c5ce1421a0 100644 (file)
@@ -321,9 +321,9 @@ brwCreateContext(int api,
        * This is required for transform feedback buffer offsets, query objects,
        * and also allows us to reduce how much state we have to emit.
        */
-      intel->hw_ctx = drm_intel_gem_context_create(brw->bufmgr);
+      brw->hw_ctx = drm_intel_gem_context_create(brw->bufmgr);
 
-      if (!intel->hw_ctx) {
+      if (!brw->hw_ctx) {
          fprintf(stderr, "Gen6+ requires Kernel 3.6 or later.\n");
          ralloc_free(brw);
          return false;
index c2ace5d876a772825c786ef56d8a86ad0df6099e..414a009c68ff379706cd7e65932477ecf127f775 100644 (file)
@@ -804,6 +804,8 @@ struct brw_context
 
    dri_bufmgr *bufmgr;
 
+   drm_intel_context *hw_ctx;
+
    /**
     * Set if rendering has occured to the drawable's front buffer.
     *
index 9d6ec2c8ece8973c5395b03fd274beb85f83cef1..8165320c127c66c75623472686c4c50ad0438dc1 100644 (file)
@@ -467,7 +467,7 @@ brw_emit_query_begin(struct brw_context *brw)
    struct gl_context *ctx = &intel->ctx;
    struct brw_query_object *query = brw->query.obj;
 
-   if (intel->hw_ctx)
+   if (brw->hw_ctx)
       return;
 
    /* Skip if we're not doing any queries, or we've already recorded the
@@ -492,10 +492,9 @@ brw_emit_query_begin(struct brw_context *brw)
 void
 brw_emit_query_end(struct brw_context *brw)
 {
-   struct intel_context *intel = &brw->intel;
    struct brw_query_object *query = brw->query.obj;
 
-   if (intel->hw_ctx)
+   if (brw->hw_ctx)
       return;
 
    if (!brw->query.begin_emitted)
index 2adf20396c5937d771e0af35fc88433248f8f6d6..bdb2862f55fe10432ebfa16175320f47bf0a3b20 100644 (file)
@@ -243,7 +243,7 @@ brw_upload_initial_gpu_state(struct brw_context *brw)
     * right away rather than doing it via state atoms.  This saves a small
     * amount of overhead on every draw call.
     */
-   if (!intel->hw_ctx)
+   if (!brw->hw_ctx)
       return;
 
    brw_upload_invariant_state(brw);
index a4b8ed3194b1f80a3de1b1da3ca0e01e73618cd9..d19ca0be5136016b48f7aff50f2f2d6edb0376bd 100644 (file)
@@ -69,7 +69,6 @@ dri_bo_release(drm_intel_bo **bo)
 static void
 brw_destroy_context(struct brw_context *brw)
 {
-   struct intel_context *intel = &brw->intel;
    if (INTEL_DEBUG & DEBUG_SHADER_TIME) {
       /* Force a report. */
       brw->shader_time.report_time = 0;
@@ -88,7 +87,7 @@ brw_destroy_context(struct brw_context *brw)
    free(brw->curbe.last_buf);
    free(brw->curbe.next_buf);
 
-   drm_intel_gem_context_destroy(intel->hw_ctx);
+   drm_intel_gem_context_destroy(brw->hw_ctx);
 }
 
 /**
@@ -126,7 +125,7 @@ brw_new_batch(struct brw_context *brw)
     * would otherwise be stored in the context (which for all intents and
     * purposes means everything).
     */
-   if (intel->hw_ctx == NULL)
+   if (brw->hw_ctx == NULL)
       brw->state.dirty.brw |= BRW_NEW_CONTEXT;
 
    brw->state.dirty.brw |= BRW_NEW_BATCH;
index ed97859c26363eaaf71840b426bbe280b4b84550..70a1270b1be554df4c637fb07e573505375f2530 100644 (file)
@@ -213,11 +213,11 @@ do_flush_locked(struct brw_context *brw)
       if (ret == 0) {
          if (unlikely(INTEL_DEBUG & DEBUG_AUB))
             brw_annotate_aub(brw);
-        if (intel->hw_ctx == NULL || batch->is_blit) {
+        if (brw->hw_ctx == NULL || batch->is_blit) {
            ret = drm_intel_bo_mrb_exec(batch->bo, 4 * batch->used, NULL, 0, 0,
                                        flags);
         } else {
-           ret = drm_intel_gem_bo_context_exec(batch->bo, intel->hw_ctx,
+           ret = drm_intel_gem_bo_context_exec(batch->bo, brw->hw_ctx,
                                                4 * batch->used, flags);
         }
       }
index 50b9c03aecc2a928bfef7eccef95105e827b7309..4ca5081f9ab8f39c1c6e5dc1a3205aa45a233148 100644 (file)
@@ -129,8 +129,6 @@ struct intel_context
    bool has_llc;
    bool has_swizzling;
 
-   drm_intel_context *hw_ctx;
-
    struct intel_batchbuffer batch;
 
    drm_intel_bo *first_post_swapbuffers_batch;