drm/i915/dsi: fix VBT send packet port selection for ICL+
authorJani Nikula <jani.nikula@intel.com>
Fri, 20 May 2022 09:46:00 +0000 (12:46 +0300)
committerJani Nikula <jani.nikula@intel.com>
Mon, 23 May 2022 09:08:58 +0000 (12:08 +0300)
commit0ea917819d12fed41ea4662cc26ffa0060a5c354
tree874c5ef30d52ade040d255dda5853df2237b3c5f
parent069617295650ec2ba27a8f22da10056d3e1160b3
drm/i915/dsi: fix VBT send packet port selection for ICL+

The VBT send packet port selection was never updated for ICL+ where the
2nd link is on port B instead of port C as in VLV+ DSI.

First, single link DSI needs to use the configured port instead of
relying on the VBT sequence block port. Remove the hard-coded port C
check here and make it generic. For reference, see commit f915084edc5a
("drm/i915: Changes related to the sequence port no for") for the
original VLV specific fix.

Second, the sequence block port number is either 0 or 1, where 1
indicates the 2nd link. Remove the hard-coded port C here for 2nd
link. (This could be a "find second set bit" on DSI ports, but just
check the two possible options.)

Third, sanity check the result with a warning to avoid a NULL pointer
dereference.

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5984
Cc: stable@vger.kernel.org # v4.19+
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220520094600.2066945-1-jani.nikula@intel.com
(cherry picked from commit 08c59dde71b73a0ac94e3ed2d431345b01f20485)
drivers/gpu/drm/i915/display/intel_dsi_vbt.c