[Mesa-dev] [PATCH v2 5/5] i965: add a debug option to disable oa config loading

Lionel Landwerlin lionel.g.landwerlin at intel.com
Tue Aug 29 13:05:05 UTC 2017


This provides a good way to verify we haven't broken using the perf
driver on older kernels (which don't have the oa config loading
mechanism).

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
 src/intel/common/gen_debug.c                      | 1 +
 src/intel/common/gen_debug.h                      | 2 +-
 src/mesa/drivers/dri/i965/brw_performance_query.c | 3 ++-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/intel/common/gen_debug.c b/src/intel/common/gen_debug.c
index b604d56ef86..a17d628f577 100644
--- a/src/intel/common/gen_debug.c
+++ b/src/intel/common/gen_debug.c
@@ -57,6 +57,7 @@ static const struct debug_control debug_control[] = {
    { "vert",        DEBUG_VERTS },
    { "dri",         DEBUG_DRI },
    { "sf",          DEBUG_SF },
+   { "no-oaconfig", DEBUG_NO_OACONFIG },
    { "wm",          DEBUG_WM },
    { "urb",         DEBUG_URB },
    { "vs",          DEBUG_VS },
diff --git a/src/intel/common/gen_debug.h b/src/intel/common/gen_debug.h
index d290303682e..8c8cce4f846 100644
--- a/src/intel/common/gen_debug.h
+++ b/src/intel/common/gen_debug.h
@@ -57,7 +57,7 @@ extern uint64_t INTEL_DEBUG;
 #define DEBUG_VERTS               (1ull << 13)
 #define DEBUG_DRI                 (1ull << 14)
 #define DEBUG_SF                  (1ull << 15)
-/* Hole - feel free to reuse      (1ull << 16) */
+#define DEBUG_NO_OACONFIG         (1ull << 16)
 #define DEBUG_WM                  (1ull << 17)
 #define DEBUG_URB                 (1ull << 18)
 #define DEBUG_VS                  (1ull << 19)
diff --git a/src/mesa/drivers/dri/i965/brw_performance_query.c b/src/mesa/drivers/dri/i965/brw_performance_query.c
index 6ec6b417e52..34e79f398ab 100644
--- a/src/mesa/drivers/dri/i965/brw_performance_query.c
+++ b/src/mesa/drivers/dri/i965/brw_performance_query.c
@@ -2143,7 +2143,8 @@ brw_init_perf_query_info(struct gl_context *ctx)
        */
       oa_register(brw);
 
-      if (kernel_has_dynamic_config_support(brw, sysfs_dev_dir))
+      if (likely((INTEL_DEBUG & DEBUG_NO_OACONFIG) == 0) &&
+          kernel_has_dynamic_config_support(brw, sysfs_dev_dir))
          init_oa_configs(brw, sysfs_dev_dir);
       else
          enumerate_sysfs_metrics(brw, sysfs_dev_dir);
-- 
2.14.1



More information about the mesa-dev mailing list