DRM/i915: Restore sdvo_flags after dtd->mode->dtd Roundrtrip.
Subsystems (2)
PATCH 1/1 DRM/i915: Restore sdvo_flags after dtd->mode->dtd Roundrtrip.
For TV and LVDS encoders intel_sdvo_set_input_timings_for_mode() is called to pass a mode to the sdvo chip and retrieve a dtd containing information needed to calculate the adjusted_mode which is done by intel_sdvo_get_dtd_from_mode().
To set this adjusted_mode as input mode for the sdvo chip, a dtd is recalculated using intel_sdvo_get_mode_from_dtd(). During this round trip the sdvo_flags contained in the dtd obtained from the hardware are lost.
Since these flags cannot be ignored in all cases this patch preserves and restores them.
This regression has been introduced in
commit 6651819b4b4fc3caa6964c5d825eb4bb996f3905
Author: Daniel Vetter <[email protected]> Date: Sun Apr 1 19:16:18 2012 +0200
drm/i915: handle input/output sdvo timings separately in mode_set
--- drivers/gpu/drm/i915/intel_sdvo.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
drivers/gpu/drm/i915/intel_sdvo.c +8 -0
@@ -140,6 +140,11 @@ struct intel_sdvo {/* DDC bus used by this SDVO encoder */ uint8_t ddc_bus; + +/* +* the sdvo flag gets lost in round trip: dtd->adjusted_mode->dtd +*/ +uint8_t dtd_sdvo_flags; };struct intel_sdvo_connector {
@@ -985,6 +990,7 @@ intel_sdvo_get_preferred_input_mode(struct intel_sdvo *intel_sdvo,return false;intel_sdvo_get_mode_from_dtd (adjusted_mode, &input_dtd); + intel_sdvo->dtd_sdvo_flags = input_dtd.part2.sdvo_flags;return true; }
@@ -1093,6 +1099,8 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder,* adjusted_mode. */ intel_sdvo_get_dtd_from_mode (&input_dtd, adjusted_mode); +if (intel_sdvo->is_tv || intel_sdvo->is_lvds) + input_dtd.part2.sdvo_flags = intel_sdvo->dtd_sdvo_flags;if (!intel_sdvo_set_input_timing (intel_sdvo, &input_dtd))DRM_INFO ("Setting input timings on %s failed\n" ,SDVO_NAME (intel_sdvo));
Signature · 1 line
1.7.6.3
Quoted 13 lines · Egbert Eich
For TV and LVDS encoders
intel_sdvo_set_input_timings_for_mode()is called to pass a mode to the sdvo chip and retrieve a dtd containing information needed to calculate theadjusted_modewhich is done byintel_sdvo_get_dtd_from_mode().
To set thisadjusted_modeas input mode for the sdvo chip, a dtd is recalculated usingintel_sdvo_get_mode_from_dtd(). During this round trip thesdvo_flagscontained in the dtd obtained from the hardware are lost.
Since these flags cannot be ignored in all cases this patch preserves and restores them.This regression has been introduced in
Quoted 7 lines
commit
6651819b4b4fc3caa6964c5d825eb4bb996f3905Author: Daniel Vetter <[email protected]> Date: Sun Apr 1 19:16:18 2012 +0200drm/i915: handle input/output sdvo timings separately in
mode_setSigned-off-by Egbert Eich <[email protected]>
Long term we need to decently improve our adjusted_mode handling and stop shoveling random state into random structures. Short-term this looks good enough. Thanks for the patch, applied.
-Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch