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 07:58:32 +0000 (10:58 +0300)
commit08c59dde71b73a0ac94e3ed2d431345b01f20485
tree9efba74b8caa4433c04f5027bf2f7e0e6bf8633a
parent5f38c3fb55ce3814b4353320d7a205068a420e48
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
drivers/gpu/drm/i915/display/intel_dsi_vbt.c