* [PATCH 0/9] A little bit of KMS debug logging tidy
@ 2016-04-27 10:06 Tvrtko Ursulin
2016-04-27 10:06 ` [PATCH 1/9] drm: Add drm_mode_debug_printmodeline_raw Tvrtko Ursulin
` (10 more replies)
0 siblings, 11 replies; 17+ messages in thread
From: Tvrtko Ursulin @ 2016-04-27 10:06 UTC (permalink / raw)
To: Intel-gfx
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Assorted patches to make the KMS debug logs a bit more
compact and hence more readable.
Tvrtko Ursulin (9):
drm: Add drm_mode_debug_printmodeline_raw
drm: Recognize invalid (all-zero) modes in
drm_mode_debug_printmodeline(_raw)
drm/i915: Compact modes in intel_dump_pipe_config
drm/i915: Tidy planes and scaler info in intel_dump_pipe_config
drm/i915: Compact intel_dump_pipe_config some more
drm/i915: Log watermark latencies on a single line per plane
drm/i915: Compact display clock logging
drm/i915: Print DisplayPort clocks on a single line
drm: Quiet down drm_mode_getconnector
drivers/gpu/drm/drm_crtc.c | 2 -
drivers/gpu/drm/drm_modes.c | 42 +++++++++++---
drivers/gpu/drm/i915/intel_display.c | 103 ++++++++++++++++++++---------------
drivers/gpu/drm/i915/intel_dp.c | 33 +++++------
drivers/gpu/drm/i915/intel_pm.c | 31 ++++++++---
include/drm/drm_modes.h | 1 +
6 files changed, 129 insertions(+), 83 deletions(-)
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 1/9] drm: Add drm_mode_debug_printmodeline_raw
2016-04-27 10:06 [PATCH 0/9] A little bit of KMS debug logging tidy Tvrtko Ursulin
@ 2016-04-27 10:06 ` Tvrtko Ursulin
2016-04-27 12:35 ` Jani Nikula
2016-04-27 10:06 ` [PATCH 2/9] drm: Recognize invalid (all-zero) modes in drm_mode_debug_printmodeline(_raw) Tvrtko Ursulin
` (9 subsequent siblings)
10 siblings, 1 reply; 17+ messages in thread
From: Tvrtko Ursulin @ 2016-04-27 10:06 UTC (permalink / raw)
To: Intel-gfx; +Cc: Daniel Vetter, dri-devel, Tvrtko Ursulin
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Purpose is to enable drivers to print out just the mode
string with their own formatting.
Existing drm_mode_debug_printmodeline calls the new
helper and the format is unchanged in this patch.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
---
drivers/gpu/drm/drm_modes.c | 29 ++++++++++++++++++++++-------
include/drm/drm_modes.h | 1 +
2 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 7def3d58da18..fd4795e2c8db 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -42,6 +42,24 @@
#include "drm_crtc_internal.h"
/**
+ * drm_mode_debug_printmodeline_raw - print a mode raw string to dmesg
+ * @mode: mode to print
+ *
+ * Describe @mode using DRM_DEBUG without the loglevel, drm prefix and newline.
+ */
+void drm_mode_debug_printmodeline_raw(const struct drm_display_mode *mode)
+{
+ if (drm_debug & DRM_UT_KMS)
+ printk("%d:\"%s\" %d %d %d %d %d %d %d %d %d %d 0x%x 0x%x",
+ mode->base.id, mode->name, mode->vrefresh, mode->clock,
+ mode->hdisplay, mode->hsync_start,
+ mode->hsync_end, mode->htotal,
+ mode->vdisplay, mode->vsync_start,
+ mode->vsync_end, mode->vtotal, mode->type, mode->flags);
+}
+EXPORT_SYMBOL(drm_mode_debug_printmodeline_raw);
+
+/**
* drm_mode_debug_printmodeline - print a mode to dmesg
* @mode: mode to print
*
@@ -49,13 +67,10 @@
*/
void drm_mode_debug_printmodeline(const struct drm_display_mode *mode)
{
- DRM_DEBUG_KMS("Modeline %d:\"%s\" %d %d %d %d %d %d %d %d %d %d "
- "0x%x 0x%x\n",
- mode->base.id, mode->name, mode->vrefresh, mode->clock,
- mode->hdisplay, mode->hsync_start,
- mode->hsync_end, mode->htotal,
- mode->vdisplay, mode->vsync_start,
- mode->vsync_end, mode->vtotal, mode->type, mode->flags);
+ DRM_DEBUG_KMS("Modeline ");
+ drm_mode_debug_printmodeline_raw(mode);
+ if (drm_debug & DRM_UT_KMS)
+ printk("\n");
}
EXPORT_SYMBOL(drm_mode_debug_printmodeline);
diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h
index 625966a906f2..9bb0cd06b80e 100644
--- a/include/drm/drm_modes.h
+++ b/include/drm/drm_modes.h
@@ -437,6 +437,7 @@ int drm_mode_convert_umode(struct drm_display_mode *out,
const struct drm_mode_modeinfo *in);
void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode);
void drm_mode_debug_printmodeline(const struct drm_display_mode *mode);
+void drm_mode_debug_printmodeline_raw(const struct drm_display_mode *mode);
struct drm_display_mode *drm_cvt_mode(struct drm_device *dev,
int hdisplay, int vdisplay, int vrefresh,
--
1.9.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 2/9] drm: Recognize invalid (all-zero) modes in drm_mode_debug_printmodeline(_raw)
2016-04-27 10:06 [PATCH 0/9] A little bit of KMS debug logging tidy Tvrtko Ursulin
2016-04-27 10:06 ` [PATCH 1/9] drm: Add drm_mode_debug_printmodeline_raw Tvrtko Ursulin
@ 2016-04-27 10:06 ` Tvrtko Ursulin
2016-04-27 10:06 ` [PATCH 3/9] drm/i915: Compact modes in intel_dump_pipe_config Tvrtko Ursulin
` (8 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Tvrtko Ursulin @ 2016-04-27 10:06 UTC (permalink / raw)
To: Intel-gfx; +Cc: Daniel Vetter, dri-devel, Tvrtko Ursulin
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Instead of a long string full of zeros in various forms
print out "---" for more tidy appearace in the logs.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
---
drivers/gpu/drm/drm_modes.c | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index fd4795e2c8db..da9012dc4bba 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -49,13 +49,26 @@
*/
void drm_mode_debug_printmodeline_raw(const struct drm_display_mode *mode)
{
- if (drm_debug & DRM_UT_KMS)
+ if (!(drm_debug & DRM_UT_KMS))
+ return;
+
+ if (mode->base.id == 0 &&
+ (mode->name == NULL || mode->name[0] == 0) &&
+ mode->vrefresh == 0 && mode->clock == 0 &&
+ mode->hdisplay == 0 && mode->hsync_start == 0 &&
+ mode->hsync_end == 0 && mode->htotal == 0 &&
+ mode->vdisplay == 0 && mode->vsync_start == 0 &&
+ mode->vsync_end == 0 && mode->vtotal == 0 &&
+ mode->type == 0 && mode->flags == 0) {
+ printk("---");
+ } else {
printk("%d:\"%s\" %d %d %d %d %d %d %d %d %d %d 0x%x 0x%x",
- mode->base.id, mode->name, mode->vrefresh, mode->clock,
- mode->hdisplay, mode->hsync_start,
- mode->hsync_end, mode->htotal,
- mode->vdisplay, mode->vsync_start,
- mode->vsync_end, mode->vtotal, mode->type, mode->flags);
+ mode->base.id, mode->name, mode->vrefresh, mode->clock,
+ mode->hdisplay, mode->hsync_start,
+ mode->hsync_end, mode->htotal,
+ mode->vdisplay, mode->vsync_start,
+ mode->vsync_end, mode->vtotal, mode->type, mode->flags);
+ }
}
EXPORT_SYMBOL(drm_mode_debug_printmodeline_raw);
--
1.9.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 3/9] drm/i915: Compact modes in intel_dump_pipe_config
2016-04-27 10:06 [PATCH 0/9] A little bit of KMS debug logging tidy Tvrtko Ursulin
2016-04-27 10:06 ` [PATCH 1/9] drm: Add drm_mode_debug_printmodeline_raw Tvrtko Ursulin
2016-04-27 10:06 ` [PATCH 2/9] drm: Recognize invalid (all-zero) modes in drm_mode_debug_printmodeline(_raw) Tvrtko Ursulin
@ 2016-04-27 10:06 ` Tvrtko Ursulin
2016-04-27 12:37 ` Jani Nikula
2016-04-27 10:06 ` [PATCH 4/9] drm/i915: Tidy planes and scaler info " Tvrtko Ursulin
` (7 subsequent siblings)
10 siblings, 1 reply; 17+ messages in thread
From: Tvrtko Ursulin @ 2016-04-27 10:06 UTC (permalink / raw)
To: Intel-gfx
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Use the new drm_mode_debug_printmodeline_raw to log the
prefix and mode on the same line.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index b7cb632a2a31..1362a1270c9f 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12167,10 +12167,15 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc,
pipe_config->has_audio,
pipe_config->has_infoframe);
- DRM_DEBUG_KMS("requested mode:\n");
- drm_mode_debug_printmodeline(&pipe_config->base.mode);
- DRM_DEBUG_KMS("adjusted mode:\n");
- drm_mode_debug_printmodeline(&pipe_config->base.adjusted_mode);
+ DRM_DEBUG_KMS("requested mode: ");
+ drm_mode_debug_printmodeline_raw(&pipe_config->base.mode);
+ if (drm_debug & DRM_UT_KMS)
+ printk("\n");
+ DRM_DEBUG_KMS("adjusted mode: ");
+ drm_mode_debug_printmodeline_raw(&pipe_config->base.adjusted_mode);
+ if (drm_debug & DRM_UT_KMS)
+ printk("\n");
+
intel_dump_crtc_timings(&pipe_config->base.adjusted_mode);
DRM_DEBUG_KMS("port clock: %d\n", pipe_config->port_clock);
DRM_DEBUG_KMS("pipe src size: %dx%d\n",
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 4/9] drm/i915: Tidy planes and scaler info in intel_dump_pipe_config
2016-04-27 10:06 [PATCH 0/9] A little bit of KMS debug logging tidy Tvrtko Ursulin
` (2 preceding siblings ...)
2016-04-27 10:06 ` [PATCH 3/9] drm/i915: Compact modes in intel_dump_pipe_config Tvrtko Ursulin
@ 2016-04-27 10:06 ` Tvrtko Ursulin
2016-04-27 10:06 ` [PATCH 5/9] drm/i915: Compact intel_dump_pipe_config some more Tvrtko Ursulin
` (6 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Tvrtko Ursulin @ 2016-04-27 10:06 UTC (permalink / raw)
To: Intel-gfx
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
1. Only log scaler data where scalers are supported for
tidier logs.
2. Tidy plane data and fix logging prefix in the middle
of a line.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 68 +++++++++++++++++++++---------------
1 file changed, 40 insertions(+), 28 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 1362a1270c9f..6d63bc39777c 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12130,6 +12130,7 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc,
const char *context)
{
struct drm_device *dev = crtc->base.dev;
+ struct drm_i915_private *dev_priv = to_i915(dev);
struct drm_plane *plane;
struct intel_plane *intel_plane;
struct intel_plane_state *state;
@@ -12180,10 +12181,13 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc,
DRM_DEBUG_KMS("port clock: %d\n", pipe_config->port_clock);
DRM_DEBUG_KMS("pipe src size: %dx%d\n",
pipe_config->pipe_src_w, pipe_config->pipe_src_h);
- DRM_DEBUG_KMS("num_scalers: %d, scaler_users: 0x%x, scaler_id: %d\n",
- crtc->num_scalers,
- pipe_config->scaler_state.scaler_users,
- pipe_config->scaler_state.scaler_id);
+
+ if (INTEL_GEN(dev_priv) >= 9)
+ DRM_DEBUG_KMS("num_scalers: %d, scaler_users: 0x%x, scaler_id: %d\n",
+ crtc->num_scalers,
+ pipe_config->scaler_state.scaler_users,
+ pipe_config->scaler_state.scaler_id);
+
DRM_DEBUG_KMS("gmch pfit: control: 0x%08x, ratios: 0x%08x, lvds border: 0x%08x\n",
pipe_config->gmch_pfit.control,
pipe_config->gmch_pfit.pgm_ratios,
@@ -12232,7 +12236,7 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc,
pipe_config->dpll_hw_state.fp1);
}
- DRM_DEBUG_KMS("planes on this crtc\n");
+ DRM_DEBUG_KMS("Planes on this crtc:\n");
list_for_each_entry(plane, &dev->mode_config.plane_list, head) {
intel_plane = to_intel_plane(plane);
if (intel_plane->pipe != crtc->pipe)
@@ -12240,30 +12244,38 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc,
state = to_intel_plane_state(plane->state);
fb = state->base.fb;
- if (!fb) {
- DRM_DEBUG_KMS("%s PLANE:%d plane: %u.%u idx: %d "
- "disabled, scaler_id = %d\n",
- plane->type == DRM_PLANE_TYPE_CURSOR ? "CURSOR" : "STANDARD",
- plane->base.id, intel_plane->pipe,
- (crtc->base.primary == plane) ? 0 : intel_plane->plane + 1,
- drm_plane_index(plane), state->scaler_id);
- continue;
- }
- DRM_DEBUG_KMS("%s PLANE:%d plane: %u.%u idx: %d enabled",
- plane->type == DRM_PLANE_TYPE_CURSOR ? "CURSOR" : "STANDARD",
- plane->base.id, intel_plane->pipe,
- crtc->base.primary == plane ? 0 : intel_plane->plane + 1,
- drm_plane_index(plane));
- DRM_DEBUG_KMS("\tFB:%d, fb = %ux%u format = 0x%x",
- fb->base.id, fb->width, fb->height, fb->pixel_format);
- DRM_DEBUG_KMS("\tscaler:%d src (%u, %u) %ux%u dst (%u, %u) %ux%u\n",
- state->scaler_id,
- state->src.x1 >> 16, state->src.y1 >> 16,
- drm_rect_width(&state->src) >> 16,
- drm_rect_height(&state->src) >> 16,
- state->dst.x1, state->dst.y1,
- drm_rect_width(&state->dst), drm_rect_height(&state->dst));
+ if (fb)
+ DRM_DEBUG_KMS("*");
+ else
+ DRM_DEBUG_KMS(" ");
+
+ if (drm_debug & DRM_UT_KMS)
+ printk("%s plane:%d (%u.%u) idx: %d",
+ plane->type == DRM_PLANE_TYPE_CURSOR ?
+ "cursor" : "standard",
+ plane->base.id, intel_plane->pipe,
+ crtc->base.primary == plane ?
+ 0 : intel_plane->plane + 1,
+ drm_plane_index(plane));
+
+ if (fb && (drm_debug & DRM_UT_KMS))
+ printk(" fb:%d (%ux%u) format=0x%x",
+ fb->base.id, fb->width, fb->height,
+ fb->pixel_format);
+
+ if (INTEL_GEN(dev_priv) >= 9 && (drm_debug & DRM_UT_KMS))
+ printk(" scaler:%d src (%u, %u) %ux%u dst (%u, %u) %ux%u\n",
+ state->scaler_id,
+ state->src.x1 >> 16, state->src.y1 >> 16,
+ drm_rect_width(&state->src) >> 16,
+ drm_rect_height(&state->src) >> 16,
+ state->dst.x1, state->dst.y1,
+ drm_rect_width(&state->dst),
+ drm_rect_height(&state->dst));
+
+ if (fb && (drm_debug & DRM_UT_KMS))
+ printk("\n");
}
}
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 5/9] drm/i915: Compact intel_dump_pipe_config some more
2016-04-27 10:06 [PATCH 0/9] A little bit of KMS debug logging tidy Tvrtko Ursulin
` (3 preceding siblings ...)
2016-04-27 10:06 ` [PATCH 4/9] drm/i915: Tidy planes and scaler info " Tvrtko Ursulin
@ 2016-04-27 10:06 ` Tvrtko Ursulin
2016-04-27 10:06 ` [PATCH 6/9] drm/i915: Log watermark latencies on a single line per plane Tvrtko Ursulin
` (5 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Tvrtko Ursulin @ 2016-04-27 10:06 UTC (permalink / raw)
To: Intel-gfx
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Merge together some short lines where it does not look
too alien to do so to make the logs more compact.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 6d63bc39777c..e8339639d9ed 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12139,8 +12139,8 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc,
DRM_DEBUG_KMS("[CRTC:%d]%s config %p for pipe %c\n", crtc->base.base.id,
context, pipe_config, pipe_name(crtc->pipe));
- DRM_DEBUG_KMS("cpu_transcoder: %s\n", transcoder_name(pipe_config->cpu_transcoder));
- DRM_DEBUG_KMS("pipe bpp: %i, dithering: %i\n",
+ DRM_DEBUG_KMS("cpu_transcoder: %s; pipe bpp: %i, dithering: %i\n",
+ transcoder_name(pipe_config->cpu_transcoder),
pipe_config->pipe_bpp, pipe_config->dither);
DRM_DEBUG_KMS("fdi/pch: %i, lanes: %i, gmch_m: %u, gmch_n: %u, link_m: %u, link_n: %u, tu: %u\n",
pipe_config->has_pch_encoder,
@@ -12155,9 +12155,7 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc,
pipe_config->dp_m_n.link_m, pipe_config->dp_m_n.link_n,
pipe_config->dp_m_n.tu);
- DRM_DEBUG_KMS("dp: %i, lanes: %i, gmch_m2: %u, gmch_n2: %u, link_m2: %u, link_n2: %u, tu2: %u\n",
- pipe_config->has_dp_encoder,
- pipe_config->lane_count,
+ DRM_DEBUG_KMS("dp: gmch_m2: %u, gmch_n2: %u, link_m2: %u, link_n2: %u, tu2: %u\n",
pipe_config->dp_m2_n2.gmch_m,
pipe_config->dp_m2_n2.gmch_n,
pipe_config->dp_m2_n2.link_m,
@@ -12178,8 +12176,8 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc,
printk("\n");
intel_dump_crtc_timings(&pipe_config->base.adjusted_mode);
- DRM_DEBUG_KMS("port clock: %d\n", pipe_config->port_clock);
- DRM_DEBUG_KMS("pipe src size: %dx%d\n",
+ DRM_DEBUG_KMS("port clock: %d; pipe src size: %dx%d\n",
+ pipe_config->port_clock,
pipe_config->pipe_src_w, pipe_config->pipe_src_h);
if (INTEL_GEN(dev_priv) >= 9)
@@ -12196,8 +12194,8 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc,
pipe_config->pch_pfit.pos,
pipe_config->pch_pfit.size,
pipe_config->pch_pfit.enabled ? "enabled" : "disabled");
- DRM_DEBUG_KMS("ips: %i\n", pipe_config->ips_enabled);
- DRM_DEBUG_KMS("double wide: %i\n", pipe_config->double_wide);
+ DRM_DEBUG_KMS("ips: %i; double wide: %i\n",
+ pipe_config->ips_enabled, pipe_config->double_wide);
if (IS_BROXTON(dev)) {
DRM_DEBUG_KMS("ddi_pll_sel: %u; dpll_hw_state: ebb0: 0x%x, ebb4: 0x%x,"
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 6/9] drm/i915: Log watermark latencies on a single line per plane
2016-04-27 10:06 [PATCH 0/9] A little bit of KMS debug logging tidy Tvrtko Ursulin
` (4 preceding siblings ...)
2016-04-27 10:06 ` [PATCH 5/9] drm/i915: Compact intel_dump_pipe_config some more Tvrtko Ursulin
@ 2016-04-27 10:06 ` Tvrtko Ursulin
2016-04-27 10:07 ` [PATCH 7/9] drm/i915: Compact display clock logging Tvrtko Ursulin
` (4 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Tvrtko Ursulin @ 2016-04-27 10:06 UTC (permalink / raw)
To: Intel-gfx
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Compacts debug logging a bit so instead of:
[drm:intel_print_wm_latency] Primary WM0 latency 20 (2.0 usec)
[drm:intel_print_wm_latency] Primary WM1 latency 50 (25.0 usec)
[drm:intel_print_wm_latency] Primary WM2 latency 90 (45.0 usec)
[drm:intel_print_wm_latency] Primary WM3 latency 130 (65.0 usec)
[drm:intel_print_wm_latency] Primary WM4 latency 160 (80.0 usec)
[drm:intel_print_wm_latency] Sprite WM0 latency 20 (2.0 usec)
[drm:intel_print_wm_latency] Sprite WM1 latency 50 (25.0 usec)
[drm:intel_print_wm_latency] Sprite WM2 latency 90 (45.0 usec)
[drm:intel_print_wm_latency] Sprite WM3 latency 130 (65.0 usec)
[drm:intel_print_wm_latency] Sprite WM4 latency 160 (80.0 usec)
[drm:intel_print_wm_latency] Cursor WM0 latency 20 (2.0 usec)
[drm:intel_print_wm_latency] Cursor WM1 latency 50 (25.0 usec)
[drm:intel_print_wm_latency] Cursor WM2 latency 90 (45.0 usec)
[drm:intel_print_wm_latency] Cursor WM3 latency 130 (65.0 usec)
[drm:intel_print_wm_latency] Cursor WM4 latency 160 (80.0 usec)
We get:
[drm:intel_print_wm_latency] Primary plane latencies [2.0us (20), 25.0us (50), 45.0us (90), 65.0us (130), 80.0us (160)]
[drm:intel_print_wm_latency] Sprite plane latencies [2.0us (20), 25.0us (50), 45.0us (90), 65.0us (130), 80.0us (160)]
[drm:intel_print_wm_latency] Cursor plane latencies [2.0us (20), 25.0us (50), 45.0us (90), 65.0us (130), 80.0us (160)]
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
drivers/gpu/drm/i915/intel_pm.c | 31 ++++++++++++++++++++++---------
1 file changed, 22 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 695a464a5e64..23589eedf396 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -2179,15 +2179,26 @@ static void intel_print_wm_latency(struct drm_device *dev,
const uint16_t wm[8])
{
int level, max_level = ilk_wm_max_level(dev);
+ bool error = false;
+ static const char *wm_msg = "%s plane latencies [";
for (level = 0; level <= max_level; level++) {
- unsigned int latency = wm[level];
-
- if (latency == 0) {
- DRM_ERROR("%s WM%d latency not provided\n",
- name, level);
- continue;
+ if (wm[level] == 0) {
+ error = true;
+ break;
}
+ }
+
+ if (error)
+ DRM_ERROR(wm_msg, name);
+ else
+ DRM_DEBUG_KMS(wm_msg, name);
+
+ if (!error && !(drm_debug && DRM_UT_KMS))
+ return;
+
+ for (level = 0; level <= max_level; level++) {
+ unsigned int latency = wm[level];
/*
* - latencies are in us on gen9.
@@ -2198,10 +2209,12 @@ static void intel_print_wm_latency(struct drm_device *dev,
else if (level > 0)
latency *= 5;
- DRM_DEBUG_KMS("%s WM%d latency %u (%u.%u usec)\n",
- name, level, wm[level],
- latency / 10, latency % 10);
+ if (level > 0)
+ printk(", ");
+ printk("%u.%uus (%u)", latency / 10, latency % 10, wm[level]);
}
+
+ printk("]\n");
}
static bool ilk_increase_wm_latency(struct drm_i915_private *dev_priv,
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 7/9] drm/i915: Compact display clock logging
2016-04-27 10:06 [PATCH 0/9] A little bit of KMS debug logging tidy Tvrtko Ursulin
` (5 preceding siblings ...)
2016-04-27 10:06 ` [PATCH 6/9] drm/i915: Log watermark latencies on a single line per plane Tvrtko Ursulin
@ 2016-04-27 10:07 ` Tvrtko Ursulin
2016-04-27 10:07 ` [PATCH 8/9] drm/i915: Print DisplayPort clocks on a single line Tvrtko Ursulin
` (3 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Tvrtko Ursulin @ 2016-04-27 10:07 UTC (permalink / raw)
To: Intel-gfx
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Merge two subsequent DRM_DEBUG_DRIVER lines into one so instead of:
[ 4.273133] [drm:intel_update_max_cdclk] Max CD clock rate: 540000 kHz
[ 4.273134] [drm:intel_update_max_cdclk] Max dotclock rate: 540000 kHz
We get:
[ 4.231702] [drm:intel_update_max_cdclk] Max CD clock rate: 540000 kHz; Max dotclock rate: 540000 kHz
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e8339639d9ed..ba8a9a770b85 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -5312,10 +5312,8 @@ static void intel_update_max_cdclk(struct drm_device *dev)
dev_priv->max_dotclk_freq = intel_compute_max_dotclk(dev_priv);
- DRM_DEBUG_DRIVER("Max CD clock rate: %d kHz\n",
- dev_priv->max_cdclk_freq);
-
- DRM_DEBUG_DRIVER("Max dotclock rate: %d kHz\n",
+ DRM_DEBUG_DRIVER("Max CD clock rate: %d kHz; Max dotclock rate: %d kHz\n",
+ dev_priv->max_cdclk_freq,
dev_priv->max_dotclk_freq);
}
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 8/9] drm/i915: Print DisplayPort clocks on a single line
2016-04-27 10:06 [PATCH 0/9] A little bit of KMS debug logging tidy Tvrtko Ursulin
` (6 preceding siblings ...)
2016-04-27 10:07 ` [PATCH 7/9] drm/i915: Compact display clock logging Tvrtko Ursulin
@ 2016-04-27 10:07 ` Tvrtko Ursulin
2016-04-27 10:07 ` [PATCH 9/9] drm: Quiet down drm_mode_getconnector Tvrtko Ursulin
` (2 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Tvrtko Ursulin @ 2016-04-27 10:07 UTC (permalink / raw)
To: Intel-gfx
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Tidy debug logging a bit and avoid allocating the buffer on the stack,
removing one FIXME tag in the process. Replaces current debug of:
[ 4.236714] [drm:intel_dp_print_rates] source rates: 162000, 270000, 540000
[ 4.236715] [drm:intel_dp_print_rates] sink rates: 162000, 270000
[ 4.236716] [drm:intel_dp_print_rates] common rates: 162000, 270000
With:
[ 4.245597] [drm:intel_dp_print_rates] source=[162k, 270k, 540k]; sink=[162k, 270k]; common=[162k, 270k]
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
drivers/gpu/drm/i915/intel_dp.c | 33 +++++++++++++--------------------
1 file changed, 13 insertions(+), 20 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index c12c41482de7..7274def0fbca 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1349,20 +1349,12 @@ static int intel_dp_common_rates(struct intel_dp *intel_dp,
common_rates);
}
-static void snprintf_int_array(char *str, size_t len,
- const int *array, int nelem)
+static void printk_dp_rates(const int *array, unsigned int nelem)
{
- int i;
-
- str[0] = '\0';
+ unsigned int i;
- for (i = 0; i < nelem; i++) {
- int r = snprintf(str, len, "%s%d", i ? ", " : "", array[i]);
- if (r >= len)
- return;
- str += r;
- len -= r;
- }
+ for (i = 0; i < nelem; i++)
+ printk("%s%dk", i ? ", " : "", array[i] / 1000);
}
static void intel_dp_print_rates(struct intel_dp *intel_dp)
@@ -1370,22 +1362,23 @@ static void intel_dp_print_rates(struct intel_dp *intel_dp)
const int *source_rates, *sink_rates;
int source_len, sink_len, common_len;
int common_rates[DP_MAX_SUPPORTED_RATES];
- char str[128]; /* FIXME: too big for stack? */
- if ((drm_debug & DRM_UT_KMS) == 0)
+ if ((drm_debug & DRM_UT_KMS) == 0 )
return;
source_len = intel_dp_source_rates(intel_dp, &source_rates);
- snprintf_int_array(str, sizeof(str), source_rates, source_len);
- DRM_DEBUG_KMS("source rates: %s\n", str);
+ DRM_DEBUG_KMS("source=[");
+ printk_dp_rates(source_rates, source_len);
sink_len = intel_dp_sink_rates(intel_dp, &sink_rates);
- snprintf_int_array(str, sizeof(str), sink_rates, sink_len);
- DRM_DEBUG_KMS("sink rates: %s\n", str);
+ printk("]; sink=[");
+ printk_dp_rates(sink_rates, sink_len);
common_len = intel_dp_common_rates(intel_dp, common_rates);
- snprintf_int_array(str, sizeof(str), common_rates, common_len);
- DRM_DEBUG_KMS("common rates: %s\n", str);
+ printk("]; common=[");
+ printk_dp_rates(common_rates, common_len);
+
+ printk("]\n");
}
static int rate_to_index(int find, const int *rates)
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 9/9] drm: Quiet down drm_mode_getconnector
2016-04-27 10:06 [PATCH 0/9] A little bit of KMS debug logging tidy Tvrtko Ursulin
` (7 preceding siblings ...)
2016-04-27 10:07 ` [PATCH 8/9] drm/i915: Print DisplayPort clocks on a single line Tvrtko Ursulin
@ 2016-04-27 10:07 ` Tvrtko Ursulin
2016-04-28 8:54 ` Daniel Vetter
2016-04-27 10:54 ` [PATCH 0/9] A little bit of KMS debug logging tidy Jani Nikula
2016-04-27 11:57 ` ✗ Fi.CI.BAT: warning for " Patchwork
10 siblings, 1 reply; 17+ messages in thread
From: Tvrtko Ursulin @ 2016-04-27 10:07 UTC (permalink / raw)
To: Intel-gfx; +Cc: Daniel Vetter, dri-devel, Tvrtko Ursulin
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Debug logging in this function does not provide any information
apart that the userspace is calling an ioctl on the connector.
There is not any info on the connector provided at all and
since there are other ioctls userspace typically calls which
do log useful things about the same connectors, remove this
one to make things a little bit more readable when KMS debugging
is turned on.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
---
drivers/gpu/drm/drm_crtc.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 4e5b015a5e3a..ffb01d91ae32 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -2143,8 +2143,6 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
memset(&u_mode, 0, sizeof(struct drm_mode_modeinfo));
- DRM_DEBUG_KMS("[CONNECTOR:%d:?]\n", out_resp->connector_id);
-
mutex_lock(&dev->mode_config.mutex);
connector = drm_connector_find(dev, out_resp->connector_id);
--
1.9.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 0/9] A little bit of KMS debug logging tidy
2016-04-27 10:06 [PATCH 0/9] A little bit of KMS debug logging tidy Tvrtko Ursulin
` (8 preceding siblings ...)
2016-04-27 10:07 ` [PATCH 9/9] drm: Quiet down drm_mode_getconnector Tvrtko Ursulin
@ 2016-04-27 10:54 ` Jani Nikula
2016-04-27 11:26 ` Tvrtko Ursulin
2016-04-27 11:57 ` ✗ Fi.CI.BAT: warning for " Patchwork
10 siblings, 1 reply; 17+ messages in thread
From: Jani Nikula @ 2016-04-27 10:54 UTC (permalink / raw)
To: Tvrtko Ursulin, Intel-gfx
On Wed, 27 Apr 2016, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> Assorted patches to make the KMS debug logs a bit more
> compact and hence more readable.
Throughout the series I very much dislike the splitting of debug
printing to separate printk() calls. You will get debug output from
elsewhere mixed up in the middle of the drm debug log lines.
BR,
Jani.
>
> Tvrtko Ursulin (9):
> drm: Add drm_mode_debug_printmodeline_raw
> drm: Recognize invalid (all-zero) modes in
> drm_mode_debug_printmodeline(_raw)
> drm/i915: Compact modes in intel_dump_pipe_config
> drm/i915: Tidy planes and scaler info in intel_dump_pipe_config
> drm/i915: Compact intel_dump_pipe_config some more
> drm/i915: Log watermark latencies on a single line per plane
> drm/i915: Compact display clock logging
> drm/i915: Print DisplayPort clocks on a single line
> drm: Quiet down drm_mode_getconnector
>
> drivers/gpu/drm/drm_crtc.c | 2 -
> drivers/gpu/drm/drm_modes.c | 42 +++++++++++---
> drivers/gpu/drm/i915/intel_display.c | 103 ++++++++++++++++++++---------------
> drivers/gpu/drm/i915/intel_dp.c | 33 +++++------
> drivers/gpu/drm/i915/intel_pm.c | 31 ++++++++---
> include/drm/drm_modes.h | 1 +
> 6 files changed, 129 insertions(+), 83 deletions(-)
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 0/9] A little bit of KMS debug logging tidy
2016-04-27 10:54 ` [PATCH 0/9] A little bit of KMS debug logging tidy Jani Nikula
@ 2016-04-27 11:26 ` Tvrtko Ursulin
0 siblings, 0 replies; 17+ messages in thread
From: Tvrtko Ursulin @ 2016-04-27 11:26 UTC (permalink / raw)
To: Jani Nikula, Intel-gfx
On 27/04/16 11:54, Jani Nikula wrote:
> On Wed, 27 Apr 2016, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> Assorted patches to make the KMS debug logs a bit more
>> compact and hence more readable.
>
> Throughout the series I very much dislike the splitting of debug
> printing to separate printk() calls. You will get debug output from
> elsewhere mixed up in the middle of the drm debug log lines.
Yes that is true. I really disliked the huge amounts of log lines taken
by some of this and did not want to add more snprintf like operations.
Don't know then how to improve things here.
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 17+ messages in thread
* ✗ Fi.CI.BAT: warning for A little bit of KMS debug logging tidy
2016-04-27 10:06 [PATCH 0/9] A little bit of KMS debug logging tidy Tvrtko Ursulin
` (9 preceding siblings ...)
2016-04-27 10:54 ` [PATCH 0/9] A little bit of KMS debug logging tidy Jani Nikula
@ 2016-04-27 11:57 ` Patchwork
10 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2016-04-27 11:57 UTC (permalink / raw)
To: Tvrtko Ursulin; +Cc: intel-gfx
== Series Details ==
Series: A little bit of KMS debug logging tidy
URL : https://patchwork.freedesktop.org/series/6395/
State : warning
== Summary ==
Series 6395v1 A little bit of KMS debug logging tidy
http://patchwork.freedesktop.org/api/1.0/series/6395/revisions/1/mbox/
Test drv_module_reload_basic:
dmesg-warn -> PASS (snb-x220t)
Test gem_exec_suspend:
Subgroup basic-s3:
fail -> PASS (snb-x220t)
Test kms_force_connector_basic:
Subgroup force-edid:
pass -> SKIP (ivb-t430s)
bdw-nuci7 total:200 pass:188 dwarn:0 dfail:0 fail:0 skip:12
bdw-ultra total:200 pass:175 dwarn:0 dfail:0 fail:0 skip:25
bsw-nuc-2 total:199 pass:158 dwarn:0 dfail:0 fail:0 skip:41
byt-nuc total:199 pass:158 dwarn:0 dfail:0 fail:0 skip:41
hsw-brixbox total:200 pass:174 dwarn:0 dfail:0 fail:0 skip:26
hsw-gt2 total:200 pass:178 dwarn:0 dfail:0 fail:1 skip:21
ilk-hp8440p total:200 pass:139 dwarn:0 dfail:0 fail:0 skip:61
ivb-t430s total:200 pass:168 dwarn:0 dfail:0 fail:0 skip:32
skl-i7k-2 total:200 pass:173 dwarn:0 dfail:0 fail:0 skip:27
skl-nuci5 total:200 pass:189 dwarn:0 dfail:0 fail:0 skip:11
snb-dellxps total:200 pass:158 dwarn:0 dfail:0 fail:0 skip:42
snb-x220t total:200 pass:158 dwarn:0 dfail:0 fail:1 skip:41
Results at /archive/results/CI_IGT_test/Patchwork_2087/
4fa405ab5848b76c8568c7fb771d389a6695108c drm-intel-nightly: 2016y-04m-27d-10h-47m-35s UTC integration manifest
747d530 drm: Quiet down drm_mode_getconnector
1984d8d drm/i915: Print DisplayPort clocks on a single line
103095d drm/i915: Compact display clock logging
5cdecbd drm/i915: Log watermark latencies on a single line per plane
9b2b37b drm/i915: Compact intel_dump_pipe_config some more
3c3aebb drm/i915: Tidy planes and scaler info in intel_dump_pipe_config
03c22cb drm/i915: Compact modes in intel_dump_pipe_config
2eaea86 drm: Recognize invalid (all-zero) modes in drm_mode_debug_printmodeline(_raw)
4a5ff51 drm: Add drm_mode_debug_printmodeline_raw
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/9] drm: Add drm_mode_debug_printmodeline_raw
2016-04-27 10:06 ` [PATCH 1/9] drm: Add drm_mode_debug_printmodeline_raw Tvrtko Ursulin
@ 2016-04-27 12:35 ` Jani Nikula
2016-04-27 12:58 ` Tvrtko Ursulin
0 siblings, 1 reply; 17+ messages in thread
From: Jani Nikula @ 2016-04-27 12:35 UTC (permalink / raw)
To: Tvrtko Ursulin, Intel-gfx; +Cc: Daniel Vetter, dri-devel
On Wed, 27 Apr 2016, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> Purpose is to enable drivers to print out just the mode
> string with their own formatting.
Some alternatives that preserve the use of a single printk(), avoiding
garbled console output due to races (as discussed on intel-gfx in reply
to the cover letter [1]):
1) Simply add a prefix string parameter to use in
drm_mode_debug_printmodeline(). Really easy and covers most
needs. Maybe wrap this in a macro to use the caller's function name.
2) Model drm_mode_debug_printmodeline() after drm_ut_debug_printk(),
adding a mode parameter. Maybe wrap this in a macro to use the
caller's function name.
3) Add char *drm_mode_line(mode) that kmallocs a mode line string, or a
drm_mode_line(mode, buf, bufsize) that prints the mode string to a
statically allocated buffer.
BR,
Jani.
[1] http://mid.gmane.org/87fuu7jp8x.fsf@intel.com
>
> Existing drm_mode_debug_printmodeline calls the new
> helper and the format is unchanged in this patch.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: dri-devel@lists.freedesktop.org
> ---
> drivers/gpu/drm/drm_modes.c | 29 ++++++++++++++++++++++-------
> include/drm/drm_modes.h | 1 +
> 2 files changed, 23 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> index 7def3d58da18..fd4795e2c8db 100644
> --- a/drivers/gpu/drm/drm_modes.c
> +++ b/drivers/gpu/drm/drm_modes.c
> @@ -42,6 +42,24 @@
> #include "drm_crtc_internal.h"
>
> /**
> + * drm_mode_debug_printmodeline_raw - print a mode raw string to dmesg
> + * @mode: mode to print
> + *
> + * Describe @mode using DRM_DEBUG without the loglevel, drm prefix and newline.
> + */
> +void drm_mode_debug_printmodeline_raw(const struct drm_display_mode *mode)
> +{
> + if (drm_debug & DRM_UT_KMS)
> + printk("%d:\"%s\" %d %d %d %d %d %d %d %d %d %d 0x%x 0x%x",
> + mode->base.id, mode->name, mode->vrefresh, mode->clock,
> + mode->hdisplay, mode->hsync_start,
> + mode->hsync_end, mode->htotal,
> + mode->vdisplay, mode->vsync_start,
> + mode->vsync_end, mode->vtotal, mode->type, mode->flags);
> +}
> +EXPORT_SYMBOL(drm_mode_debug_printmodeline_raw);
> +
> +/**
> * drm_mode_debug_printmodeline - print a mode to dmesg
> * @mode: mode to print
> *
> @@ -49,13 +67,10 @@
> */
> void drm_mode_debug_printmodeline(const struct drm_display_mode *mode)
> {
> - DRM_DEBUG_KMS("Modeline %d:\"%s\" %d %d %d %d %d %d %d %d %d %d "
> - "0x%x 0x%x\n",
> - mode->base.id, mode->name, mode->vrefresh, mode->clock,
> - mode->hdisplay, mode->hsync_start,
> - mode->hsync_end, mode->htotal,
> - mode->vdisplay, mode->vsync_start,
> - mode->vsync_end, mode->vtotal, mode->type, mode->flags);
> + DRM_DEBUG_KMS("Modeline ");
> + drm_mode_debug_printmodeline_raw(mode);
> + if (drm_debug & DRM_UT_KMS)
> + printk("\n");
> }
> EXPORT_SYMBOL(drm_mode_debug_printmodeline);
>
> diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h
> index 625966a906f2..9bb0cd06b80e 100644
> --- a/include/drm/drm_modes.h
> +++ b/include/drm/drm_modes.h
> @@ -437,6 +437,7 @@ int drm_mode_convert_umode(struct drm_display_mode *out,
> const struct drm_mode_modeinfo *in);
> void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode);
> void drm_mode_debug_printmodeline(const struct drm_display_mode *mode);
> +void drm_mode_debug_printmodeline_raw(const struct drm_display_mode *mode);
>
> struct drm_display_mode *drm_cvt_mode(struct drm_device *dev,
> int hdisplay, int vdisplay, int vrefresh,
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 3/9] drm/i915: Compact modes in intel_dump_pipe_config
2016-04-27 10:06 ` [PATCH 3/9] drm/i915: Compact modes in intel_dump_pipe_config Tvrtko Ursulin
@ 2016-04-27 12:37 ` Jani Nikula
0 siblings, 0 replies; 17+ messages in thread
From: Jani Nikula @ 2016-04-27 12:37 UTC (permalink / raw)
To: Tvrtko Ursulin, Intel-gfx
On Wed, 27 Apr 2016, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> Use the new drm_mode_debug_printmodeline_raw to log the
> prefix and mode on the same line.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
> drivers/gpu/drm/i915/intel_display.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index b7cb632a2a31..1362a1270c9f 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -12167,10 +12167,15 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc,
> pipe_config->has_audio,
> pipe_config->has_infoframe);
>
> - DRM_DEBUG_KMS("requested mode:\n");
> - drm_mode_debug_printmodeline(&pipe_config->base.mode);
> - DRM_DEBUG_KMS("adjusted mode:\n");
> - drm_mode_debug_printmodeline(&pipe_config->base.adjusted_mode);
> + DRM_DEBUG_KMS("requested mode: ");
> + drm_mode_debug_printmodeline_raw(&pipe_config->base.mode);
> + if (drm_debug & DRM_UT_KMS)
In addition to the other complaints, I also don't like to spread the use
of DRM_UT_* macros outside of drm core.
BR,
Jani.
> + printk("\n");
> + DRM_DEBUG_KMS("adjusted mode: ");
> + drm_mode_debug_printmodeline_raw(&pipe_config->base.adjusted_mode);
> + if (drm_debug & DRM_UT_KMS)
> + printk("\n");
> +
> intel_dump_crtc_timings(&pipe_config->base.adjusted_mode);
> DRM_DEBUG_KMS("port clock: %d\n", pipe_config->port_clock);
> DRM_DEBUG_KMS("pipe src size: %dx%d\n",
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/9] drm: Add drm_mode_debug_printmodeline_raw
2016-04-27 12:35 ` Jani Nikula
@ 2016-04-27 12:58 ` Tvrtko Ursulin
0 siblings, 0 replies; 17+ messages in thread
From: Tvrtko Ursulin @ 2016-04-27 12:58 UTC (permalink / raw)
To: Jani Nikula, Intel-gfx; +Cc: Daniel Vetter, dri-devel, Tvrtko Ursulin
On 27/04/16 13:35, Jani Nikula wrote:
> On Wed, 27 Apr 2016, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> Purpose is to enable drivers to print out just the mode
>> string with their own formatting.
>
> Some alternatives that preserve the use of a single printk(), avoiding
> garbled console output due to races (as discussed on intel-gfx in reply
> to the cover letter [1]):
>
> 1) Simply add a prefix string parameter to use in
> drm_mode_debug_printmodeline(). Really easy and covers most
> needs. Maybe wrap this in a macro to use the caller's function name.
>
> 2) Model drm_mode_debug_printmodeline() after drm_ut_debug_printk(),
> adding a mode parameter. Maybe wrap this in a macro to use the
> caller's function name.
This sounds good to me...
> 3) Add char *drm_mode_line(mode) that kmallocs a mode line string, or a
> drm_mode_line(mode, buf, bufsize) that prints the mode string to a
> statically allocated buffer.
...but it only solved the modeline part of the story. Unless something
like 3), which I specifically wanted to avoid. String handling etc..
best to be avoided in general if possible and more so for debug code
only. Any potential bug in those is best avoided if they do not exist.
And some of them log external input so even more so.
Something like debug_start/debug_print/debug_end would solve all that
but that would be bigger and core.
I'll try to do 2) and see what to do with the rest...
Regards,
Tvrtko
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 9/9] drm: Quiet down drm_mode_getconnector
2016-04-27 10:07 ` [PATCH 9/9] drm: Quiet down drm_mode_getconnector Tvrtko Ursulin
@ 2016-04-28 8:54 ` Daniel Vetter
0 siblings, 0 replies; 17+ messages in thread
From: Daniel Vetter @ 2016-04-28 8:54 UTC (permalink / raw)
To: Tvrtko Ursulin; +Cc: Daniel Vetter, Intel-gfx, dri-devel, Tvrtko Ursulin
On Wed, Apr 27, 2016 at 11:07:02AM +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> Debug logging in this function does not provide any information
> apart that the userspace is calling an ioctl on the connector.
>
> There is not any info on the connector provided at all and
> since there are other ioctls userspace typically calls which
> do log useful things about the same connectors, remove this
> one to make things a little bit more readable when KMS debugging
> is turned on.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: dri-devel@lists.freedesktop.org
Yeah this seems over the top debug noise. If we want this, we could easily
add a generic debugfs file, with a lot more info on top.
-Daniel
> ---
> drivers/gpu/drm/drm_crtc.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 4e5b015a5e3a..ffb01d91ae32 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -2143,8 +2143,6 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
>
> memset(&u_mode, 0, sizeof(struct drm_mode_modeinfo));
>
> - DRM_DEBUG_KMS("[CONNECTOR:%d:?]\n", out_resp->connector_id);
> -
> mutex_lock(&dev->mode_config.mutex);
>
> connector = drm_connector_find(dev, out_resp->connector_id);
> --
> 1.9.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2016-04-28 8:54 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-27 10:06 [PATCH 0/9] A little bit of KMS debug logging tidy Tvrtko Ursulin
2016-04-27 10:06 ` [PATCH 1/9] drm: Add drm_mode_debug_printmodeline_raw Tvrtko Ursulin
2016-04-27 12:35 ` Jani Nikula
2016-04-27 12:58 ` Tvrtko Ursulin
2016-04-27 10:06 ` [PATCH 2/9] drm: Recognize invalid (all-zero) modes in drm_mode_debug_printmodeline(_raw) Tvrtko Ursulin
2016-04-27 10:06 ` [PATCH 3/9] drm/i915: Compact modes in intel_dump_pipe_config Tvrtko Ursulin
2016-04-27 12:37 ` Jani Nikula
2016-04-27 10:06 ` [PATCH 4/9] drm/i915: Tidy planes and scaler info " Tvrtko Ursulin
2016-04-27 10:06 ` [PATCH 5/9] drm/i915: Compact intel_dump_pipe_config some more Tvrtko Ursulin
2016-04-27 10:06 ` [PATCH 6/9] drm/i915: Log watermark latencies on a single line per plane Tvrtko Ursulin
2016-04-27 10:07 ` [PATCH 7/9] drm/i915: Compact display clock logging Tvrtko Ursulin
2016-04-27 10:07 ` [PATCH 8/9] drm/i915: Print DisplayPort clocks on a single line Tvrtko Ursulin
2016-04-27 10:07 ` [PATCH 9/9] drm: Quiet down drm_mode_getconnector Tvrtko Ursulin
2016-04-28 8:54 ` Daniel Vetter
2016-04-27 10:54 ` [PATCH 0/9] A little bit of KMS debug logging tidy Jani Nikula
2016-04-27 11:26 ` Tvrtko Ursulin
2016-04-27 11:57 ` ✗ Fi.CI.BAT: warning for " Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox