drm/i915: Try to use the correct power sequencer intiially on bxt/glk
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 25 Nov 2022 17:31:51 +0000 (19:31 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 9 Dec 2022 17:02:49 +0000 (19:02 +0200)
commitbf38bba3e7d635ff1b6abc097f50094d100e90e2
tree14f64ada081b6d1a927ecd08811235040c4a7402
parent209074fd5a8217688b9ee5c200d470df3e32dee1
drm/i915: Try to use the correct power sequencer intiially on bxt/glk

Currently on bxt/glk we just grab the power sequencer index from
the VBT data even though it may not have been parsed yet. That
could lead us to using the incorrect power sequencer during the
initial panel probe.

To avoid that let's try to read out the current state of the
power sequencer from the hardware. Unfortunately the power
sequencer no longer has anything in its registers to associate
it with the port, so the best we can do is just iterate through
the power sequencers and pick the first one. This should be
sufficient for single panel cases.

For the dual panel cases we probably need to go back to
parsing the VBT before the panel probe (and hope that
panel_type=0xff is never a thing in those cases). To that
end the code always prefers the VBT panel sequencer, if
available.

v2: Restructure a bit for upcoming icp+ dual PPS support

Cc: Animesh Manna <animesh.manna@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221125173156.31689-5-ville.syrjala@linux.intel.com
Reviewed-by: Animesh Manna <animesh.manna@intel.com>
drivers/gpu/drm/i915/display/intel_display_types.h
drivers/gpu/drm/i915/display/intel_panel.c
drivers/gpu/drm/i915/display/intel_pps.c