drm/i915/dp: Validate the compliance test link parameters
authorManasi Navare <manasi.d.navare@intel.com>
Thu, 8 Jun 2017 20:41:03 +0000 (13:41 -0700)
committerJani Nikula <jani.nikula@intel.com>
Tue, 15 Aug 2017 07:32:25 +0000 (10:32 +0300)
commit140ef138db07285b9eecf14ae3ee7c0a407ab93a
treed2f7410637364849e69a7a8a2de46b4f85bcd8e7
parent1a92c70ed8053855811d5e8c62e6a14e1d06e4ab
drm/i915/dp: Validate the compliance test link parameters

Validate the compliance test link parameters when the compliance
test dpcd registers are read. Also validate them in compute_config
before using them since the max values might have been reduced
due to link training fallback.

If either the link rate or lane count is invalid, we still bail
from using the test parameters since the combination would not work
and instead use the fallback values.

v2:
* Added commit message to explain why we still bail when either of
of the params is invalid (Ville Syrjala)
* Add reason for validating in the comment (Jani Nikula)
* Also check if index >= 0 after validating (Jani Nikula)

Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Tested-by: Nathan Ciobanu <nathan.d.ciobanu@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1496954463-18038-2-git-send-email-manasi.d.navare@intel.com
drivers/gpu/drm/i915/intel_dp.c