diff options
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index fcab9dee93da..a86af0d24fd3 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include "i915_drv.h" | 35 | #include "i915_drv.h" |
36 | #include "intel_dp.h" | 36 | #include "intel_dp.h" |
37 | 37 | ||
38 | |||
38 | #define DP_LINK_STATUS_SIZE 6 | 39 | #define DP_LINK_STATUS_SIZE 6 |
39 | #define DP_LINK_CHECK_TIMEOUT (10 * 1000) | 40 | #define DP_LINK_CHECK_TIMEOUT (10 * 1000) |
40 | 41 | ||
@@ -1228,7 +1229,53 @@ intel_dp_hot_plug(struct intel_output *intel_output) | |||
1228 | if (dp_priv->dpms_mode == DRM_MODE_DPMS_ON) | 1229 | if (dp_priv->dpms_mode == DRM_MODE_DPMS_ON) |
1229 | intel_dp_check_link_status(intel_output); | 1230 | intel_dp_check_link_status(intel_output); |
1230 | } | 1231 | } |
1231 | 1232 | /* | |
1233 | * Enumerate the child dev array parsed from VBT to check whether | ||
1234 | * the given DP is present. | ||
1235 | * If it is present, return 1. | ||
1236 | * If it is not present, return false. | ||
1237 | * If no child dev is parsed from VBT, it is assumed that the given | ||
1238 | * DP is present. | ||
1239 | */ | ||
1240 | int dp_is_present_in_vbt(struct drm_device *dev, int dp_reg) | ||
1241 | { | ||
1242 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
1243 | struct child_device_config *p_child; | ||
1244 | int i, dp_port, ret; | ||
1245 | |||
1246 | if (!dev_priv->child_dev_num) | ||
1247 | return 1; | ||
1248 | |||
1249 | dp_port = 0; | ||
1250 | if (dp_reg == DP_B || PCH_DP_B) | ||
1251 | dp_port = PORT_IDPB; | ||
1252 | else if (dp_reg == DP_C || PCH_DP_C) | ||
1253 | dp_port = PORT_IDPC; | ||
1254 | else if (dp_reg == DP_D || PCH_DP_D) | ||
1255 | dp_port = PORT_IDPD; | ||
1256 | |||
1257 | ret = 0; | ||
1258 | for (i = 0; i < dev_priv->child_dev_num; i++) { | ||
1259 | p_child = dev_priv->child_dev + i; | ||
1260 | /* | ||
1261 | * If the device type is not DP, continue. | ||
1262 | */ | ||
1263 | if (p_child->device_type != DEVICE_TYPE_DP && | ||
1264 | p_child->device_type != DEVICE_TYPE_eDP) | ||
1265 | continue; | ||
1266 | /* Find the eDP port */ | ||
1267 | if (dp_reg == DP_A && p_child->device_type == DEVICE_TYPE_eDP) { | ||
1268 | ret = 1; | ||
1269 | break; | ||
1270 | } | ||
1271 | /* Find the DP port */ | ||
1272 | if (p_child->dvo_port == dp_port) { | ||
1273 | ret = 1; | ||
1274 | break; | ||
1275 | } | ||
1276 | } | ||
1277 | return ret; | ||
1278 | } | ||
1232 | void | 1279 | void |
1233 | intel_dp_init(struct drm_device *dev, int output_reg) | 1280 | intel_dp_init(struct drm_device *dev, int output_reg) |
1234 | { | 1281 | { |
@@ -1238,6 +1285,10 @@ intel_dp_init(struct drm_device *dev, int output_reg) | |||
1238 | struct intel_dp_priv *dp_priv; | 1285 | struct intel_dp_priv *dp_priv; |
1239 | const char *name = NULL; | 1286 | const char *name = NULL; |
1240 | 1287 | ||
1288 | if (!dp_is_present_in_vbt(dev, output_reg)) { | ||
1289 | DRM_DEBUG_KMS("DP is not present. Ignore it\n"); | ||
1290 | return; | ||
1291 | } | ||
1241 | intel_output = kcalloc(sizeof(struct intel_output) + | 1292 | intel_output = kcalloc(sizeof(struct intel_output) + |
1242 | sizeof(struct intel_dp_priv), 1, GFP_KERNEL); | 1293 | sizeof(struct intel_dp_priv), 1, GFP_KERNEL); |
1243 | if (!intel_output) | 1294 | if (!intel_output) |