@@ -742,6 +742,16 @@ int intel_parse_bios(struct drm_device *dev);
DEVICE_TYPE_DIGITAL_OUTPUT | \
DEVICE_TYPE_ANALOG_OUTPUT)
+/*
+ * We dont look on DEVICE_TYPE_NOT_HDMI_OUTPUT an DEVICE_TYPE_DIGITAL_OUTPUT
+ * on valleyview, because intels BMP-generated BIOS don't sets these
+ * BITS for eDP ports
+ */
+#define DEVICE_TYPE_eDP_BITS_VLV \
+ (DEVICE_TYPE_eDP_BITS &\
+ (~ DEVICE_TYPE_NOT_HDMI_OUTPUT ) &\
+ (~ DEVICE_TYPE_DIGITAL_OUTPUT ) )
+
/* define the DVO port for HDMI output type */
#define DVO_B 1
#define DVO_C 2
@@ -5036,6 +5036,7 @@ bool intel_dp_is_edp(struct drm_device *dev, enum port port)
struct drm_i915_private *dev_priv = dev->dev_private;
union child_device_config *p_child;
int i;
+ u16 eDP_bits;
static const short port_mapping[] = {
[PORT_B] = PORT_IDPB,
[PORT_C] = PORT_IDPC,
@@ -5047,13 +5048,18 @@ bool intel_dp_is_edp(struct drm_device *dev, enum port port)
if (!dev_priv->vbt.child_dev_num)
return false;
+
+ if (IS_VALLEYVIEW(dev))
+ eDP_bits = DEVICE_TYPE_eDP_BITS_VLV;
+ else
+ eDP_bits = DEVICE_TYPE_eDP_BITS;
for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
p_child = dev_priv->vbt.child_dev + i;
if (p_child->common.dvo_port == port_mapping[port] &&
- (p_child->common.device_type & DEVICE_TYPE_eDP_BITS) ==
- (DEVICE_TYPE_eDP & DEVICE_TYPE_eDP_BITS))
+ (p_child->common.device_type & eDP_bits) ==
+ (DEVICE_TYPE_eDP & eDP_bits))
return true;
}
return false;