amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Fix DVI-D/HDMI adapters
@ 2025-08-25 21:33 Timur Kristóf
  2025-08-26 14:06 ` Alex Deucher
  0 siblings, 1 reply; 4+ messages in thread
From: Timur Kristóf @ 2025-08-25 21:33 UTC (permalink / raw)
  To: amd-gfx
  Cc: alexdeucher, alexander.deucher, harry.wentland, alex.hung,
	Timur Kristóf

When the EDID has the HDMI bit, we should simply select
the HDMI signal type even on DVI ports.

For reference see, the legacy amdgpu display code:
amdgpu_atombios_encoder_get_encoder_mode
which selects ATOM_ENCODER_MODE_HDMI for the same case.

This commit fixes DVI connectors to work with DVI-D/HDMI
adapters so that they can now produce output over these
connectors for HDMI monitors with higher bandwidth modes.
With this change, even HDMI audio works through DVI.

For testing, I used a CAA-DMDHFD3 DVI-D/HDMI adapter
with the following GPUs:

Tahiti (DCE 6) - DC can now output 4K 30 Hz over DVI
Polaris 10 (DCE 11.2) - DC can now output 4K 60 Hz over DVI

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
---
 drivers/gpu/drm/amd/display/dc/link/link_detection.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/link/link_detection.c b/drivers/gpu/drm/amd/display/dc/link/link_detection.c
index 827b630daf49..42180e6aca91 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_detection.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_detection.c
@@ -1140,6 +1140,10 @@ static bool detect_link_and_local_sink(struct dc_link *link,
 		if (sink->sink_signal == SIGNAL_TYPE_HDMI_TYPE_A &&
 		    !sink->edid_caps.edid_hdmi)
 			sink->sink_signal = SIGNAL_TYPE_DVI_SINGLE_LINK;
+		else if (dc_is_dvi_signal(sink->sink_signal) &&
+			aud_support->hdmi_audio_native &&
+			sink->edid_caps.edid_hdmi)
+			sink->sink_signal = SIGNAL_TYPE_HDMI_TYPE_A;
 
 		if (link->local_sink && dc_is_dp_signal(sink_caps.signal))
 			dp_trace_init(link);
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amd/display: Fix DVI-D/HDMI adapters
  2025-08-25 21:33 [PATCH] drm/amd/display: Fix DVI-D/HDMI adapters Timur Kristóf
@ 2025-08-26 14:06 ` Alex Deucher
  2025-08-27 14:39   ` Timur Kristóf
  2025-09-03 15:27   ` Timur Kristóf
  0 siblings, 2 replies; 4+ messages in thread
From: Alex Deucher @ 2025-08-26 14:06 UTC (permalink / raw)
  To: Timur Kristóf; +Cc: amd-gfx, alexander.deucher, harry.wentland, alex.hung

On Mon, Aug 25, 2025 at 5:33 PM Timur Kristóf <timur.kristof@gmail.com> wrote:
>
> When the EDID has the HDMI bit, we should simply select
> the HDMI signal type even on DVI ports.
>
> For reference see, the legacy amdgpu display code:
> amdgpu_atombios_encoder_get_encoder_mode
> which selects ATOM_ENCODER_MODE_HDMI for the same case.
>
> This commit fixes DVI connectors to work with DVI-D/HDMI
> adapters so that they can now produce output over these
> connectors for HDMI monitors with higher bandwidth modes.
> With this change, even HDMI audio works through DVI.
>
> For testing, I used a CAA-DMDHFD3 DVI-D/HDMI adapter
> with the following GPUs:
>
> Tahiti (DCE 6) - DC can now output 4K 30 Hz over DVI
> Polaris 10 (DCE 11.2) - DC can now output 4K 60 Hz over DVI
>
> Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>

Makes sense to me, but would be good to get input from display team in
case there is anything I'm missing.
Acked-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/display/dc/link/link_detection.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/link/link_detection.c b/drivers/gpu/drm/amd/display/dc/link/link_detection.c
> index 827b630daf49..42180e6aca91 100644
> --- a/drivers/gpu/drm/amd/display/dc/link/link_detection.c
> +++ b/drivers/gpu/drm/amd/display/dc/link/link_detection.c
> @@ -1140,6 +1140,10 @@ static bool detect_link_and_local_sink(struct dc_link *link,
>                 if (sink->sink_signal == SIGNAL_TYPE_HDMI_TYPE_A &&
>                     !sink->edid_caps.edid_hdmi)
>                         sink->sink_signal = SIGNAL_TYPE_DVI_SINGLE_LINK;
> +               else if (dc_is_dvi_signal(sink->sink_signal) &&
> +                       aud_support->hdmi_audio_native &&
> +                       sink->edid_caps.edid_hdmi)
> +                       sink->sink_signal = SIGNAL_TYPE_HDMI_TYPE_A;
>
>                 if (link->local_sink && dc_is_dp_signal(sink_caps.signal))
>                         dp_trace_init(link);
> --
> 2.50.1
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amd/display: Fix DVI-D/HDMI adapters
  2025-08-26 14:06 ` Alex Deucher
@ 2025-08-27 14:39   ` Timur Kristóf
  2025-09-03 15:27   ` Timur Kristóf
  1 sibling, 0 replies; 4+ messages in thread
From: Timur Kristóf @ 2025-08-27 14:39 UTC (permalink / raw)
  To: Alex Deucher; +Cc: amd-gfx, alexander.deucher, harry.wentland, alex.hung

On Tue, 2025-08-26 at 10:06 -0400, Alex Deucher wrote:
> On Mon, Aug 25, 2025 at 5:33 PM Timur Kristóf
> <timur.kristof@gmail.com> wrote:
> > 
> > When the EDID has the HDMI bit, we should simply select
> > the HDMI signal type even on DVI ports.
> > 
> > For reference see, the legacy amdgpu display code:
> > amdgpu_atombios_encoder_get_encoder_mode
> > which selects ATOM_ENCODER_MODE_HDMI for the same case.
> > 
> > This commit fixes DVI connectors to work with DVI-D/HDMI
> > adapters so that they can now produce output over these
> > connectors for HDMI monitors with higher bandwidth modes.
> > With this change, even HDMI audio works through DVI.
> > 
> > For testing, I used a CAA-DMDHFD3 DVI-D/HDMI adapter
> > with the following GPUs:
> > 
> > Tahiti (DCE 6) - DC can now output 4K 30 Hz over DVI
> > Polaris 10 (DCE 11.2) - DC can now output 4K 60 Hz over DVI
> > 
> > Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
> 
> Makes sense to me, but would be good to get input from display team
> in
> case there is anything I'm missing.
> Acked-by: Alex Deucher <alexander.deucher@amd.com>

Thank you!

I just want to add that the code path without audio for both DVI-D and
HDMI seems to be broken and probably needs further investigation.

I might come back to this problem later when/if I have an opportunity
to test with a display that actually uses DVI-D. Right now I only have
the DVI/HDMI adapter which seems to work differently (as noted in the
above patch).

Timur


> 
> > ---
> >  drivers/gpu/drm/amd/display/dc/link/link_detection.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/amd/display/dc/link/link_detection.c
> > b/drivers/gpu/drm/amd/display/dc/link/link_detection.c
> > index 827b630daf49..42180e6aca91 100644
> > --- a/drivers/gpu/drm/amd/display/dc/link/link_detection.c
> > +++ b/drivers/gpu/drm/amd/display/dc/link/link_detection.c
> > @@ -1140,6 +1140,10 @@ static bool
> > detect_link_and_local_sink(struct dc_link *link,
> >                 if (sink->sink_signal == SIGNAL_TYPE_HDMI_TYPE_A &&
> >                     !sink->edid_caps.edid_hdmi)
> >                         sink->sink_signal =
> > SIGNAL_TYPE_DVI_SINGLE_LINK;
> > +               else if (dc_is_dvi_signal(sink->sink_signal) &&
> > +                       aud_support->hdmi_audio_native &&
> > +                       sink->edid_caps.edid_hdmi)
> > +                       sink->sink_signal =
> > SIGNAL_TYPE_HDMI_TYPE_A;
> > 
> >                 if (link->local_sink &&
> > dc_is_dp_signal(sink_caps.signal))
> >                         dp_trace_init(link);
> > --
> > 2.50.1
> > 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amd/display: Fix DVI-D/HDMI adapters
  2025-08-26 14:06 ` Alex Deucher
  2025-08-27 14:39   ` Timur Kristóf
@ 2025-09-03 15:27   ` Timur Kristóf
  1 sibling, 0 replies; 4+ messages in thread
From: Timur Kristóf @ 2025-09-03 15:27 UTC (permalink / raw)
  To: Alex Deucher; +Cc: amd-gfx, alexander.deucher, harry.wentland, alex.hung

On Tue, 2025-08-26 at 10:06 -0400, Alex Deucher wrote:
> On Mon, Aug 25, 2025 at 5:33 PM Timur Kristóf
> <timur.kristof@gmail.com> wrote:
> > 
> > When the EDID has the HDMI bit, we should simply select
> > the HDMI signal type even on DVI ports.
> > 
> > For reference see, the legacy amdgpu display code:
> > amdgpu_atombios_encoder_get_encoder_mode
> > which selects ATOM_ENCODER_MODE_HDMI for the same case.
> > 
> > This commit fixes DVI connectors to work with DVI-D/HDMI
> > adapters so that they can now produce output over these
> > connectors for HDMI monitors with higher bandwidth modes.
> > With this change, even HDMI audio works through DVI.
> > 
> > For testing, I used a CAA-DMDHFD3 DVI-D/HDMI adapter
> > with the following GPUs:
> > 
> > Tahiti (DCE 6) - DC can now output 4K 30 Hz over DVI
> > Polaris 10 (DCE 11.2) - DC can now output 4K 60 Hz over DVI
> > 
> > Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
> 
> Makes sense to me, but would be good to get input from display team
> in
> case there is anything I'm missing.
> Acked-by: Alex Deucher <alexander.deucher@amd.com>

@harry.wentland@amd.com or @alex.hung@amd.com Can you guys please
review this patch? Thank you!

> 
> > ---
> >  drivers/gpu/drm/amd/display/dc/link/link_detection.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/amd/display/dc/link/link_detection.c
> > b/drivers/gpu/drm/amd/display/dc/link/link_detection.c
> > index 827b630daf49..42180e6aca91 100644
> > --- a/drivers/gpu/drm/amd/display/dc/link/link_detection.c
> > +++ b/drivers/gpu/drm/amd/display/dc/link/link_detection.c
> > @@ -1140,6 +1140,10 @@ static bool
> > detect_link_and_local_sink(struct dc_link *link,
> >                 if (sink->sink_signal == SIGNAL_TYPE_HDMI_TYPE_A &&
> >                     !sink->edid_caps.edid_hdmi)
> >                         sink->sink_signal =
> > SIGNAL_TYPE_DVI_SINGLE_LINK;
> > +               else if (dc_is_dvi_signal(sink->sink_signal) &&
> > +                       aud_support->hdmi_audio_native &&
> > +                       sink->edid_caps.edid_hdmi)
> > +                       sink->sink_signal =
> > SIGNAL_TYPE_HDMI_TYPE_A;
> > 
> >                 if (link->local_sink &&
> > dc_is_dp_signal(sink_caps.signal))
> >                         dp_trace_init(link);
> > --
> > 2.50.1
> > 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-09-03 15:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-25 21:33 [PATCH] drm/amd/display: Fix DVI-D/HDMI adapters Timur Kristóf
2025-08-26 14:06 ` Alex Deucher
2025-08-27 14:39   ` Timur Kristóf
2025-09-03 15:27   ` Timur Kristóf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).