[Mesa-dev] [PATCH 17/53] i965/drm: Check INTEL_DEBUG & DEBUG_BUFMGR directly.
Kenneth Graunke
kenneth at whitecape.org
Wed Apr 5 00:10:07 UTC 2017
Eliminates some API around this, and more importantly, the last
field in one bufmgr class.
---
src/mesa/drivers/dri/i965/brw_bufmgr.h | 1 -
src/mesa/drivers/dri/i965/intel_bufmgr.c | 6 ------
src/mesa/drivers/dri/i965/intel_bufmgr_gem.c | 9 +++------
src/mesa/drivers/dri/i965/intel_bufmgr_priv.h | 3 ---
src/mesa/drivers/dri/i965/intel_screen.c | 3 ---
5 files changed, 3 insertions(+), 19 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_bufmgr.h b/src/mesa/drivers/dri/i965/brw_bufmgr.h
index a9cf0ff85f2..2cc636c7149 100644
--- a/src/mesa/drivers/dri/i965/brw_bufmgr.h
+++ b/src/mesa/drivers/dri/i965/brw_bufmgr.h
@@ -126,7 +126,6 @@ int drm_bacon_bo_get_subdata(drm_bacon_bo *bo, unsigned long offset,
unsigned long size, void *data);
void drm_bacon_bo_wait_rendering(drm_bacon_bo *bo);
-void drm_bacon_bufmgr_set_debug(drm_bacon_bufmgr *bufmgr, int enable_debug);
void drm_bacon_bufmgr_destroy(drm_bacon_bufmgr *bufmgr);
int drm_bacon_bo_exec(drm_bacon_bo *bo, int used,
struct drm_clip_rect *cliprects, int num_cliprects, int DR4);
diff --git a/src/mesa/drivers/dri/i965/intel_bufmgr.c b/src/mesa/drivers/dri/i965/intel_bufmgr.c
index a8e8ae7da65..a87286c971a 100644
--- a/src/mesa/drivers/dri/i965/intel_bufmgr.c
+++ b/src/mesa/drivers/dri/i965/intel_bufmgr.c
@@ -175,12 +175,6 @@ drm_bacon_bo_mrb_exec(drm_bacon_bo *bo, int used,
}
}
-void
-drm_bacon_bufmgr_set_debug(drm_bacon_bufmgr *bufmgr, int enable_debug)
-{
- bufmgr->debug = enable_debug;
-}
-
int
drm_bacon_bufmgr_check_aperture_space(drm_bacon_bo ** bo_array, int count)
{
diff --git a/src/mesa/drivers/dri/i965/intel_bufmgr_gem.c b/src/mesa/drivers/dri/i965/intel_bufmgr_gem.c
index b981658e920..749326891a0 100644
--- a/src/mesa/drivers/dri/i965/intel_bufmgr_gem.c
+++ b/src/mesa/drivers/dri/i965/intel_bufmgr_gem.c
@@ -56,6 +56,7 @@
#ifndef ETIME
#define ETIME ETIMEDOUT
#endif
+#include "common/gen_debug.h"
#include "libdrm_macros.h"
#include "main/macros.h"
#include "util/macros.h"
@@ -78,10 +79,7 @@
#define memclear(s) memset(&s, 0, sizeof(s))
-#define DBG(...) do { \
- if (bufmgr_gem->bufmgr.debug) \
- fprintf(stderr, __VA_ARGS__); \
-} while (0)
+#define FILE_DEBUG_FLAG DEBUG_BUFMGR
static inline int
atomic_add_unless(int *v, int add, int unless)
@@ -2107,7 +2105,7 @@ do_exec2(drm_bacon_bo *bo, int used, drm_bacon_context *ctx,
*out_fence = execbuf.rsvd2 >> 32;
skip_execution:
- if (bufmgr_gem->bufmgr.debug)
+ if (INTEL_DEBUG & DEBUG_BUFMGR)
drm_bacon_gem_dump_validation_list(bufmgr_gem);
for (i = 0; i < bufmgr_gem->exec_count; i++) {
@@ -3180,7 +3178,6 @@ drm_bacon_bufmgr_gem_init(int fd, int batch_size)
bufmgr_gem->bufmgr.bo_busy = drm_bacon_gem_bo_busy;
bufmgr_gem->bufmgr.bo_madvise = drm_bacon_gem_bo_madvise;
bufmgr_gem->bufmgr.destroy = drm_bacon_bufmgr_gem_unref;
- bufmgr_gem->bufmgr.debug = 0;
bufmgr_gem->bufmgr.check_aperture_space =
drm_bacon_gem_check_aperture_space;
bufmgr_gem->bufmgr.bo_disable_reuse = drm_bacon_gem_bo_disable_reuse;
diff --git a/src/mesa/drivers/dri/i965/intel_bufmgr_priv.h b/src/mesa/drivers/dri/i965/intel_bufmgr_priv.h
index 26ffd18234a..6bc6c0b8e11 100644
--- a/src/mesa/drivers/dri/i965/intel_bufmgr_priv.h
+++ b/src/mesa/drivers/dri/i965/intel_bufmgr_priv.h
@@ -275,9 +275,6 @@ struct _drm_bacon_bufmgr {
/** Returns true if target_bo is in the relocation tree rooted at bo. */
int (*bo_references) (drm_bacon_bo *bo, drm_bacon_bo *target_bo);
-
- /**< Enables verbose debugging printouts */
- int debug;
};
struct _drm_bacon_context {
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index fbe7301c9ba..7dfcb3b9106 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -1770,9 +1770,6 @@ __DRIconfig **intelInitScreen2(__DRIscreen *dri_screen)
brw_process_intel_debug_variable();
- if (INTEL_DEBUG & DEBUG_BUFMGR)
- drm_bacon_bufmgr_set_debug(screen->bufmgr, true);
-
if ((INTEL_DEBUG & DEBUG_SHADER_TIME) && devinfo->gen < 7) {
fprintf(stderr,
"shader_time debugging requires gen7 (Ivybridge) or better.\n");
--
2.12.1
More information about the mesa-dev
mailing list