public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 1/1] tests/kms_content_protection: Re-create framebuffer before each modeset
@ 2026-01-06 10:21 Jason-JH Lin
  2026-01-06 11:40 ` ✓ Xe.CI.BAT: success for series starting with [i-g-t,1/1] " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Jason-JH Lin @ 2026-01-06 10:21 UTC (permalink / raw)
  To: igt-dev, Karthik B S, Swati Sharma, Kamil Konieczny,
	Juha-Pekka Heikkila, Bhanuprakash Modem, Fei Shao
  Cc: Jani, Jason-JH Lin, Paul-PL Chen, Nancy Lin, Singo Chang,
	Gil Dekel, Yacoub, Project_Global_Chrome_Upstream_Group

The red and green framebuffers were previously created only once at
the beginning of the test. If the test runs on multiple outputs with
different resolutions, the pre-created framebuffer's size might not
match the mode of a subsequent output, causing the modeset to fail.

This patch moves the framebuffer creation logic inside the
modeset_with_fb() function. This ensures that for every modeset
operation, a new framebuffer is created with dimensions that
perfectly match the current output's mode, preventing potential
modeset failures on systems with multiple displays of varying
resolutions.

Signed-off-by: Jason-JH Lin <jason-jh.lin@mediatek.com>
---
 tests/kms_content_protection.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
index 377bab9a3afb..980091871679 100644
--- a/tests/kms_content_protection.c
+++ b/tests/kms_content_protection.c
@@ -250,6 +250,13 @@ static void modeset_with_fb(const enum pipe pipe, igt_output_t *output,
 
 	mode = igt_output_get_mode(output);
 
+	igt_create_color_fb(data.drm_fd, mode->hdisplay, mode->vdisplay,
+			    DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_LINEAR,
+			    1.f, 0.f, 0.f, &data.red);
+	igt_create_color_fb(data.drm_fd, mode->hdisplay, mode->vdisplay,
+			    DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_LINEAR,
+			    0.f, 1.f, 0.f, &data.green);
+
 	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);
-- 
2.43.0


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

end of thread, other threads:[~2026-02-13  7:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-06 10:21 [PATCH i-g-t 1/1] tests/kms_content_protection: Re-create framebuffer before each modeset Jason-JH Lin
2026-01-06 11:40 ` ✓ Xe.CI.BAT: success for series starting with [i-g-t,1/1] " Patchwork
2026-01-06 12:03 ` ✓ i915.CI.BAT: " Patchwork
2026-01-06 15:36 ` ✗ Xe.CI.Full: failure " Patchwork
2026-01-06 18:46 ` ✗ i915.CI.Full: " Patchwork
2026-01-07  5:04 ` [PATCH i-g-t 1/1] " Karthik B S
2026-01-07  6:29   ` Jason-JH Lin (林睿祥)
2026-01-08  5:43     ` Karthik B S
2026-01-08 14:17       ` Jason-JH Lin (林睿祥)
2026-02-10 10:34         ` Jason-JH Lin (林睿祥)
2026-02-13  7:02           ` Karthik B S

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