Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/kms_content_protection: clamp plane src/dst to output mode
@ 2026-05-15  8:14 Suraj Kandpal
  2026-05-15 15:31 ` ✗ Fi.CI.BUILD: failure for " Patchwork
  0 siblings, 1 reply; 2+ messages in thread
From: Suraj Kandpal @ 2026-05-15  8:14 UTC (permalink / raw)
  To: igt-dev; +Cc: swati2.sharma, santhosh.reddy.guddati, Suraj Kandpal,
	Jason-JH Lin

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().

Tested-by: Jason-JH Lin <jason-jh.lin@mediatek.com>
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.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 */
-- 
2.34.1


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

* ✗ Fi.CI.BUILD: failure for tests/kms_content_protection: clamp plane src/dst to output mode
  2026-05-15  8:14 [PATCH i-g-t] tests/kms_content_protection: clamp plane src/dst to output mode Suraj Kandpal
@ 2026-05-15 15:31 ` Patchwork
  0 siblings, 0 replies; 2+ messages in thread
From: Patchwork @ 2026-05-15 15:31 UTC (permalink / raw)
  To: Kandpal, Suraj; +Cc: igt-dev

== Series Details ==

Series: tests/kms_content_protection: clamp plane src/dst to output mode
URL   : https://patchwork.freedesktop.org/series/166632/
State : failure

== Summary ==

Applying: tests/kms_content_protection: clamp plane src/dst to output mode
Using index info to reconstruct a base tree...
M	tests/kms_content_protection.c
Falling back to patching base and 3-way merge...
Auto-merging tests/kms_content_protection.c
CONFLICT (content): Merge conflict in tests/kms_content_protection.c
Patch failed at 0001 tests/kms_content_protection: clamp plane src/dst to output mode
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".



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

end of thread, other threads:[~2026-05-15 15:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-15  8:14 [PATCH i-g-t] tests/kms_content_protection: clamp plane src/dst to output mode Suraj Kandpal
2026-05-15 15:31 ` ✗ Fi.CI.BUILD: failure for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox