Skip to content

Commit 7c838e2

Browse files
jnikularodrigovivi
authored andcommitted
drm/i915/edp: read edp display control registers unconditionally
Per my reading of the eDP spec, DP_DPCD_DISPLAY_CONTROL_CAPABLE bit in DP_EDP_CONFIGURATION_CAP should be set if the eDP display control registers starting at offset DP_EDP_DPCD_REV are "enabled". Currently we check the bit before reading the registers, and DP_EDP_DPCD_REV is the only way to detect eDP revision. Turns out there are (likely buggy) displays that require eDP 1.4+ features, such as supported link rates and link rate select, but do not have the bit set. Read the display control registers unconditionally. They are supposed to read zero anyway if they are not supported, so there should be no harm in this. This fixes the referenced bug by enabling the eDP version check, and thus reading of the supported link rates. The panel in question has 0 in DP_MAX_LINK_RATE which is only supported in eDP 1.4+. Without the supported link rates method we default to RBR which is insufficient for the panel native mode. As a curiosity, the panel also has a bogus value of 0x12 in DP_EDP_DPCD_REV, but that passes our check for >= DP_EDP_14 (which is 0x03). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103400 Reported-and-tested-by: Nicolas P. <issun.artiste@gmail.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: stable@vger.kernel.org Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Manasi Navare <manasi.d.navare@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20171026142932.17737-1-jani.nikula@intel.com (cherry picked from commit 0501a3b) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
1 parent 8777b92 commit 7c838e2

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

drivers/gpu/drm/i915/intel_dp.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3731,9 +3731,16 @@ intel_edp_init_dpcd(struct intel_dp *intel_dp)
37313731

37323732
}
37333733

3734-
/* Read the eDP Display control capabilities registers */
3735-
if ((intel_dp->dpcd[DP_EDP_CONFIGURATION_CAP] & DP_DPCD_DISPLAY_CONTROL_CAPABLE) &&
3736-
drm_dp_dpcd_read(&intel_dp->aux, DP_EDP_DPCD_REV,
3734+
/*
3735+
* Read the eDP display control registers.
3736+
*
3737+
* Do this independent of DP_DPCD_DISPLAY_CONTROL_CAPABLE bit in
3738+
* DP_EDP_CONFIGURATION_CAP, because some buggy displays do not have it
3739+
* set, but require eDP 1.4+ detection (e.g. for supported link rates
3740+
* method). The display control registers should read zero if they're
3741+
* not supported anyway.
3742+
*/
3743+
if (drm_dp_dpcd_read(&intel_dp->aux, DP_EDP_DPCD_REV,
37373744
intel_dp->edp_dpcd, sizeof(intel_dp->edp_dpcd)) ==
37383745
sizeof(intel_dp->edp_dpcd))
37393746
DRM_DEBUG_KMS("EDP DPCD : %*ph\n", (int) sizeof(intel_dp->edp_dpcd),

0 commit comments

Comments
 (0)