diff mbox series

[05/18] drm/vc4: crtc: Skip the TXP

Message ID 20210317154352.732095-6-maxime@cerno.tech (mailing list archive)
State New, archived
Headers show
Series drm/vc4: hdmi: Add Support for the YUV output | expand

Commit Message

Maxime Ripard March 17, 2021, 3:43 p.m. UTC
The vc4_set_crtc_possible_masks is meant to run over all the encoders
and then set their possible_crtcs mask to their associated pixelvalve.

However, since the commit 39fcb2808376 ("drm/vc4: txp: Turn the TXP into
a CRTC of its own"), the TXP has been turned to a CRTC and encoder of
its own, and while it does indeed register an encoder, it no longer has
an associated pixelvalve. The code will thus run over the TXP encoder
and set a bogus possible_crtcs mask, overriding the one set in the TXP
bind function.

In order to fix this, let's skip any virtual encoder.

Fixes: 39fcb2808376 ("drm/vc4: txp: Turn the TXP into a CRTC of its own")
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 drivers/gpu/drm/vc4/vc4_crtc.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Thomas Zimmermann April 9, 2021, 8:10 a.m. UTC | #1
Am 17.03.21 um 16:43 schrieb Maxime Ripard:
> The vc4_set_crtc_possible_masks is meant to run over all the encoders
> and then set their possible_crtcs mask to their associated pixelvalve.
> 
> However, since the commit 39fcb2808376 ("drm/vc4: txp: Turn the TXP into
> a CRTC of its own"), the TXP has been turned to a CRTC and encoder of
> its own, and while it does indeed register an encoder, it no longer has
> an associated pixelvalve. The code will thus run over the TXP encoder
> and set a bogus possible_crtcs mask, overriding the one set in the TXP
> bind function.
> 
> In order to fix this, let's skip any virtual encoder.
> 
> Fixes: 39fcb2808376 ("drm/vc4: txp: Turn the TXP into a CRTC of its own")
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>

dim fixes 39fcb2808376
Fixes: 39fcb2808376 ("drm/vc4: txp: Turn the TXP into a CRTC of its own")
Cc: Maxime Ripard <maxime@cerno.tech>
Cc: Eric Anholt <eric@anholt.net>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: <stable@vger.kernel.org> # v5.9+

At least the CC: stable line should be there.

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>

> ---
>   drivers/gpu/drm/vc4/vc4_crtc.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
> index 269390bc586e..f1f2e8cbce79 100644
> --- a/drivers/gpu/drm/vc4/vc4_crtc.c
> +++ b/drivers/gpu/drm/vc4/vc4_crtc.c
> @@ -1018,6 +1018,9 @@ static void vc4_set_crtc_possible_masks(struct drm_device *drm,
>   		struct vc4_encoder *vc4_encoder;
>   		int i;
>   
> +		if (encoder->encoder_type == DRM_MODE_ENCODER_VIRTUAL)
> +			continue;
> +
>   		vc4_encoder = to_vc4_encoder(encoder);
>   		for (i = 0; i < ARRAY_SIZE(pv_data->encoder_types); i++) {
>   			if (vc4_encoder->type == encoder_types[i]) {
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
index 269390bc586e..f1f2e8cbce79 100644
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
@@ -1018,6 +1018,9 @@  static void vc4_set_crtc_possible_masks(struct drm_device *drm,
 		struct vc4_encoder *vc4_encoder;
 		int i;
 
+		if (encoder->encoder_type == DRM_MODE_ENCODER_VIRTUAL)
+			continue;
+
 		vc4_encoder = to_vc4_encoder(encoder);
 		for (i = 0; i < ARRAY_SIZE(pv_data->encoder_types); i++) {
 			if (vc4_encoder->type == encoder_types[i]) {