intel/perf: Enable MDAPI queries for Gen12
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 16 Apr 2020 10:03:47 +0000 (13:03 +0300)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Fri, 17 Apr 2020 23:04:09 +0000 (02:04 +0300)
We're missing the cases for gen12 leading to those metrics going
missing.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 15b7b56eb2fb41 ("intel/perf: add TGL support")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4586>

src/intel/perf/gen_perf_mdapi.c
src/intel/perf/gen_perf_query.c

index 33d05f07443d3865863ed512c8bfcf8dceebf0fe..ade50678e121fc06633ca80c19af61ff496fb105 100644 (file)
@@ -93,7 +93,8 @@ gen_perf_query_result_write_mdapi(void *data, uint32_t data_size,
    }
    case 9:
    case 10:
-   case 11: {
+   case 11:
+   case 12:{
       struct gen9_mdapi_metrics *mdapi_data = (struct gen9_mdapi_metrics *) data;
 
       if (data_size < sizeof(*mdapi_data))
@@ -131,7 +132,7 @@ void
 gen_perf_register_mdapi_statistic_query(struct gen_perf_config *perf_cfg,
                                         const struct gen_device_info *devinfo)
 {
-   if (!(devinfo->gen >= 7 && devinfo->gen <= 11))
+   if (!(devinfo->gen >= 7 && devinfo->gen <= 12))
       return;
 
    struct gen_perf_query_info *query =
@@ -226,9 +227,9 @@ gen_perf_register_mdapi_oa_query(struct gen_perf_config *perf,
    struct gen_perf_query_info *query = NULL;
 
    /* MDAPI requires different structures for pretty much every generation
-    * (right now we have definitions for gen 7 to 11).
+    * (right now we have definitions for gen 7 to 12).
     */
-   if (!(devinfo->gen >= 7 && devinfo->gen <= 11))
+   if (!(devinfo->gen >= 7 && devinfo->gen <= 12))
       return;
 
    switch (devinfo->gen) {
@@ -294,7 +295,8 @@ gen_perf_register_mdapi_oa_query(struct gen_perf_config *perf,
    }
    case 9:
    case 10:
-   case 11: {
+   case 11:
+   case 12: {
       query = gen_perf_append_query_info(perf, 2 + 36 + 16 + 16 + 16 + 2);
       query->oa_format = I915_OA_FORMAT_A32u40_A4u32_B8_C8;
 
index 1d6743d415322facd615a6febd370a2cc2b02e98..3ad511b0e0083895172665337039a687b1474cc2 100644 (file)
@@ -1413,6 +1413,7 @@ read_gt_frequency(struct gen_perf_context *perf_ctx,
    case 9:
    case 10:
    case 11:
+   case 12:
       obj->oa.gt_frequency[0] = GET_FIELD(start, GEN9_RPSTAT0_CURR_GT_FREQ) * 50ULL / 3ULL;
       obj->oa.gt_frequency[1] = GET_FIELD(end, GEN9_RPSTAT0_CURR_GT_FREQ) * 50ULL / 3ULL;
       break;