Commit b091cd92 authored by Adam Jackson's avatar Adam Jackson Committed by Daniel Vetter

drm/i915/dp: Fetch downstream port info if needed during DPCD fetch

v2: Fix parenthesis mismatch, spotted by Jani Nikula
Tested-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
[danvet: Fixup merge conflict and MAX_DOWNSTREAM #define as spotted by
Jani.]
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent e89861df
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "i915_drm.h" #include "i915_drm.h"
#include "i915_drv.h" #include "i915_drv.h"
#define DP_RECEIVER_CAP_SIZE 0xf
#define DP_LINK_STATUS_SIZE 6 #define DP_LINK_STATUS_SIZE 6
#define DP_LINK_CHECK_TIMEOUT (10 * 1000) #define DP_LINK_CHECK_TIMEOUT (10 * 1000)
...@@ -1964,12 +1965,25 @@ static bool ...@@ -1964,12 +1965,25 @@ static bool
intel_dp_get_dpcd(struct intel_dp *intel_dp) intel_dp_get_dpcd(struct intel_dp *intel_dp)
{ {
if (intel_dp_aux_native_read_retry(intel_dp, 0x000, intel_dp->dpcd, if (intel_dp_aux_native_read_retry(intel_dp, 0x000, intel_dp->dpcd,
sizeof(intel_dp->dpcd)) && sizeof(intel_dp->dpcd)) == 0)
(intel_dp->dpcd[DP_DPCD_REV] != 0)) { return false; /* aux transfer failed */
return true;
}
return false; if (intel_dp->dpcd[DP_DPCD_REV] == 0)
return false; /* DPCD not present */
if (!(intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
DP_DWN_STRM_PORT_PRESENT))
return true; /* native DP sink */
if (intel_dp->dpcd[DP_DPCD_REV] == 0x10)
return true; /* no per-port downstream info */
if (intel_dp_aux_native_read_retry(intel_dp, DP_DOWNSTREAM_PORT_0,
intel_dp->downstream_ports,
DP_MAX_DOWNSTREAM_PORTS) == 0)
return false; /* downstream port status fetch failed */
return true;
} }
static void static void
......
...@@ -332,6 +332,7 @@ struct intel_hdmi { ...@@ -332,6 +332,7 @@ struct intel_hdmi {
}; };
#define DP_RECEIVER_CAP_SIZE 0xf #define DP_RECEIVER_CAP_SIZE 0xf
#define DP_MAX_DOWNSTREAM_PORTS 0x10
#define DP_LINK_CONFIGURATION_SIZE 9 #define DP_LINK_CONFIGURATION_SIZE 9
struct intel_dp { struct intel_dp {
...@@ -346,6 +347,7 @@ struct intel_dp { ...@@ -346,6 +347,7 @@ struct intel_dp {
uint8_t link_bw; uint8_t link_bw;
uint8_t lane_count; uint8_t lane_count;
uint8_t dpcd[DP_RECEIVER_CAP_SIZE]; uint8_t dpcd[DP_RECEIVER_CAP_SIZE];
uint8_t downstream_ports[DP_MAX_DOWNSTREAM_PORTS];
struct i2c_adapter adapter; struct i2c_adapter adapter;
struct i2c_algo_dp_aux_data algo; struct i2c_algo_dp_aux_data algo;
bool is_pch_edp; bool is_pch_edp;
......
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