drm/i915/dp: Sanitize sink rate DPCD register values
authorImre Deak <imre.deak@intel.com>
Mon, 18 Oct 2021 09:41:53 +0000 (12:41 +0300)
committerImre Deak <imre.deak@intel.com>
Wed, 20 Oct 2021 09:20:27 +0000 (12:20 +0300)
commitcaae4fb537d8437b9290d8a1010adfaf174b29e6
treee55e9b3ea23e7d31e803e451f94f8c22f210d4c7
parentbedcaddadd22da82fc2590569ff81a31045176b1
drm/i915/dp: Sanitize sink rate DPCD register values

If the DPCD sink rate values read from the sink are invalid, the
driver will sanitize this in intel_dp_set_common_rates(), by setting a
default 162000 link rate in common rates and printing a WARN().

WARN()s should only be triggered by bugs in the code and not by external
factors like the above (an invalid DPCD injected maliciously or read from a
buggy monitor). So fixup the invalid DPCD sink rate values already and print
an error in this case (since it's still a user visible problem).

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211018094154.1407705-6-imre.deak@intel.com
drivers/gpu/drm/i915/display/intel_dp.c