]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm/sti: Try to fix up the tvout possible clones
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 8 Jul 2019 16:20:38 +0000 (19:20 +0300)
committerBenjamin Gaignard <benjamin.gaignard@linaro.org>
Tue, 9 Jul 2019 07:45:07 +0000 (09:45 +0200)
The current possible_clones setup doesn't look sensible. I'm assuming
the 0 and 1 are supposed to refer to the indexes of the hdmi and hda
encoders? So it kinda looks like we want hda+hdmi cloning, but then
dvo also claims to be cloneable with hdmi, but hdmi won't recipricate.

Benjamin tells me all encoders should be cloneable with each other,
so let's fix up the masks to indicate that.

Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Cc: Vincent Abriou <vincent.abriou@st.com>
Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190708162048.4286-5-ville.syrjala@linux.intel.com
drivers/gpu/drm/sti/sti_tvout.c

index 42f4c264a783edba13a3f3edd59b716ef3ca558c..aba79c17251222f77d386a68f5d24a0393cbc15a 100644 (file)
@@ -672,7 +672,6 @@ sti_tvout_create_dvo_encoder(struct drm_device *dev,
        drm_encoder = &encoder->encoder;
 
        drm_encoder->possible_crtcs = ENCODER_CRTC_MASK;
-       drm_encoder->possible_clones = 1 << 0;
 
        drm_encoder_init(dev, drm_encoder,
                         &sti_tvout_encoder_funcs, DRM_MODE_ENCODER_LVDS,
@@ -725,7 +724,6 @@ static struct drm_encoder *sti_tvout_create_hda_encoder(struct drm_device *dev,
        drm_encoder = &encoder->encoder;
 
        drm_encoder->possible_crtcs = ENCODER_CRTC_MASK;
-       drm_encoder->possible_clones = 1 << 0;
 
        drm_encoder_init(dev, drm_encoder,
                        &sti_tvout_encoder_funcs, DRM_MODE_ENCODER_DAC, NULL);
@@ -774,7 +772,6 @@ static struct drm_encoder *sti_tvout_create_hdmi_encoder(struct drm_device *dev,
        drm_encoder = &encoder->encoder;
 
        drm_encoder->possible_crtcs = ENCODER_CRTC_MASK;
-       drm_encoder->possible_clones = 1 << 1;
 
        drm_encoder_init(dev, drm_encoder,
                        &sti_tvout_encoder_funcs, DRM_MODE_ENCODER_TMDS, NULL);
@@ -790,6 +787,13 @@ static void sti_tvout_create_encoders(struct drm_device *dev,
        tvout->hdmi = sti_tvout_create_hdmi_encoder(dev, tvout);
        tvout->hda = sti_tvout_create_hda_encoder(dev, tvout);
        tvout->dvo = sti_tvout_create_dvo_encoder(dev, tvout);
+
+       tvout->hdmi->possible_clones = drm_encoder_mask(tvout->hdmi) |
+               drm_encoder_mask(tvout->hda) | drm_encoder_mask(tvout->dvo);
+       tvout->hda->possible_clones = drm_encoder_mask(tvout->hdmi) |
+               drm_encoder_mask(tvout->hda) | drm_encoder_mask(tvout->dvo);
+       tvout->dvo->possible_clones = drm_encoder_mask(tvout->hdmi) |
+               drm_encoder_mask(tvout->hda) | drm_encoder_mask(tvout->dvo);
 }
 
 static void sti_tvout_destroy_encoders(struct sti_tvout *tvout)