Commit 73cefd90 authored by Lucas De Marchi's avatar Lucas De Marchi

drm/i915: add pipe id/name to pipe mismatch logs

This way it's easier to figure out what didn't match when we have
multiple pipes enabled.

v2: pass drm_crtc and use the more common [CRTC:%d:%s] format
    (Ville)
v3: use struct intel_crtc type to pass crtc around (Ville)
Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191015164029.18431-5-lucas.demarchi@intel.com
parent cbd9b9f2
...@@ -12762,8 +12762,9 @@ pipe_config_infoframe_mismatch(struct drm_i915_private *dev_priv, ...@@ -12762,8 +12762,9 @@ pipe_config_infoframe_mismatch(struct drm_i915_private *dev_priv,
} }
} }
static void __printf(3, 4) static void __printf(4, 5)
pipe_config_mismatch(bool fastset, const char *name, const char *format, ...) pipe_config_mismatch(bool fastset, const struct intel_crtc *crtc,
const char *name, const char *format, ...)
{ {
struct va_format vaf; struct va_format vaf;
va_list args; va_list args;
...@@ -12773,9 +12774,11 @@ pipe_config_mismatch(bool fastset, const char *name, const char *format, ...) ...@@ -12773,9 +12774,11 @@ pipe_config_mismatch(bool fastset, const char *name, const char *format, ...)
vaf.va = &args; vaf.va = &args;
if (fastset) if (fastset)
DRM_DEBUG_KMS("fastset mismatch in %s %pV\n", name, &vaf); DRM_DEBUG_KMS("[CRTC:%d:%s] fastset mismatch in %s %pV\n",
crtc->base.base.id, crtc->base.name, name, &vaf);
else else
DRM_ERROR("mismatch in %s %pV\n", name, &vaf); DRM_ERROR("[CRTC:%d:%s] mismatch in %s %pV\n",
crtc->base.base.id, crtc->base.name, name, &vaf);
va_end(args); va_end(args);
} }
...@@ -12803,6 +12806,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, ...@@ -12803,6 +12806,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
bool fastset) bool fastset)
{ {
struct drm_i915_private *dev_priv = to_i915(current_config->base.crtc->dev); struct drm_i915_private *dev_priv = to_i915(current_config->base.crtc->dev);
struct intel_crtc *crtc = to_intel_crtc(pipe_config->base.crtc);
bool ret = true; bool ret = true;
u32 bp_gamma = 0; u32 bp_gamma = 0;
bool fixup_inherited = fastset && bool fixup_inherited = fastset &&
...@@ -12816,7 +12820,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, ...@@ -12816,7 +12820,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
#define PIPE_CONF_CHECK_X(name) do { \ #define PIPE_CONF_CHECK_X(name) do { \
if (current_config->name != pipe_config->name) { \ if (current_config->name != pipe_config->name) { \
pipe_config_mismatch(fastset, __stringify(name), \ pipe_config_mismatch(fastset, crtc, __stringify(name), \
"(expected 0x%08x, found 0x%08x)", \ "(expected 0x%08x, found 0x%08x)", \
current_config->name, \ current_config->name, \
pipe_config->name); \ pipe_config->name); \
...@@ -12826,7 +12830,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, ...@@ -12826,7 +12830,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
#define PIPE_CONF_CHECK_I(name) do { \ #define PIPE_CONF_CHECK_I(name) do { \
if (current_config->name != pipe_config->name) { \ if (current_config->name != pipe_config->name) { \
pipe_config_mismatch(fastset, __stringify(name), \ pipe_config_mismatch(fastset, crtc, __stringify(name), \
"(expected %i, found %i)", \ "(expected %i, found %i)", \
current_config->name, \ current_config->name, \
pipe_config->name); \ pipe_config->name); \
...@@ -12836,7 +12840,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, ...@@ -12836,7 +12840,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
#define PIPE_CONF_CHECK_BOOL(name) do { \ #define PIPE_CONF_CHECK_BOOL(name) do { \
if (current_config->name != pipe_config->name) { \ if (current_config->name != pipe_config->name) { \
pipe_config_mismatch(fastset, __stringify(name), \ pipe_config_mismatch(fastset, crtc, __stringify(name), \
"(expected %s, found %s)", \ "(expected %s, found %s)", \
yesno(current_config->name), \ yesno(current_config->name), \
yesno(pipe_config->name)); \ yesno(pipe_config->name)); \
...@@ -12853,7 +12857,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, ...@@ -12853,7 +12857,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
if (!fixup_inherited || (!current_config->name && !pipe_config->name)) { \ if (!fixup_inherited || (!current_config->name && !pipe_config->name)) { \
PIPE_CONF_CHECK_BOOL(name); \ PIPE_CONF_CHECK_BOOL(name); \
} else { \ } else { \
pipe_config_mismatch(fastset, __stringify(name), \ pipe_config_mismatch(fastset, crtc, __stringify(name), \
"unable to verify whether state matches exactly, forcing modeset (expected %s, found %s)", \ "unable to verify whether state matches exactly, forcing modeset (expected %s, found %s)", \
yesno(current_config->name), \ yesno(current_config->name), \
yesno(pipe_config->name)); \ yesno(pipe_config->name)); \
...@@ -12863,7 +12867,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, ...@@ -12863,7 +12867,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
#define PIPE_CONF_CHECK_P(name) do { \ #define PIPE_CONF_CHECK_P(name) do { \
if (current_config->name != pipe_config->name) { \ if (current_config->name != pipe_config->name) { \
pipe_config_mismatch(fastset, __stringify(name), \ pipe_config_mismatch(fastset, crtc, __stringify(name), \
"(expected %p, found %p)", \ "(expected %p, found %p)", \
current_config->name, \ current_config->name, \
pipe_config->name); \ pipe_config->name); \
...@@ -12875,7 +12879,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, ...@@ -12875,7 +12879,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
if (!intel_compare_link_m_n(&current_config->name, \ if (!intel_compare_link_m_n(&current_config->name, \
&pipe_config->name,\ &pipe_config->name,\
!fastset)) { \ !fastset)) { \
pipe_config_mismatch(fastset, __stringify(name), \ pipe_config_mismatch(fastset, crtc, __stringify(name), \
"(expected tu %i gmch %i/%i link %i/%i, " \ "(expected tu %i gmch %i/%i link %i/%i, " \
"found tu %i, gmch %i/%i link %i/%i)", \ "found tu %i, gmch %i/%i link %i/%i)", \
current_config->name.tu, \ current_config->name.tu, \
...@@ -12902,7 +12906,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, ...@@ -12902,7 +12906,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
&pipe_config->name, !fastset) && \ &pipe_config->name, !fastset) && \
!intel_compare_link_m_n(&current_config->alt_name, \ !intel_compare_link_m_n(&current_config->alt_name, \
&pipe_config->name, !fastset)) { \ &pipe_config->name, !fastset)) { \
pipe_config_mismatch(fastset, __stringify(name), \ pipe_config_mismatch(fastset, crtc, __stringify(name), \
"(expected tu %i gmch %i/%i link %i/%i, " \ "(expected tu %i gmch %i/%i link %i/%i, " \
"or tu %i gmch %i/%i link %i/%i, " \ "or tu %i gmch %i/%i link %i/%i, " \
"found tu %i, gmch %i/%i link %i/%i)", \ "found tu %i, gmch %i/%i link %i/%i)", \
...@@ -12927,7 +12931,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, ...@@ -12927,7 +12931,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
#define PIPE_CONF_CHECK_FLAGS(name, mask) do { \ #define PIPE_CONF_CHECK_FLAGS(name, mask) do { \
if ((current_config->name ^ pipe_config->name) & (mask)) { \ if ((current_config->name ^ pipe_config->name) & (mask)) { \
pipe_config_mismatch(fastset, __stringify(name), \ pipe_config_mismatch(fastset, crtc, __stringify(name), \
"(%x) (expected %i, found %i)", \ "(%x) (expected %i, found %i)", \
(mask), \ (mask), \
current_config->name & (mask), \ current_config->name & (mask), \
...@@ -12938,7 +12942,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, ...@@ -12938,7 +12942,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
#define PIPE_CONF_CHECK_CLOCK_FUZZY(name) do { \ #define PIPE_CONF_CHECK_CLOCK_FUZZY(name) do { \
if (!intel_fuzzy_clock_check(current_config->name, pipe_config->name)) { \ if (!intel_fuzzy_clock_check(current_config->name, pipe_config->name)) { \
pipe_config_mismatch(fastset, __stringify(name), \ pipe_config_mismatch(fastset, crtc, __stringify(name), \
"(expected %i, found %i)", \ "(expected %i, found %i)", \
current_config->name, \ current_config->name, \
pipe_config->name); \ pipe_config->name); \
...@@ -12958,7 +12962,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, ...@@ -12958,7 +12962,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
#define PIPE_CONF_CHECK_COLOR_LUT(name1, name2, bit_precision) do { \ #define PIPE_CONF_CHECK_COLOR_LUT(name1, name2, bit_precision) do { \
if (current_config->name1 != pipe_config->name1) { \ if (current_config->name1 != pipe_config->name1) { \
pipe_config_mismatch(fastset, __stringify(name1), \ pipe_config_mismatch(fastset, crtc, __stringify(name1), \
"(expected %i, found %i, won't compare lut values)", \ "(expected %i, found %i, won't compare lut values)", \
current_config->name1, \ current_config->name1, \
pipe_config->name1); \ pipe_config->name1); \
...@@ -12967,7 +12971,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, ...@@ -12967,7 +12971,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
if (!intel_color_lut_equal(current_config->name2, \ if (!intel_color_lut_equal(current_config->name2, \
pipe_config->name2, pipe_config->name1, \ pipe_config->name2, pipe_config->name1, \
bit_precision)) { \ bit_precision)) { \
pipe_config_mismatch(fastset, __stringify(name2), \ pipe_config_mismatch(fastset, crtc, __stringify(name2), \
"hw_state doesn't match sw_state"); \ "hw_state doesn't match sw_state"); \
ret = false; \ ret = false; \
} \ } \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment