i965: perf: default case for unknown query types
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 6 Feb 2018 17:29:32 +0000 (17:29 +0000)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 8 Mar 2018 23:05:00 +0000 (23:05 +0000)
Just some extra safety before further changes.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_performance_query.c

index 613e61653fe222eb1b586e5b6e37d30f7a95e32d..8cb9d8277aa05e1d416590726db193cba0488052 100644 (file)
@@ -341,6 +341,9 @@ dump_perf_query_callback(GLuint id, void *query_void, void *brw_void)
           o->Active ? "Active," : (o->Ready ? "Ready," : "Pending,"),
           obj->pipeline_stats.bo ? "yes" : "no");
       break;
+   default:
+      unreachable("Unknown query type");
+      break;
    }
 }
 
@@ -437,6 +440,10 @@ brw_get_perf_query_info(struct gl_context *ctx,
    case PIPELINE_STATS:
       *n_active = brw->perfquery.n_active_pipeline_stats_queries;
       break;
+
+   default:
+      unreachable("Unknown query type");
+      break;
    }
 }
 
@@ -1265,6 +1272,10 @@ brw_begin_perf_query(struct gl_context *ctx,
 
       ++brw->perfquery.n_active_pipeline_stats_queries;
       break;
+
+   default:
+      unreachable("Unknown query type");
+      break;
    }
 
    if (INTEL_DEBUG & DEBUG_PERFMON)
@@ -1321,6 +1332,10 @@ brw_end_perf_query(struct gl_context *ctx,
                                     STATS_BO_END_OFFSET_BYTES);
       --brw->perfquery.n_active_pipeline_stats_queries;
       break;
+
+   default:
+      unreachable("Unknown query type");
+      break;
    }
 }
 
@@ -1341,6 +1356,10 @@ brw_wait_perf_query(struct gl_context *ctx, struct gl_perf_query_object *o)
    case PIPELINE_STATS:
       bo = obj->pipeline_stats.bo;
       break;
+
+   default:
+      unreachable("Unknown query type");
+      break;
    }
 
    if (bo == NULL)
@@ -1386,9 +1405,12 @@ brw_is_perf_query_ready(struct gl_context *ctx,
       return (obj->pipeline_stats.bo &&
               !brw_batch_references(&brw->batch, obj->pipeline_stats.bo) &&
               !brw_bo_busy(obj->pipeline_stats.bo));
+
+   default:
+      unreachable("Unknown query type");
+      break;
    }
 
-   unreachable("missing ready check for unknown query kind");
    return false;
 }
 
@@ -1502,6 +1524,10 @@ brw_get_perf_query_data(struct gl_context *ctx,
    case PIPELINE_STATS:
       written = get_pipeline_stats_data(brw, obj, data_size, (uint8_t *)data);
       break;
+
+   default:
+      unreachable("Unknown query type");
+      break;
    }
 
    if (bytes_written)
@@ -1567,6 +1593,10 @@ brw_delete_perf_query(struct gl_context *ctx,
          obj->pipeline_stats.bo = NULL;
       }
       break;
+
+   default:
+      unreachable("Unknown query type");
+      break;
    }
 
    free(obj);