drm/i915/bios: Nuke DEVICE_TYPE_DP_DUAL_MODE_BITS
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 17 Dec 2021 15:54:02 +0000 (17:54 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 19 Jan 2022 22:07:53 +0000 (00:07 +0200)
Replace the DEVICE_TYPE_DP_DUAL_MODE_BITS stuff with just
a DP+HDMI check. The rest of the bits shouldn't really
matter anyway.

The slight change in behaviour here is that now we do look at
the DEVICE_TYPE_NOT_HDMI_OUTPUT bit (via
intel_bios_encoder_supports_hdmi()) when we previously ignored it.
The one platform we know that has problems with that bit is VLV.
But IIRC the problem was always that buggy VBTs basically never
set that bit. So that should be OK since all it would do is make
all DVI ports look like HDMI ports instead. Also can't imagine
there are many VLV machines with actual DVI ports in existence.

We still keep the rest of the dvo_port/aux_ch checks as we
can't trust that DP+HDMI device type equals DP++ due to
buggy VBTs.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211217155403.31477-6-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_bios.c
drivers/gpu/drm/i915/display/intel_vbt_defs.h

index 8372809..6038629 100644 (file)
@@ -2664,10 +2664,12 @@ bool intel_bios_is_port_edp(struct drm_i915_private *i915, enum port port)
        return devdata && intel_bios_encoder_supports_edp(devdata);
 }
 
-static bool child_dev_is_dp_dual_mode(const struct child_device_config *child)
+static bool intel_bios_encoder_supports_dp_dual_mode(const struct intel_bios_encoder_data *devdata)
 {
-       if ((child->device_type & DEVICE_TYPE_DP_DUAL_MODE_BITS) !=
-           (DEVICE_TYPE_DP_DUAL_MODE & DEVICE_TYPE_DP_DUAL_MODE_BITS))
+       const struct child_device_config *child = &devdata->child;
+
+       if (!intel_bios_encoder_supports_dp(devdata) ||
+           !intel_bios_encoder_supports_hdmi(devdata))
                return false;
 
        if (dvo_port_type(child->dvo_port) == DVO_PORT_DPA)
@@ -2687,7 +2689,7 @@ bool intel_bios_is_port_dp_dual_mode(struct drm_i915_private *i915,
        const struct intel_bios_encoder_data *devdata =
                intel_bios_encoder_data_lookup(i915, port);
 
-       return devdata && child_dev_is_dp_dual_mode(&devdata->child);
+       return devdata && intel_bios_encoder_supports_dp_dual_mode(devdata);
 }
 
 /**
index c235827..a39d6cf 100644 (file)
@@ -226,17 +226,6 @@ struct bdb_general_features {
 #define DEVICE_TYPE_DIGITAL_OUTPUT     (1 << 1)
 #define DEVICE_TYPE_ANALOG_OUTPUT      (1 << 0)
 
-#define DEVICE_TYPE_DP_DUAL_MODE_BITS \
-       (DEVICE_TYPE_INTERNAL_CONNECTOR |       \
-        DEVICE_TYPE_MIPI_OUTPUT |              \
-        DEVICE_TYPE_COMPOSITE_OUTPUT |         \
-        DEVICE_TYPE_LVDS_SIGNALING |           \
-        DEVICE_TYPE_TMDS_DVI_SIGNALING |       \
-        DEVICE_TYPE_VIDEO_SIGNALING |          \
-        DEVICE_TYPE_DISPLAYPORT_OUTPUT |       \
-        DEVICE_TYPE_DIGITAL_OUTPUT |           \
-        DEVICE_TYPE_ANALOG_OUTPUT)
-
 #define DEVICE_CFG_NONE                0x00
 #define DEVICE_CFG_12BIT_DVOB  0x01
 #define DEVICE_CFG_12BIT_DVOC  0x02