drm/i915: Reject mixing MST and SST/HDMI on the same digital port
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 28 Jul 2016 14:50:40 +0000 (17:50 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 4 Aug 2016 12:54:13 +0000 (15:54 +0300)
We can't mix MST with SST/HDMI on the same physical port, so we'll need
to reject such configurations in check_digital_port_conflicts(). Nothing
else will prevent this as MST has its fake encoders and its own connectors
so the cloning checks won't catch this.

The same digital port can be used multiple times, but only if all the
encoders involved are MST encoders, so we only want to check MST vs.
SST/HDMI, not MST vs. MST. And SST/HDMI vs. SST/HDMI we already check.

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1469717448-4297-5-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_display.c

index da9dcacd49d59b189ab53627ca24ddffb3acee29..483ddfe957f48fc2553331ae32a529e0e4b78777 100644 (file)
@@ -12300,6 +12300,7 @@ static bool check_digital_port_conflicts(struct drm_atomic_state *state)
        struct drm_device *dev = state->dev;
        struct drm_connector *connector;
        unsigned int used_ports = 0;
+       unsigned int used_mst_ports = 0;
 
        /*
         * Walk the connector list instead of the encoder
@@ -12336,11 +12337,20 @@ static bool check_digital_port_conflicts(struct drm_atomic_state *state)
                                return false;
 
                        used_ports |= port_mask;
+                       break;
+               case INTEL_OUTPUT_DP_MST:
+                       used_mst_ports |=
+                               1 << enc_to_mst(&encoder->base)->primary->port;
+                       break;
                default:
                        break;
                }
        }
 
+       /* can't mix MST and SST/HDMI on the same port */
+       if (used_ports & used_mst_ports)
+               return false;
+
        return true;
 }