]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: Don't use stereo sync and audio on RGB signals (v2)
authorTimur Kristóf <timur.kristof@gmail.com>
Fri, 26 Sep 2025 18:01:47 +0000 (20:01 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 28 Oct 2025 14:08:41 +0000 (10:08 -0400)
Analog video signals on VGA or DVI-A (analog part of DVI-I)
don't support audio, so avoid calling any audio related
functions on analog signals.

Stereo sync was not set up for analog signals in the legacy
display code either, so there is no loss of functionality if
we omit it from DC for now.

Also add a dc_is_rgb_signal similar to other dc_is_*_signal.

v2:
Added comment to clarify what we mean by RGB in this context.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dio.c
drivers/gpu/drm/amd/display/dc/link/link_dpms.c
drivers/gpu/drm/amd/display/include/signal_types.h

index 892907991f9122f1d641a9302416e01540cdff91..80344cbd1f9957d6ef27ed82a0c8cb89f0ff1ab9 100644 (file)
@@ -115,7 +115,8 @@ void setup_dio_stream_attribute(struct pipe_ctx *pipe_ctx)
        struct dc_stream_state *stream = pipe_ctx->stream;
        struct dc_link *link = stream->link;
 
-       if (!dc_is_virtual_signal(stream->signal))
+       if (!dc_is_virtual_signal(stream->signal) &&
+               !dc_is_rgb_signal(stream->signal))
                stream_encoder->funcs->setup_stereo_sync(
                                stream_encoder,
                                pipe_ctx->stream_res.tg->inst,
index dba8ec0988a1779510944e66ad938c13b14494c0..fdefe27f4ba361d155fc52ae3740263f2ed8849d 100644 (file)
@@ -2371,7 +2371,8 @@ void link_set_dpms_off(struct pipe_ctx *pipe_ctx)
                        set_avmute(pipe_ctx, true);
        }
 
-       dc->hwss.disable_audio_stream(pipe_ctx);
+       if (!dc_is_rgb_signal(pipe_ctx->stream->signal))
+               dc->hwss.disable_audio_stream(pipe_ctx);
 
        update_psp_stream_config(pipe_ctx, true);
        dc->hwss.blank_stream(pipe_ctx);
@@ -2656,7 +2657,8 @@ void link_set_dpms_on(
                enable_stream_features(pipe_ctx);
        update_psp_stream_config(pipe_ctx, false);
 
-       dc->hwss.enable_audio_stream(pipe_ctx);
+       if (!dc_is_rgb_signal(pipe_ctx->stream->signal))
+               dc->hwss.enable_audio_stream(pipe_ctx);
 
        if (dc_is_hdmi_signal(pipe_ctx->stream->signal)) {
                set_avmute(pipe_ctx, false);
index a10d6b988aab216a7e55a979fa22a6b4a49f63a9..3a2c2d2fb6291fa7359ec4776c6f8d34c556b845 100644 (file)
@@ -118,6 +118,18 @@ static inline bool dc_is_dvi_signal(enum signal_type signal)
        }
 }
 
+/**
+ * dc_is_rgb_signal() - Whether the signal is analog RGB.
+ *
+ * Returns whether the given signal type is an analog RGB signal
+ * that is used with a DAC on VGA or DVI-I connectors.
+ * Not to be confused with other uses of "RGB", such as RGB color space.
+ */
+static inline bool dc_is_rgb_signal(enum signal_type signal)
+{
+       return (signal == SIGNAL_TYPE_RGB);
+}
+
 static inline bool dc_is_tmds_signal(enum signal_type signal)
 {
        switch (signal) {