drm/i915: Avoid a full port detection in the first eDP short pulse

Some eDP panels do not set a valid sink count value and even for the
ones that sets is should always be one for eDP, that is why it is not
cached in intel_edp_init_dpcd().

But intel_dp_short_pulse() compares the old count with the read one
if there is a mistmatch a full port detection will be executed, what
was happening in the first short pulse interruption of eDP panels
that sets sink count.

Instead of just skip the compasison for eDP panels, lets not read
the sink count at all for eDP.

v2: the previous version of this patch it was caching the sink count
in intel_edp_init_dpcd() but I was pointed out by Ville a patch that
handled a case of a eDP panel that do not set sink count and as sink
count is not used to eDP certification was choosed to just not read
it at all.

Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181121225441.18785-1-jose.souza@intel.com
parent 6fc5d789
...@@ -3936,8 +3936,6 @@ intel_edp_init_dpcd(struct intel_dp *intel_dp) ...@@ -3936,8 +3936,6 @@ intel_edp_init_dpcd(struct intel_dp *intel_dp)
static bool static bool
intel_dp_get_dpcd(struct intel_dp *intel_dp) intel_dp_get_dpcd(struct intel_dp *intel_dp)
{ {
u8 sink_count;
if (!intel_dp_read_dpcd(intel_dp)) if (!intel_dp_read_dpcd(intel_dp))
return false; return false;
...@@ -3947,7 +3945,16 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp) ...@@ -3947,7 +3945,16 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
intel_dp_set_common_rates(intel_dp); intel_dp_set_common_rates(intel_dp);
} }
if (drm_dp_dpcd_readb(&intel_dp->aux, DP_SINK_COUNT, &sink_count) <= 0) /*
* Some eDP panels do not set a valid value for sink count, that is why
* it don't care about read it here and in intel_edp_init_dpcd().
*/
if (!intel_dp_is_edp(intel_dp)) {
u8 count;
ssize_t r;
r = drm_dp_dpcd_readb(&intel_dp->aux, DP_SINK_COUNT, &count);
if (r < 1)
return false; return false;
/* /*
...@@ -3955,7 +3962,7 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp) ...@@ -3955,7 +3962,7 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
* a member variable in intel_dp will track any changes * a member variable in intel_dp will track any changes
* between short pulse interrupts. * between short pulse interrupts.
*/ */
intel_dp->sink_count = DP_GET_SINK_COUNT(sink_count); intel_dp->sink_count = DP_GET_SINK_COUNT(count);
/* /*
* SINK_COUNT == 0 and DOWNSTREAM_PORT_PRESENT == 1 implies that * SINK_COUNT == 0 and DOWNSTREAM_PORT_PRESENT == 1 implies that
...@@ -3964,8 +3971,9 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp) ...@@ -3964,8 +3971,9 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
* downstream port information. So, an early return here saves * downstream port information. So, an early return here saves
* time from performing other operations which are not required. * time from performing other operations which are not required.
*/ */
if (!intel_dp_is_edp(intel_dp) && !intel_dp->sink_count) if (!intel_dp->sink_count)
return false; return false;
}
if (!drm_dp_is_branch(intel_dp->dpcd)) if (!drm_dp_is_branch(intel_dp->dpcd))
return true; /* native DP sink */ return true; /* native DP sink */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment