aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_dp.c
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2012-09-18 10:58:49 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-10-02 12:06:06 -0400
commitedb39244fad2e96ba03ea97a4b2c585c7f2fc7e4 (patch)
treeaac9701d1d9e28a7bb33a4914257485169392162 /drivers/gpu/drm/i915/intel_dp.c
parent4e64753a0e697919be1ecc2d5fca1eb5b4358bf3 (diff)
drm/i915/dp: Fetch downstream port info if needed during DPCD fetch
v2: Fix parenthesis mismatch, spotted by Jani Nikula Tested-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> [danvet: Fixup merge conflict and MAX_DOWNSTREAM #define as spotted by Jani.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dp.c')
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 1474f84fdbd0..42bdca47c5d6 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -37,6 +37,7 @@
37#include "i915_drm.h" 37#include "i915_drm.h"
38#include "i915_drv.h" 38#include "i915_drv.h"
39 39
40#define DP_RECEIVER_CAP_SIZE 0xf
40#define DP_LINK_STATUS_SIZE 6 41#define DP_LINK_STATUS_SIZE 6
41#define DP_LINK_CHECK_TIMEOUT (10 * 1000) 42#define DP_LINK_CHECK_TIMEOUT (10 * 1000)
42 43
@@ -1964,12 +1965,25 @@ static bool
1964intel_dp_get_dpcd(struct intel_dp *intel_dp) 1965intel_dp_get_dpcd(struct intel_dp *intel_dp)
1965{ 1966{
1966 if (intel_dp_aux_native_read_retry(intel_dp, 0x000, intel_dp->dpcd, 1967 if (intel_dp_aux_native_read_retry(intel_dp, 0x000, intel_dp->dpcd,
1967 sizeof(intel_dp->dpcd)) && 1968 sizeof(intel_dp->dpcd)) == 0)
1968 (intel_dp->dpcd[DP_DPCD_REV] != 0)) { 1969 return false; /* aux transfer failed */
1969 return true;
1970 }
1971 1970
1972 return false; 1971 if (intel_dp->dpcd[DP_DPCD_REV] == 0)
1972 return false; /* DPCD not present */
1973
1974 if (!(intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
1975 DP_DWN_STRM_PORT_PRESENT))
1976 return true; /* native DP sink */
1977
1978 if (intel_dp->dpcd[DP_DPCD_REV] == 0x10)
1979 return true; /* no per-port downstream info */
1980
1981 if (intel_dp_aux_native_read_retry(intel_dp, DP_DOWNSTREAM_PORT_0,
1982 intel_dp->downstream_ports,
1983 DP_MAX_DOWNSTREAM_PORTS) == 0)
1984 return false; /* downstream port status fetch failed */
1985
1986 return true;
1973} 1987}
1974 1988
1975static void 1989static void