[Intel-gfx] [PATCH 1/2] lib/igt_kms: rip out custom verbose loggin support

Daniel Vetter daniel.vetter at ffwll.ch
Thu Mar 13 17:38:45 CET 2014


Instead just piggy-pack on top of igt_log.

Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
 lib/igt_kms.c | 22 +---------------------
 lib/igt_kms.h |  2 --
 2 files changed, 1 insertion(+), 23 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index d611c2bd2c31..2c0f89d8f0cc 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -823,7 +823,7 @@ igt_display_log(igt_display_t *display, const char *fmt, ...)
 	va_list args;
 	int n, i;
 
-	if (!display->verbose)
+	if (igt_log_level > IGT_LOG_DEBUG)
 		return 0;
 
 	va_start(args, fmt);
@@ -883,23 +883,8 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 {
 	drmModeRes *resources;
 	drmModePlaneRes *plane_resources;
-	bool verbose;
-	char *env;
 	int i;
 
-	/*
-	 * It's valid to set verbose before the init so we can get debugging
-	 * output for the init() itself.
-	 */
-	verbose = display->verbose;
-	memset(display, 0, sizeof(igt_display_t));
-	display->verbose = verbose;
-
-	/* allow a verbose override from an env variable */
-	env = getenv("IGT_DISPLAY_VERBOSE");
-	if (env)
-		display->verbose = atoi(env) != 0;
-
 	LOG_INDENT(display, "init");
 
 	display->drm_fd = drm_fd;
@@ -993,11 +978,6 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 	LOG_UNINDENT(display);
 }
 
-void igt_display_set_verbose(igt_display_t *display, bool verbose)
-{
-	display->verbose = verbose;
-}
-
 int igt_display_get_n_pipes(igt_display_t *display)
 {
 	return display->n_pipes;
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 26edf4cba170..df658b0b4678 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -155,7 +155,6 @@ typedef struct {
 
 struct igt_display {
 	int drm_fd;
-	unsigned int verbose : 1;
 	int log_shift;
 	int n_pipes;
 	int n_outputs;
@@ -167,7 +166,6 @@ struct igt_display {
 void igt_display_init(igt_display_t *display, int drm_fd);
 void igt_display_fini(igt_display_t *display);
 int  igt_display_commit(igt_display_t *display);
-void igt_display_set_verbose(igt_display_t *display, bool verbose);
 int  igt_display_get_n_pipes(igt_display_t *display);
 
 const char *igt_output_name(igt_output_t *output);
-- 
1.8.4.rc3




More information about the Intel-gfx mailing list