Commit 4493e098 authored by Maarten Lankhorst's avatar Maarten Lankhorst

drm/i915: Handle adjust better in intel_pipe_config_compare

Some parameters use CHECK_BOOL, but should really use
CHECK_BOOL_INCOMPLETE. We cannot currently check whether
the inherited infoframes and audio are set up correctly.
Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171110113503.16253-4-maarten.lankhorst@linux.intel.com
[mlankhorst: Add danvet's comment about why this is needed.]
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent d640bf79
...@@ -11073,6 +11073,9 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv, ...@@ -11073,6 +11073,9 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv,
bool adjust) bool adjust)
{ {
bool ret = true; bool ret = true;
bool fixup_inherited = adjust &&
(current_config->base.mode.private_flags & I915_MODE_FLAG_INHERITED) &&
!(pipe_config->base.mode.private_flags & I915_MODE_FLAG_INHERITED);
#define PIPE_CONF_CHECK_X(name) \ #define PIPE_CONF_CHECK_X(name) \
if (current_config->name != pipe_config->name) { \ if (current_config->name != pipe_config->name) { \
...@@ -11101,6 +11104,22 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv, ...@@ -11101,6 +11104,22 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv,
ret = false; \ ret = false; \
} }
/*
* Checks state where we only read out the enabling, but not the entire
* state itself (like full infoframes or ELD for audio). These states
* require a full modeset on bootup to fix up.
*/
#define PIPE_CONF_CHECK_BOOL_INCOMPLETE(name) \
if (!fixup_inherited || (!current_config->name && !pipe_config->name)) { \
PIPE_CONF_CHECK_BOOL(name); \
} else { \
pipe_config_err(adjust, __stringify(name), \
"unable to verify whether state matches exactly, forcing modeset (expected %s, found %s)\n", \
yesno(current_config->name), \
yesno(pipe_config->name)); \
ret = false; \
}
#define PIPE_CONF_CHECK_P(name) \ #define PIPE_CONF_CHECK_P(name) \
if (current_config->name != pipe_config->name) { \ if (current_config->name != pipe_config->name) { \
pipe_config_err(adjust, __stringify(name), \ pipe_config_err(adjust, __stringify(name), \
...@@ -11225,10 +11244,10 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv, ...@@ -11225,10 +11244,10 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv,
PIPE_CONF_CHECK_BOOL(hdmi_scrambling); PIPE_CONF_CHECK_BOOL(hdmi_scrambling);
PIPE_CONF_CHECK_BOOL(hdmi_high_tmds_clock_ratio); PIPE_CONF_CHECK_BOOL(hdmi_high_tmds_clock_ratio);
PIPE_CONF_CHECK_BOOL(has_infoframe); PIPE_CONF_CHECK_BOOL_INCOMPLETE(has_infoframe);
PIPE_CONF_CHECK_BOOL(ycbcr420); PIPE_CONF_CHECK_BOOL(ycbcr420);
PIPE_CONF_CHECK_BOOL(has_audio); PIPE_CONF_CHECK_BOOL_INCOMPLETE(has_audio);
PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags, PIPE_CONF_CHECK_FLAGS(base.adjusted_mode.flags,
DRM_MODE_FLAG_INTERLACE); DRM_MODE_FLAG_INTERLACE);
...@@ -11303,6 +11322,7 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv, ...@@ -11303,6 +11322,7 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv,
#undef PIPE_CONF_CHECK_X #undef PIPE_CONF_CHECK_X
#undef PIPE_CONF_CHECK_I #undef PIPE_CONF_CHECK_I
#undef PIPE_CONF_CHECK_BOOL #undef PIPE_CONF_CHECK_BOOL
#undef PIPE_CONF_CHECK_BOOL_INCOMPLETE
#undef PIPE_CONF_CHECK_P #undef PIPE_CONF_CHECK_P
#undef PIPE_CONF_CHECK_FLAGS #undef PIPE_CONF_CHECK_FLAGS
#undef PIPE_CONF_CHECK_CLOCK_FUZZY #undef PIPE_CONF_CHECK_CLOCK_FUZZY
......
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