Commit dde84833 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Make pipe_config_err() vs. fastset less confusing

Rename pipe_config_err() to pipe_config_mismatch(), and also print
whether we're doing the fastset check or the sw vs. hw state readout
check. Should make the logs a bit less confusing when they're not
filled with what looks like a real error.

Also rename the 'adjust' variable to 'fastset' to make it clear what
it means.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190612130801.2085-3-ville.syrjala@linux.intel.comReviewed-by: default avatarImre Deak <imre.deak@intel.com>
parent b124ea43
...@@ -12310,16 +12310,16 @@ intel_compare_infoframe(const union hdmi_infoframe *a, ...@@ -12310,16 +12310,16 @@ intel_compare_infoframe(const union hdmi_infoframe *a,
} }
static void static void
pipe_config_infoframe_err(struct drm_i915_private *dev_priv, pipe_config_infoframe_mismatch(struct drm_i915_private *dev_priv,
bool adjust, const char *name, bool fastset, const char *name,
const union hdmi_infoframe *a, const union hdmi_infoframe *a,
const union hdmi_infoframe *b) const union hdmi_infoframe *b)
{ {
if (adjust) { if (fastset) {
if ((drm_debug & DRM_UT_KMS) == 0) if ((drm_debug & DRM_UT_KMS) == 0)
return; return;
drm_dbg(DRM_UT_KMS, "mismatch in %s infoframe", name); drm_dbg(DRM_UT_KMS, "fastset mismatch in %s infoframe", name);
drm_dbg(DRM_UT_KMS, "expected:"); drm_dbg(DRM_UT_KMS, "expected:");
hdmi_infoframe_log(KERN_DEBUG, dev_priv->drm.dev, a); hdmi_infoframe_log(KERN_DEBUG, dev_priv->drm.dev, a);
drm_dbg(DRM_UT_KMS, "found"); drm_dbg(DRM_UT_KMS, "found");
...@@ -12334,7 +12334,7 @@ pipe_config_infoframe_err(struct drm_i915_private *dev_priv, ...@@ -12334,7 +12334,7 @@ pipe_config_infoframe_err(struct drm_i915_private *dev_priv,
} }
static void __printf(3, 4) static void __printf(3, 4)
pipe_config_err(bool adjust, const char *name, const char *format, ...) pipe_config_mismatch(bool fastset, const char *name, const char *format, ...)
{ {
struct va_format vaf; struct va_format vaf;
va_list args; va_list args;
...@@ -12343,8 +12343,8 @@ pipe_config_err(bool adjust, const char *name, const char *format, ...) ...@@ -12343,8 +12343,8 @@ pipe_config_err(bool adjust, const char *name, const char *format, ...)
vaf.fmt = format; vaf.fmt = format;
vaf.va = &args; vaf.va = &args;
if (adjust) if (fastset)
drm_dbg(DRM_UT_KMS, "mismatch in %s %pV", name, &vaf); drm_dbg(DRM_UT_KMS, "fastset mismatch in %s %pV", name, &vaf);
else else
drm_err("mismatch in %s %pV", name, &vaf); drm_err("mismatch in %s %pV", name, &vaf);
...@@ -12371,11 +12371,11 @@ static bool fastboot_enabled(struct drm_i915_private *dev_priv) ...@@ -12371,11 +12371,11 @@ static bool fastboot_enabled(struct drm_i915_private *dev_priv)
static bool static bool
intel_pipe_config_compare(const struct intel_crtc_state *current_config, intel_pipe_config_compare(const struct intel_crtc_state *current_config,
const struct intel_crtc_state *pipe_config, const struct intel_crtc_state *pipe_config,
bool adjust) 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);
bool ret = true; bool ret = true;
bool fixup_inherited = adjust && bool fixup_inherited = fastset &&
(current_config->base.mode.private_flags & I915_MODE_FLAG_INHERITED) && (current_config->base.mode.private_flags & I915_MODE_FLAG_INHERITED) &&
!(pipe_config->base.mode.private_flags & I915_MODE_FLAG_INHERITED); !(pipe_config->base.mode.private_flags & I915_MODE_FLAG_INHERITED);
...@@ -12386,30 +12386,30 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, ...@@ -12386,30 +12386,30 @@ 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_err(adjust, __stringify(name), \ pipe_config_mismatch(fastset, __stringify(name), \
"(expected 0x%08x, found 0x%08x)\n", \ "(expected 0x%08x, found 0x%08x)\n", \
current_config->name, \ current_config->name, \
pipe_config->name); \ pipe_config->name); \
ret = false; \ ret = false; \
} \ } \
} while (0) } while (0)
#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_err(adjust, __stringify(name), \ pipe_config_mismatch(fastset, __stringify(name), \
"(expected %i, found %i)\n", \ "(expected %i, found %i)\n", \
current_config->name, \ current_config->name, \
pipe_config->name); \ pipe_config->name); \
ret = false; \ ret = false; \
} \ } \
} while (0) } while (0)
#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_err(adjust, __stringify(name), \ pipe_config_mismatch(fastset, __stringify(name), \
"(expected %s, found %s)\n", \ "(expected %s, found %s)\n", \
yesno(current_config->name), \ yesno(current_config->name), \
yesno(pipe_config->name)); \ yesno(pipe_config->name)); \
ret = false; \ ret = false; \
} \ } \
} while (0) } while (0)
...@@ -12423,20 +12423,20 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, ...@@ -12423,20 +12423,20 @@ 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_err(adjust, __stringify(name), \ pipe_config_mismatch(fastset, __stringify(name), \
"unable to verify whether state matches exactly, forcing modeset (expected %s, found %s)\n", \ "unable to verify whether state matches exactly, forcing modeset (expected %s, found %s)\n", \
yesno(current_config->name), \ yesno(current_config->name), \
yesno(pipe_config->name)); \ yesno(pipe_config->name)); \
ret = false; \ ret = false; \
} \ } \
} while (0) } while (0)
#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_err(adjust, __stringify(name), \ pipe_config_mismatch(fastset, __stringify(name), \
"(expected %p, found %p)\n", \ "(expected %p, found %p)\n", \
current_config->name, \ current_config->name, \
pipe_config->name); \ pipe_config->name); \
ret = false; \ ret = false; \
} \ } \
} while (0) } while (0)
...@@ -12444,20 +12444,20 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, ...@@ -12444,20 +12444,20 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
#define PIPE_CONF_CHECK_M_N(name) do { \ #define PIPE_CONF_CHECK_M_N(name) do { \
if (!intel_compare_link_m_n(&current_config->name, \ if (!intel_compare_link_m_n(&current_config->name, \
&pipe_config->name,\ &pipe_config->name,\
!adjust)) { \ !fastset)) { \
pipe_config_err(adjust, __stringify(name), \ pipe_config_mismatch(fastset, __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)\n", \ "found tu %i, gmch %i/%i link %i/%i)\n", \
current_config->name.tu, \ current_config->name.tu, \
current_config->name.gmch_m, \ current_config->name.gmch_m, \
current_config->name.gmch_n, \ current_config->name.gmch_n, \
current_config->name.link_m, \ current_config->name.link_m, \
current_config->name.link_n, \ current_config->name.link_n, \
pipe_config->name.tu, \ pipe_config->name.tu, \
pipe_config->name.gmch_m, \ pipe_config->name.gmch_m, \
pipe_config->name.gmch_n, \ pipe_config->name.gmch_n, \
pipe_config->name.link_m, \ pipe_config->name.link_m, \
pipe_config->name.link_n); \ pipe_config->name.link_n); \
ret = false; \ ret = false; \
} \ } \
} while (0) } while (0)
...@@ -12469,49 +12469,49 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, ...@@ -12469,49 +12469,49 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
*/ */
#define PIPE_CONF_CHECK_M_N_ALT(name, alt_name) do { \ #define PIPE_CONF_CHECK_M_N_ALT(name, alt_name) do { \
if (!intel_compare_link_m_n(&current_config->name, \ if (!intel_compare_link_m_n(&current_config->name, \
&pipe_config->name, !adjust) && \ &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, !adjust)) { \ &pipe_config->name, !fastset)) { \
pipe_config_err(adjust, __stringify(name), \ pipe_config_mismatch(fastset, __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)\n", \ "found tu %i, gmch %i/%i link %i/%i)\n", \
current_config->name.tu, \ current_config->name.tu, \
current_config->name.gmch_m, \ current_config->name.gmch_m, \
current_config->name.gmch_n, \ current_config->name.gmch_n, \
current_config->name.link_m, \ current_config->name.link_m, \
current_config->name.link_n, \ current_config->name.link_n, \
current_config->alt_name.tu, \ current_config->alt_name.tu, \
current_config->alt_name.gmch_m, \ current_config->alt_name.gmch_m, \
current_config->alt_name.gmch_n, \ current_config->alt_name.gmch_n, \
current_config->alt_name.link_m, \ current_config->alt_name.link_m, \
current_config->alt_name.link_n, \ current_config->alt_name.link_n, \
pipe_config->name.tu, \ pipe_config->name.tu, \
pipe_config->name.gmch_m, \ pipe_config->name.gmch_m, \
pipe_config->name.gmch_n, \ pipe_config->name.gmch_n, \
pipe_config->name.link_m, \ pipe_config->name.link_m, \
pipe_config->name.link_n); \ pipe_config->name.link_n); \
ret = false; \ ret = false; \
} \ } \
} while (0) } while (0)
#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_err(adjust, __stringify(name), \ pipe_config_mismatch(fastset, __stringify(name), \
"(%x) (expected %i, found %i)\n", \ "(%x) (expected %i, found %i)\n", \
(mask), \ (mask), \
current_config->name & (mask), \ current_config->name & (mask), \
pipe_config->name & (mask)); \ pipe_config->name & (mask)); \
ret = false; \ ret = false; \
} \ } \
} while (0) } while (0)
#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_err(adjust, __stringify(name), \ pipe_config_mismatch(fastset, __stringify(name), \
"(expected %i, found %i)\n", \ "(expected %i, found %i)\n", \
current_config->name, \ current_config->name, \
pipe_config->name); \ pipe_config->name); \
ret = false; \ ret = false; \
} \ } \
} while (0) } while (0)
...@@ -12519,9 +12519,9 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, ...@@ -12519,9 +12519,9 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
#define PIPE_CONF_CHECK_INFOFRAME(name) do { \ #define PIPE_CONF_CHECK_INFOFRAME(name) do { \
if (!intel_compare_infoframe(&current_config->infoframes.name, \ if (!intel_compare_infoframe(&current_config->infoframes.name, \
&pipe_config->infoframes.name)) { \ &pipe_config->infoframes.name)) { \
pipe_config_infoframe_err(dev_priv, adjust, __stringify(name), \ pipe_config_infoframe_mismatch(dev_priv, fastset, __stringify(name), \
&current_config->infoframes.name, \ &current_config->infoframes.name, \
&pipe_config->infoframes.name); \ &pipe_config->infoframes.name); \
ret = false; \ ret = false; \
} \ } \
} while (0) } while (0)
...@@ -12601,7 +12601,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, ...@@ -12601,7 +12601,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
*/ */
PIPE_CONF_CHECK_BOOL(pch_pfit.force_thru); PIPE_CONF_CHECK_BOOL(pch_pfit.force_thru);
if (!adjust) { if (!fastset) {
PIPE_CONF_CHECK_I(pipe_src_w); PIPE_CONF_CHECK_I(pipe_src_w);
PIPE_CONF_CHECK_I(pipe_src_h); PIPE_CONF_CHECK_I(pipe_src_h);
......
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