i965/vec4: Make with_writemask() non-static.
[mesa.git] / src / mesa / drivers / dri / i965 / brw_queryobj.c
index 9d6ec2c8ece8973c5395b03fd274beb85f83cef1..2d6dd1ebfd02be62ec84f2e1a567264df22cd91c 100644 (file)
 static void
 write_timestamp(struct brw_context *brw, drm_intel_bo *query_bo, int idx)
 {
-   struct intel_context *intel = &brw->intel;
-   if (intel->gen >= 6) {
+   if (brw->gen >= 6) {
       /* Emit workaround flushes: */
-      if (intel->gen == 6) {
+      if (brw->gen == 6) {
          /* The timestamp write below is a non-zero post-sync op, which on
           * Gen6 necessitates a CS stall.  CS stalls need stall at scoreboard
           * set.  See the comments for intel_emit_post_sync_nonzero_flush().
@@ -95,8 +94,7 @@ write_timestamp(struct brw_context *brw, drm_intel_bo *query_bo, int idx)
 static void
 write_depth_count(struct brw_context *brw, drm_intel_bo *query_bo, int idx)
 {
-   struct intel_context *intel = &brw->intel;
-   assert(intel->gen < 6);
+   assert(brw->gen < 6);
 
    BEGIN_BATCH(4);
    OUT_BATCH(_3DSTATE_PIPE_CONTROL | (4 - 2) |
@@ -123,12 +121,11 @@ brw_queryobj_get_results(struct gl_context *ctx,
                         struct brw_query_object *query)
 {
    struct brw_context *brw = brw_context(ctx);
-   struct intel_context *intel = intel_context(ctx);
 
    int i;
    uint64_t *results;
 
-   assert(intel->gen < 6);
+   assert(brw->gen < 6);
 
    if (query->bo == NULL)
       return;
@@ -137,10 +134,10 @@ brw_queryobj_get_results(struct gl_context *ctx,
     * still contributing to it, flush it now so the results will be present
     * when mapped.
     */
-   if (drm_intel_bo_references(intel->batch.bo, query->bo))
+   if (drm_intel_bo_references(brw->batch.bo, query->bo))
       intel_batchbuffer_flush(brw);
 
-   if (unlikely(intel->perf_debug)) {
+   if (unlikely(brw->perf_debug)) {
       if (drm_intel_bo_busy(query->bo)) {
          perf_debug("Stalling on the GPU waiting for a query object.\n");
       }
@@ -245,10 +242,9 @@ static void
 brw_begin_query(struct gl_context *ctx, struct gl_query_object *q)
 {
    struct brw_context *brw = brw_context(ctx);
-   struct intel_context *intel = intel_context(ctx);
    struct brw_query_object *query = (struct brw_query_object *)q;
 
-   assert(intel->gen < 6);
+   assert(brw->gen < 6);
 
    switch (query->Base.Target) {
    case GL_TIME_ELAPSED_EXT:
@@ -296,7 +292,7 @@ brw_begin_query(struct gl_context *ctx, struct gl_query_object *q)
        * avoid them when necessary.  They're required for occlusion queries,
        * so turn them on now.
        */
-      intel->stats_wm++;
+      brw->stats_wm++;
       brw->state.dirty.brw |= BRW_NEW_STATS_WM;
       break;
 
@@ -318,10 +314,9 @@ static void
 brw_end_query(struct gl_context *ctx, struct gl_query_object *q)
 {
    struct brw_context *brw = brw_context(ctx);
-   struct intel_context *intel = intel_context(ctx);
    struct brw_query_object *query = (struct brw_query_object *)q;
 
-   assert(intel->gen < 6);
+   assert(brw->gen < 6);
 
    switch (query->Base.Target) {
    case GL_TIME_ELAPSED_EXT:
@@ -355,7 +350,7 @@ brw_end_query(struct gl_context *ctx, struct gl_query_object *q)
 
       brw->query.obj = NULL;
 
-      intel->stats_wm--;
+      brw->stats_wm--;
       brw->state.dirty.brw |= BRW_NEW_STATS_WM;
       break;
 
@@ -375,7 +370,7 @@ static void brw_wait_query(struct gl_context *ctx, struct gl_query_object *q)
 {
    struct brw_query_object *query = (struct brw_query_object *)q;
 
-   assert(intel_context(ctx)->gen < 6);
+   assert(brw_context(ctx)->gen < 6);
 
    brw_queryobj_get_results(ctx, query);
    query->Base.Ready = true;
@@ -390,10 +385,9 @@ static void brw_wait_query(struct gl_context *ctx, struct gl_query_object *q)
 static void brw_check_query(struct gl_context *ctx, struct gl_query_object *q)
 {
    struct brw_context *brw = brw_context(ctx);
-   struct intel_context *intel = intel_context(ctx);
    struct brw_query_object *query = (struct brw_query_object *)q;
 
-   assert(intel->gen < 6);
+   assert(brw->gen < 6);
 
    /* From the GL_ARB_occlusion_query spec:
     *
@@ -402,7 +396,7 @@ static void brw_check_query(struct gl_context *ctx, struct gl_query_object *q)
     *      not ready yet on the first time it is queried.  This ensures that
     *      the async query will return true in finite time.
     */
-   if (query->bo && drm_intel_bo_references(intel->batch.bo, query->bo))
+   if (query->bo && drm_intel_bo_references(brw->batch.bo, query->bo))
       intel_batchbuffer_flush(brw);
 
    if (query->bo == NULL || !drm_intel_bo_busy(query->bo)) {
@@ -421,9 +415,8 @@ static void
 ensure_bo_has_space(struct gl_context *ctx, struct brw_query_object *query)
 {
    struct brw_context *brw = brw_context(ctx);
-   struct intel_context *intel = intel_context(ctx);
 
-   assert(intel->gen < 6);
+   assert(brw->gen < 6);
 
    if (!query->bo || query->last_index * 2 + 1 >= 4096 / sizeof(uint64_t)) {
 
@@ -463,11 +456,10 @@ ensure_bo_has_space(struct gl_context *ctx, struct brw_query_object *query)
 void
 brw_emit_query_begin(struct brw_context *brw)
 {
-   struct intel_context *intel = &brw->intel;
-   struct gl_context *ctx = &intel->ctx;
+   struct gl_context *ctx = &brw->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 +484,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)