i965: Configure bufmgr debug options from intel_screen.c
authorKristian Høgsberg Kristensen <krh@bitplanet.net>
Tue, 6 Oct 2015 23:19:04 +0000 (16:19 -0700)
committerKristian Høgsberg Kristensen <krh@bitplanet.net>
Thu, 8 Oct 2015 19:13:31 +0000 (12:13 -0700)
We need the debug flag parsing and INTEL_DEBUG in the compiler, but we
don't want the dependency on bufmgr (libdrm_intel) in there. Move to
intel_screen.c.

There are now only two lines left in brw_process_intel_debug_variable(),
but we keep it in intel_debug.h to avoid having to expose
'debug_control' as a global variable.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
src/mesa/drivers/dri/i965/intel_debug.c
src/mesa/drivers/dri/i965/intel_debug.h
src/mesa/drivers/dri/i965/intel_screen.c

index 312018921456e3438eb2bfa548f7fa8a6c937ad8..f7c02c8a38de83348aee7438764b953a821612de 100644 (file)
@@ -92,22 +92,10 @@ intel_debug_flag_for_shader_stage(gl_shader_stage stage)
 }
 
 void
-brw_process_intel_debug_variable(struct intel_screen *screen)
+brw_process_intel_debug_variable(void)
 {
    uint64_t intel_debug = parse_debug_string(getenv("INTEL_DEBUG"), debug_control);
    (void) p_atomic_cmpxchg(&INTEL_DEBUG, 0, intel_debug);
-
-   if (INTEL_DEBUG & DEBUG_BUFMGR)
-      dri_bufmgr_set_debug(screen->bufmgr, true);
-
-   if ((INTEL_DEBUG & DEBUG_SHADER_TIME) && screen->devinfo->gen < 7) {
-      fprintf(stderr,
-              "shader_time debugging requires gen7 (Ivybridge) or better.\n");
-      INTEL_DEBUG &= ~DEBUG_SHADER_TIME;
-   }
-
-   if (INTEL_DEBUG & DEBUG_AUB)
-      drm_intel_bufmgr_gem_set_aub_dump(screen->bufmgr, true);
 }
 
 /**
index b7d0c823fa86716a06bd6f6513831f89534c067d..0a6e1b90b9874f90dfc4ecc57e1f0b37c6422ee3 100644 (file)
@@ -115,8 +115,6 @@ extern uint64_t INTEL_DEBUG;
 
 extern uint64_t intel_debug_flag_for_shader_stage(gl_shader_stage stage);
 
-struct intel_screen;
-
-extern void brw_process_intel_debug_variable(struct intel_screen *);
+extern void brw_process_intel_debug_variable(void);
 
 extern bool brw_env_var_as_boolean(const char *var_name, bool default_value);
index 17838350cdaf3ed030538b659233e4412f8edbff..590c45d93eae82634e27bb9816198b744a9a6724 100644 (file)
@@ -1421,7 +1421,19 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
    if (!intelScreen->devinfo)
       return false;
 
-   brw_process_intel_debug_variable(intelScreen);
+   brw_process_intel_debug_variable();
+
+   if (INTEL_DEBUG & DEBUG_BUFMGR)
+      dri_bufmgr_set_debug(intelScreen->bufmgr, true);
+
+   if ((INTEL_DEBUG & DEBUG_SHADER_TIME) && intelScreen->devinfo->gen < 7) {
+      fprintf(stderr,
+              "shader_time debugging requires gen7 (Ivybridge) or better.\n");
+      INTEL_DEBUG &= ~DEBUG_SHADER_TIME;
+   }
+
+   if (INTEL_DEBUG & DEBUG_AUB)
+      drm_intel_bufmgr_gem_set_aub_dump(intelScreen->bufmgr, true);
 
    intelScreen->hw_must_use_separate_stencil = intelScreen->devinfo->gen >= 7;