* [PATCH 0/3] drm/amd/display: HDMI 1.4 3D output (frame packing, top-and-bottom, side-by-side)
@ 2026-09-07 10:06 Adrian Betschart
2026-09-07 10:06 ` [PATCH 1/3] drm/amd/display: support HDMI 1.4 3D modes on HDMI connectors Adrian Betschart
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Adrian Betschart @ 2026-09-07 10:06 UTC (permalink / raw)
To: Harry Wentland, Leo Li, Rodrigo Siqueira, Alex Deucher
Cc: Christian König, amd-gfx, dri-devel, linux-kernel
amdgpu has never exposed the HDMI 1.4 3D modes that drm_edid derives
from a sink's HDMI VSDB: stereo_allowed is false on every connector, so
a 3D-capable TV or projector connected to a Radeon card cannot be driven
in frame-packing, top-and-bottom or side-by-side mode, although i915
has supported exactly this for a decade and the media players that
produce 3D frames (Kodi, mpv with 3D filters) only need the mode to
exist.
These three patches add it for native HDMI connectors, in the simplest form
that works on the hardware: the source packs both views into the frame
and the display core scans that frame out as ordinary 2D; the only
3D-specific output is the HDMI vendor infoframe. The reason it has to
be done this way is in patch 1: any of DC's stereo timing formats,
including the SW_PACKED ones, makes the hardware treat the surface as
two views and paint the whole frame into each half. Patch 2 adds the
3D_Ext_Data byte to the top-and-bottom vendor infoframe, without which
at least JVC D-ILA projectors do not engage 3D (Amlogic sources send
it, which is why those work with the same projector). Patch 3 sizes
the stream and the plane viewport by the doubled frame-packing timing
so each eye receives its own view rather than a stretched copy of the
first.
Tested on a Radeon RX 7600 (Navi 33, DCN 3.2.1) driving a JVC
DLA-RS4100 through an HDFury VRROOM, with Kodi (LibreELEC, GBM) as the
source, on a 7.2.3 kernel carrying these patches; the series here is
rebased onto amd-staging-drm-next and compile-tested there. All three
layouts engage the projector's 3D mode at 1920x1080p24, RGB 12 bpc,
with correct per-eye geometry (row-coded test frames read back through
each eye of shutter glasses) and correct eye assignment; frame packing
is also the format the projector uses for Blu-ray 3D.
Known limitation, not addressed here: a framebuffer with DCC enabled
does not scan out in a frame-packed mode on this GPU (the first flip
after the modeset never completes and the pipe wedges); the source has
to allocate the 3D framebuffer without DCC. A separate report will
follow once it is better understood.
Two unrelated FRL/DSC issues found on the same setup are tracked as
drm/amd issues 5770 and 5771.
Adrian Betschart (3):
drm/amd/display: support HDMI 1.4 3D modes on HDMI connectors
drm/amd/display: send the 3D_Ext_Data byte for top-and-bottom too
drm/amd/display: size frame-packed streams by the doubled timing
.../display/amdgpu_dm/amdgpu_dm_connector.c | 52 ++++++++++++++++---
.../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 13 +++--
drivers/gpu/drm/amd/display/dc/dc_stream.h | 7 +++
.../display/modules/info_packet/info_packet.c | 4 ++
4 files changed, 66 insertions(+), 10 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/3] drm/amd/display: support HDMI 1.4 3D modes on HDMI connectors
2026-09-07 10:06 [PATCH 0/3] drm/amd/display: HDMI 1.4 3D output (frame packing, top-and-bottom, side-by-side) Adrian Betschart
@ 2026-09-07 10:06 ` Adrian Betschart
2026-09-07 11:32 ` sashiko-bot
2026-09-07 10:06 ` [PATCH 2/3] drm/amd/display: send the 3D_Ext_Data byte for top-and-bottom too Adrian Betschart
2026-09-07 10:06 ` [PATCH 3/3] drm/amd/display: size frame-packed streams by the doubled timing Adrian Betschart
2 siblings, 1 reply; 6+ messages in thread
From: Adrian Betschart @ 2026-09-07 10:06 UTC (permalink / raw)
To: Harry Wentland, Leo Li, Rodrigo Siqueira, Alex Deucher
Cc: Christian König, amd-gfx, dri-devel, linux-kernel
Allow the stereo modes drm_edid derives from a sink's HDMI VSDB on
HDMI connectors, and drive them the way a 2D stream is driven: the
source (compositor or media player) lays both views out in the frame
itself - side by side, top and bottom, or the doubled frame-packing
timing with the 45-line active space between the eyes - and the only
3D-specific output is the HDMI vendor infoframe that tells the sink
how the frame is laid out.
Keep the DC timing at TIMING_3D_FORMAT_NONE for all of them. Any DC
stereo timing format, including the SW_PACKED variants, makes the
hardware treat the surface as two views: the pipe is split and both
view addresses point at the same surface, so the whole frame ends up
in each half of the output. The new vsif_3d_format stream field
carries the layout to mod_build_hf_vsif_infopacket() instead, so the
VSIF is right and stays right when the freesync code rebuilds it for
ALLM.
Frame packing needs the doubled CRTC timing; pass CRTC_STEREO_DOUBLE
wherever amdgpu_dm recomputes the CRTC fields itself.
Limit stereo_allowed to native HDMI connectors: on the DP-to-HDMI
converter paths link validation rejects the 3D timings.
Tested on a Radeon RX 7600 (DCN 3.2.1) driving a JVC DLA-RS4100
projector through an HDFury VRROOM, with Kodi rendering the packed
frames: frame packing, top-and-bottom and side-by-side at
1920x1080p24, RGB 12 bpc, all engage the projector's 3D mode with
correct per-eye geometry and eye assignment (checked with per-eye
test patterns through shutter glasses).
Signed-off-by: Adrian Betschart <adrian.betschart@cinemaone.ch>
---
.../display/amdgpu_dm/amdgpu_dm_connector.c | 41 +++++++++++++++++--
drivers/gpu/drm/amd/display/dc/dc_stream.h | 7 ++++
.../display/modules/info_packet/info_packet.c | 3 ++
3 files changed, 48 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
index 0e71ba498..7a2beb175 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
@@ -851,6 +851,25 @@ STATIC_IFN_KUNIT bool adjust_colour_depth_from_display_info(
}
EXPORT_IF_KUNIT(adjust_colour_depth_from_display_info);
+/*
+ * 3D layout to announce in the HDMI vendor infoframe for a DRM 3D mode. The
+ * stream timing itself stays 2D (see fill_stream_properties_from_drm_display_mode).
+ */
+static enum dc_timing_3d_format amdgpu_dm_vsif_3d_format(unsigned int mode_flags)
+{
+ switch (mode_flags & DRM_MODE_FLAG_3D_MASK) {
+ case DRM_MODE_FLAG_3D_FRAME_PACKING:
+ return TIMING_3D_FORMAT_SW_FRAME_PACKING;
+ case DRM_MODE_FLAG_3D_TOP_AND_BOTTOM:
+ return TIMING_3D_FORMAT_TB_SW_PACKED;
+ case DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF:
+ case DRM_MODE_FLAG_3D_SIDE_BY_SIDE_FULL:
+ return TIMING_3D_FORMAT_SBS_SW_PACKED;
+ default:
+ return TIMING_3D_FORMAT_NONE;
+ }
+}
+
STATIC_IFN_KUNIT void fill_stream_properties_from_drm_display_mode(
struct dc_stream_state *stream,
const struct drm_display_mode *mode_in,
@@ -887,7 +906,15 @@ STATIC_IFN_KUNIT void fill_stream_properties_from_drm_display_mode(
*/
timing_out->pixel_encoding = requested_encoding;
+ /*
+ * The source packs both views into the frame itself (side-by-side,
+ * top-and-bottom, or the doubled frame-packing timing), so the display
+ * core scans it out as a plain 2D stream and only the HDMI vendor
+ * infoframe tells the sink how the frame is laid out. Any DC stereo
+ * timing format would make the hardware treat the surface as two views.
+ */
timing_out->timing_3d_format = TIMING_3D_FORMAT_NONE;
+ stream->vsif_3d_format = amdgpu_dm_vsif_3d_format(mode_in->flags);
timing_out->display_color_depth = amdgpu_dm_convert_color_depth_from_display_info(
connector,
(timing_out->pixel_encoding == PIXEL_ENCODING_YCBCR420),
@@ -1451,6 +1478,9 @@ create_stream_for_sink(struct drm_connector *connector,
struct dc_sink *sink = NULL;
drm_mode_init(&mode, drm_mode);
+ /* frame packing scans out both views plus the active space in one frame */
+ if (mode.flags & DRM_MODE_FLAG_3D_FRAME_PACKING)
+ drm_mode_set_crtcinfo(&mode, CRTC_STEREO_DOUBLE);
memset(&saved_mode, 0, sizeof(saved_mode));
if (connector->connector_type != DRM_MODE_CONNECTOR_WRITEBACK) {
@@ -1530,7 +1560,9 @@ create_stream_for_sink(struct drm_connector *connector,
}
if (recalculate_timing)
- drm_mode_set_crtcinfo(&saved_mode, 0);
+ drm_mode_set_crtcinfo(&saved_mode,
+ (saved_mode.flags & DRM_MODE_FLAG_3D_FRAME_PACKING) ?
+ CRTC_STEREO_DOUBLE : 0);
/*
* If scaling is enabled and refresh rate didn't change
@@ -2449,7 +2481,9 @@ enum drm_mode_status amdgpu_dm_connector_mode_valid(struct drm_connector *connec
if (!test_mode)
goto fail;
- drm_mode_set_crtcinfo(test_mode, 0);
+ drm_mode_set_crtcinfo(test_mode,
+ (test_mode->flags & DRM_MODE_FLAG_3D_FRAME_PACKING) ?
+ CRTC_STEREO_DOUBLE : 0);
stream = amdgpu_dm_create_validate_stream_for_sink(connector, test_mode,
to_dm_connector_state(connector->state),
@@ -3143,7 +3177,8 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm,
aconnector->dc_link = link;
aconnector->base.interlace_allowed = false;
aconnector->base.doublescan_allowed = false;
- aconnector->base.stereo_allowed = false;
+ /* HDMI 1.4 3D only; DP-to-HDMI converters reject the timings in link validation */
+ aconnector->base.stereo_allowed = connector_type == DRM_MODE_CONNECTOR_HDMIA;
aconnector->base.dpms = DRM_MODE_DPMS_OFF;
aconnector->hpd.hpd = AMDGPU_HPD_NONE; /* not used */
aconnector->audio_inst = -1;
diff --git a/drivers/gpu/drm/amd/display/dc/dc_stream.h b/drivers/gpu/drm/amd/display/dc/dc_stream.h
index 934ae381e..e6fd75b87 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_stream.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_stream.h
@@ -235,6 +235,13 @@ struct dc_stream_state {
enum view_3d_format view_format;
+ /**
+ * @vsif_3d_format: 3D layout announced in the HDMI vendor infoframe when
+ * the source packs both views into the frame itself and the timing is
+ * therefore left at TIMING_3D_FORMAT_NONE.
+ */
+ enum dc_timing_3d_format vsif_3d_format;
+
bool use_vsc_sdp_for_colorimetry;
bool ignore_msa_timing_param;
diff --git a/drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c b/drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c
index 32b697f46..13478b8bd 100644
--- a/drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c
+++ b/drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c
@@ -536,6 +536,9 @@ void mod_build_hf_vsif_infopacket(const struct dc_stream_state *stream,
format = stream->timing.timing_3d_format;
if (stream->view_format == VIEW_3D_FORMAT_NONE)
format = TIMING_3D_FORMAT_NONE;
+ /* a 2D scanout of a frame the source packed itself */
+ if (format == TIMING_3D_FORMAT_NONE)
+ format = stream->vsif_3d_format;
if (stream->timing.hdmi_vic != 0
&& stream->timing.h_total >= 3840
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] drm/amd/display: send the 3D_Ext_Data byte for top-and-bottom too
2026-09-07 10:06 [PATCH 0/3] drm/amd/display: HDMI 1.4 3D output (frame packing, top-and-bottom, side-by-side) Adrian Betschart
2026-09-07 10:06 ` [PATCH 1/3] drm/amd/display: support HDMI 1.4 3D modes on HDMI connectors Adrian Betschart
@ 2026-09-07 10:06 ` Adrian Betschart
2026-09-07 10:06 ` [PATCH 3/3] drm/amd/display: size frame-packed streams by the doubled timing Adrian Betschart
2 siblings, 0 replies; 6+ messages in thread
From: Adrian Betschart @ 2026-09-07 10:06 UTC (permalink / raw)
To: Harry Wentland, Leo Li, Rodrigo Siqueira, Alex Deucher
Cc: Christian König, amd-gfx, dri-devel, linux-kernel
HDMI 1.4b only requires the 3D_Ext_Data byte for the side-by-side
(half) structure, and the vendor infoframe for top-and-bottom is
built with a 5-byte payload accordingly. At least one sink family
ignores a top-and-bottom VSIF without the sixth byte: a JVC DLA-RS4100
(D-ILA, "ILAFPJ--X214A") stays in 2D on the 5-byte frame and engages
its 3D mode the moment the byte is present. Amlogic sources send the
6-byte form for top-and-bottom, which is why the same projector works
with them.
Send the extra byte, zero, for top-and-bottom as well. Sinks that do
not need it ignore a zero 3D_Ext_Data field.
Signed-off-by: Adrian Betschart <adrian.betschart@cinemaone.ch>
---
drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c b/drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c
index 13478b8bd..3e41b33ea 100644
--- a/drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c
+++ b/drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c
@@ -574,6 +574,7 @@ void mod_build_hf_vsif_infopacket(const struct dc_stream_state *stream,
case TIMING_3D_FORMAT_TOP_AND_BOTTOM:
case TIMING_3D_FORMAT_TB_SW_PACKED:
info_packet->sb[5] = (0x6 << 4);
+ length = 6;
break;
default:
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] drm/amd/display: size frame-packed streams by the doubled timing
2026-09-07 10:06 [PATCH 0/3] drm/amd/display: HDMI 1.4 3D output (frame packing, top-and-bottom, side-by-side) Adrian Betschart
2026-09-07 10:06 ` [PATCH 1/3] drm/amd/display: support HDMI 1.4 3D modes on HDMI connectors Adrian Betschart
2026-09-07 10:06 ` [PATCH 2/3] drm/amd/display: send the 3D_Ext_Data byte for top-and-bottom too Adrian Betschart
@ 2026-09-07 10:06 ` Adrian Betschart
2026-09-07 11:27 ` sashiko-bot
2 siblings, 1 reply; 6+ messages in thread
From: Adrian Betschart @ 2026-09-07 10:06 UTC (permalink / raw)
To: Harry Wentland, Leo Li, Rodrigo Siqueira, Alex Deucher
Cc: Christian König, amd-gfx, dri-devel, linux-kernel
A frame-packed 3D mode scans out both views and the active space
between them in one frame, so the CRTC is 2205 lines tall for a
1080p mode. The stream scaling code took the source height from
mode->vdisplay (1080) against the 2205-line addressable destination;
with aspect scaling that keeps 1080 lines and centres them, so the
first view is stretched across both eye windows and the second view
is never shown. The plane viewport check clipped planes to
crtc_vdisplay for the same reason.
Use drm_mode_get_hv_timing(), which returns the doubled height for
stereo modes and the plain display size otherwise, in both places.
Measured on a Radeon RX 7600 with a frame-packed 1920x1080p24 mode:
before, a row-coded 2205-line test frame showed rows of the first
view in both eyes; after, each eye receives its own view.
Signed-off-by: Adrian Betschart <adrian.betschart@cinemaone.ch>
---
.../drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c | 11 ++++++++---
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 13 +++++++++----
2 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
index 7a2beb175..ac9fe2883 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
@@ -1405,9 +1405,14 @@ void amdgpu_dm_update_stream_scaling_settings(struct drm_device *dev,
if (!mode)
return;
- /* Full screen scaling by default */
- src.width = mode->hdisplay;
- src.height = mode->vdisplay;
+ /*
+ * Full screen scaling by default. A frame-packed 3D mode scans out the
+ * doubled timing, so the source size is the CRTC size, not vdisplay:
+ * with 1080 lines against a 2205-line destination the aspect fit would
+ * keep 1080 lines and centre them, putting the first view across both
+ * eye windows and none of the second.
+ */
+ drm_mode_get_hv_timing(mode, &src.width, &src.height);
dst.width = stream->timing.h_addressable;
dst.height = stream->timing.v_addressable;
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
index 0a5a73472..8db656ef8 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
@@ -1407,16 +1407,21 @@ int amdgpu_dm_plane_helper_check_state(struct drm_plane_state *state,
if (state->plane->type != DRM_PLANE_TYPE_CURSOR) {
int viewport_width = state->crtc_w;
int viewport_height = state->crtc_h;
+ int mode_hdisplay, mode_vdisplay;
+
+ /* frame-packed 3D scans out the doubled timing */
+ drm_mode_get_hv_timing(&new_crtc_state->mode,
+ &mode_hdisplay, &mode_vdisplay);
if (state->crtc_x < 0)
viewport_width += state->crtc_x;
- else if (state->crtc_x + state->crtc_w > new_crtc_state->mode.crtc_hdisplay)
- viewport_width = new_crtc_state->mode.crtc_hdisplay - state->crtc_x;
+ else if (state->crtc_x + state->crtc_w > mode_hdisplay)
+ viewport_width = mode_hdisplay - state->crtc_x;
if (state->crtc_y < 0)
viewport_height += state->crtc_y;
- else if (state->crtc_y + state->crtc_h > new_crtc_state->mode.crtc_vdisplay)
- viewport_height = new_crtc_state->mode.crtc_vdisplay - state->crtc_y;
+ else if (state->crtc_y + state->crtc_h > mode_vdisplay)
+ viewport_height = mode_vdisplay - state->crtc_y;
if (viewport_width < 0 || viewport_height < 0) {
DRM_DEBUG_ATOMIC("Plane completely outside of screen\n");
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 3/3] drm/amd/display: size frame-packed streams by the doubled timing
2026-09-07 10:06 ` [PATCH 3/3] drm/amd/display: size frame-packed streams by the doubled timing Adrian Betschart
@ 2026-09-07 11:27 ` sashiko-bot
0 siblings, 0 replies; 6+ messages in thread
From: sashiko-bot @ 2026-09-07 11:27 UTC (permalink / raw)
To: Adrian Betschart; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The patch breaks the KUnit test dm_test_helper_check_state_scaling_caps in amdgpu_dm_plane_test.c by introducing a dependency on mode.hdisplay and mode.vdisplay, which the test does not mock.
--
commit fe46ce41733ff5de8af87a321672d77c5c614c30
Author: Adrian Betschart <adrian.betschart@cinemaone.ch>
drm/amd/display: size frame-packed streams by the doubled timing
The commit uses drm_mode_get_hv_timing() to handle frame-packed 3D modes
which scan out double the vertical timing, fixing view stretching across eye
windows.
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
> index 0a5a7347238ec..8db656ef85f84 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
> @@ -1407,16 +1407,21 @@ int amdgpu_dm_plane_helper_check_state(struct drm_plane_state *state,
> if (state->plane->type != DRM_PLANE_TYPE_CURSOR) {
> int viewport_width = state->crtc_w;
> int viewport_height = state->crtc_h;
> + int mode_hdisplay, mode_vdisplay;
> +
> + /* frame-packed 3D scans out the doubled timing */
> + drm_mode_get_hv_timing(&new_crtc_state->mode,
> + &mode_hdisplay, &mode_vdisplay);
[Severity: Medium]
Does this change break the KUnit test dm_test_helper_check_state_scaling_caps
in amdgpu_dm_plane_test.c?
The test mocks new_crtc_state->mode.crtc_hdisplay and crtc_vdisplay, but
leaves hdisplay and vdisplay as 0:
dm_test_helper_check_state_scaling_caps() {
...
new_crtc_state->mode.crtc_hdisplay = 1920;
new_crtc_state->mode.crtc_vdisplay = 1080;
KUNIT_EXPECT_EQ(test,
amdgpu_dm_plane_helper_check_state(state, new_crtc_state),
-ERANGE);
...
}
When amdgpu_dm_plane_helper_check_state() calls drm_mode_get_hv_timing(), it
reads the uninitialized 0 from hdisplay and overwrites the mocked
crtc_hdisplay internally.
Could this cause viewport_width to become 0, leading to an early -EINVAL exit
instead of the -ERANGE expected by the test assertion?
>
> if (state->crtc_x < 0)
> viewport_width += state->crtc_x;
> - else if (state->crtc_x + state->crtc_w > new_crtc_state->mode.crtc_hdisplay)
> - viewport_width = new_crtc_state->mode.crtc_hdisplay - state->crtc_x;
> + else if (state->crtc_x + state->crtc_w > mode_hdisplay)
> + viewport_width = mode_hdisplay - state->crtc_x;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260907100626.54465-1-adrian.betschart@cinemaone.ch?part=3
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] drm/amd/display: support HDMI 1.4 3D modes on HDMI connectors
2026-09-07 10:06 ` [PATCH 1/3] drm/amd/display: support HDMI 1.4 3D modes on HDMI connectors Adrian Betschart
@ 2026-09-07 11:32 ` sashiko-bot
0 siblings, 0 replies; 6+ messages in thread
From: sashiko-bot @ 2026-09-07 11:32 UTC (permalink / raw)
To: Adrian Betschart; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] CRTC timings for 3D Frame Packing modes are silently overwritten with native 2D timings when hardware scaling is enabled, breaking 3D output.
- [High] FreeSync Video Mode optimization overwrites 3D mode flags, silently downgrading 3D streams to 2D.
--
commit 70b8f690db70299cb56618e8af16a07b44f95bd2
Author: Adrian Betschart <adrian.betschart@cinemaone.ch>
Subject: drm/amd/display: support HDMI 1.4 3D modes on HDMI connectors
This commit enables stereo modes (such as 3D Frame Packing, Top-and-Bottom,
and Side-by-Side) derived from a sink's HDMI VSDB on HDMI connectors. It
treats them as 2D streams by packing the views in the frame itself and relies
on the HDMI vendor infoframe to inform the sink.
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
> index 0e71ba498e8aa..7a2beb1756249 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
[ ... ]
> @@ -887,7 +906,15 @@ STATIC_IFN_KUNIT void fill_stream_properties_from_drm_display_mode(
> */
> timing_out->pixel_encoding = requested_encoding;
>
> + /*
> + * The source packs both views into the frame itself (side-by-side,
> + * top-and-bottom, or the doubled frame-packing timing), so the display
> + * core scans it out as a plain 2D stream and only the HDMI vendor
> + * infoframe tells the sink how the frame is laid out. Any DC stereo
> + * timing format would make the hardware treat the surface as two views.
> + */
> timing_out->timing_3d_format = TIMING_3D_FORMAT_NONE;
> + stream->vsif_3d_format = amdgpu_dm_vsif_3d_format(mode_in->flags);
[Severity: High]
If amdgpu_dm_is_freesync_video_mode() matched earlier in
create_stream_for_sink(), will this silently downgrade the 3D stream to 2D?
In create_stream_for_sink(), if a 3D mode (like Side-by-Side or Top-and-Bottom)
matches the base timings of a FreeSync mode, the entire mode struct is
overwritten:
create_stream_for_sink() {
...
if (recalculate_timing) {
freesync_mode = amdgpu_dm_get_highest_refresh_rate_mode(aconnector, false);
drm_mode_copy(&saved_mode, &mode);
...
drm_mode_copy(&mode, freesync_mode);
...
}
}
This wipes the DRM_MODE_FLAG_3D_* flags from mode_in. When
amdgpu_dm_vsif_3d_format(mode_in->flags) is called here, it will evaluate to 0
and fall back to TIMING_3D_FORMAT_NONE, causing the HDMI vendor infoframe to
never be sent and leaving the sink in 2D mode.
> timing_out->display_color_depth = amdgpu_dm_convert_color_depth_from_display_info(
> connector,
> (timing_out->pixel_encoding == PIXEL_ENCODING_YCBCR420),
[ ... ]
> @@ -1451,6 +1478,9 @@ create_stream_for_sink(struct drm_connector *connector,
> struct dc_sink *sink = NULL;
>
> drm_mode_init(&mode, drm_mode);
> + /* frame packing scans out both views plus the active space in one frame */
> + if (mode.flags & DRM_MODE_FLAG_3D_FRAME_PACKING)
> + drm_mode_set_crtcinfo(&mode, CRTC_STEREO_DOUBLE);
[Severity: High]
Are these CRTC_STEREO_DOUBLE timings at risk of being silently overwritten
if hardware scaling is enabled?
Later in create_stream_for_sink(), the mode is passed for timing adjustments:
create_stream_for_sink() {
...
} else {
decide_crtc_timing_for_drm_display_mode(
&mode, preferred_mode, scale);
...
}
If scale is true, decide_crtc_timing_for_drm_display_mode() unconditionally
copies the standard 2D timings from the preferred mode:
decide_crtc_timing_for_drm_display_mode() {
if (scale_enabled || ...) {
if (native_mode->crtc_clock)
copy_crtc_timing_for_drm_display_mode(native_mode, drm_mode);
}
}
Will this wipe out the stereo-doubled timings just set here, misconfiguring
the hardware scanout with standard 2D timings instead and leading to
truncated/corrupted 3D output?
> memset(&saved_mode, 0, sizeof(saved_mode));
>
> if (connector->connector_type != DRM_MODE_CONNECTOR_WRITEBACK) {
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260907100626.54465-1-adrian.betschart@cinemaone.ch?part=1
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-09-08 7:09 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-07 10:06 [PATCH 0/3] drm/amd/display: HDMI 1.4 3D output (frame packing, top-and-bottom, side-by-side) Adrian Betschart
2026-09-07 10:06 ` [PATCH 1/3] drm/amd/display: support HDMI 1.4 3D modes on HDMI connectors Adrian Betschart
2026-09-07 11:32 ` sashiko-bot
2026-09-07 10:06 ` [PATCH 2/3] drm/amd/display: send the 3D_Ext_Data byte for top-and-bottom too Adrian Betschart
2026-09-07 10:06 ` [PATCH 3/3] drm/amd/display: size frame-packed streams by the doubled timing Adrian Betschart
2026-09-07 11:27 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox