* Re: tests/kms_content_protection: clamp plane src/dst to output mode
[not found] <20260515052433.903588-1-suraj.kandpal@intel.com>
@ 2026-05-15 8:02 ` Jason-JH Lin (林睿祥)
0 siblings, 0 replies; only message in thread
From: Jason-JH Lin (林睿祥) @ 2026-05-15 8:02 UTC (permalink / raw)
To: suraj.kandpal@intel.com, igt-dev@lists.freedesktop.org,
intel-gfx-trybot@lists.freedesktop.org
Cc: navaremanasi@google.com, Singo Chang (張興國),
markyacoub@chromium.org, santhosh.reddy.guddati@intel.com,
Project_Global_Chrome_Upstream_Group,
Nancy Lin (林欣螢), swati2.sharma@intel.com,
Paul-pl Chen (陳柏霖)
On Fri, 2026-05-15 at 10:54 +0530, Suraj Kandpal wrote:
> create_fbs() sizes the shared red/green FBs to the max width and
> height across all connected outputs. With panels of differing native
> resolutions (e.g. 3504x2190 and 3840x2160), the FB ends up larger
> than
> at least one panel in some dimension. igt_plane_set_fb() resets the
> plane src and dst rectangles to the full FB size, so subsequent
> commits submit a source rect that exceeds the CRTC active area and
> atomic check rejects them with -EINVAL before HDCP authentication can
> start.
>
> Clamp the plane source (igt_fb_set_size) and destination
> (igt_plane_set_size) to the output's current mode after every
> igt_plane_set_fb() in modeset_with_fb(), test_cp_enable(),
> test_cp_disable() and test_mst_cp_disable().
>
> Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Hi Suraj,
After reverting my series:
- https://patchwork.freedesktop.org/series/164052/
This patch can resolve my previous issue.
Thank you for your patch.
Tested-by: Jason-JH Lin <jason-jh.lin@mediatek.com>
> ---
> tests/kms_content_protection.c | 29 ++++++++++++++++++++++++++++-
> 1 file changed, 28 insertions(+), 1 deletion(-)
>
> diff --git a/tests/kms_content_protection.c
> b/tests/kms_content_protection.c
> index c59441f11..d1b7c5863 100644
> --- a/tests/kms_content_protection.c
> +++ b/tests/kms_content_protection.c
> @@ -264,16 +264,22 @@ static void modeset_with_fb(igt_output_t
> *output,
> igt_display_t *display = &data.display;
> drmModeModeInfo *mode;
> igt_plane_t *primary;
> + int width, height;
>
> mode = igt_output_get_mode(output);
> + width = mode->hdisplay;
> + height = mode->vdisplay;
>
> primary = igt_output_get_plane_type(output,
> DRM_PLANE_TYPE_PRIMARY);
> igt_plane_set_fb(primary, &data.red);
> - igt_fb_set_size(&data.red, primary, mode->hdisplay, mode-
> >vdisplay);
> + igt_fb_set_size(&data.red, primary, width, height);
> + igt_plane_set_size(primary, width, height);
>
> igt_display_commit2(display, commit_style);
>
> igt_plane_set_fb(primary, &data.green);
> + igt_fb_set_size(&data.green, primary, width, height);
> + igt_plane_set_size(primary, width, height);
>
> /* Wait for Flip completion before starting the HDCP
> authentication */
> commit_display_and_wait_for_flip(commit_style);
> @@ -284,6 +290,8 @@ static bool test_cp_enable(igt_output_t *output,
> enum igt_commit_style commit_st
> {
> igt_display_t *display = &data.display;
> igt_plane_t *primary;
> + drmModeModeInfo *mode;
> + int width, height;
> bool ret;
>
> primary = igt_output_get_plane_type(output,
> DRM_PLANE_TYPE_PRIMARY);
> @@ -302,7 +310,12 @@ static bool test_cp_enable(igt_output_t *output,
> enum igt_commit_style commit_st
> ret = wait_for_prop_value(output, CP_ENABLED,
> KERNEL_AUTH_TIME_ALLOWED_MSEC);
> if (ret) {
> + mode = igt_output_get_mode(output);
> + width = mode->hdisplay;
> + height = mode->vdisplay;
> igt_plane_set_fb(primary, &data.green);
> + igt_plane_set_size(primary, width, height);
> + igt_fb_set_size(&data.green, primary, width,
> height);
> igt_display_commit2(display, commit_style);
> }
>
> @@ -315,13 +328,20 @@ static void test_mst_cp_disable(igt_output_t
> *hdcp_mst_output[],
> {
> igt_display_t *display = &data.display;
> igt_plane_t *primary;
> + drmModeModeInfo *mode;
> + int width, height;
> bool ret;
> int count;
> u64 val;
>
> for (count = 0; count < valid_outputs; count++) {
> primary =
> igt_output_get_plane_type(hdcp_mst_output[count],
> DRM_PLANE_TYPE_PRIMARY);
> + mode = igt_output_get_mode(hdcp_mst_output[count]);
> + width = mode->hdisplay;
> + height = mode->vdisplay;
> igt_plane_set_fb(primary, &data.red);
> + igt_fb_set_size(&data.red, primary, width, height);
> + igt_plane_set_size(primary, width, height);
> igt_output_set_prop_value(hdcp_mst_output[count],
> IGT_CONNECTOR_CONTENT_PROTECTION,
> CP_UNDESIRED);
> }
> @@ -343,10 +363,15 @@ static void test_cp_disable(igt_output_t
> *output, enum igt_commit_style commit_s
> {
> igt_display_t *display = &data.display;
> igt_plane_t *primary;
> + drmModeModeInfo *mode;
> + int width, height;
> bool ret;
>
> primary = igt_output_get_plane_type(output,
> DRM_PLANE_TYPE_PRIMARY);
>
> + mode = igt_output_get_mode(output);
> + width = mode->hdisplay;
> + height = mode->vdisplay;
> /*
> * Even on HDCP enable failed scenario, IGT should exit
> leaving the
> * "content protection" at "UNDESIRED".
> @@ -354,6 +379,8 @@ static void test_cp_disable(igt_output_t *output,
> enum igt_commit_style commit_s
> igt_output_set_prop_value(output,
> IGT_CONNECTOR_CONTENT_PROTECTION,
> CP_UNDESIRED);
> igt_plane_set_fb(primary, &data.red);
> + igt_plane_set_size(primary, width, height);
> + igt_fb_set_size(&data.red, primary, width, height);
> igt_display_commit2(display, commit_style);
>
> /* Wait for HDCP to be disabled, before crtc off */
^ permalink raw reply [flat|nested] only message in thread