dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Adrian Betschart" <adrian.betschart@cinemaone.ch>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/amd/display: size frame-packed streams by the doubled timing
Date: Mon, 07 Sep 2026 11:27:29 +0000	[thread overview]
Message-ID: <20260907112729.818A61F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260907100626.54465-4-adrian.betschart@cinemaone.ch>

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

      reply	other threads:[~2026-09-07 11:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260907112729.818A61F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=adrian.betschart@cinemaone.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox