public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/intel/kms_sharpness_filter: Fix stale mode pointer in joiner bypass
@ 2026-03-23 14:11 Pranay Samala
  2026-03-23 16:55 ` ✓ Xe.CI.BAT: success for " Patchwork
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Pranay Samala @ 2026-03-23 14:11 UTC (permalink / raw)
  To: igt-dev; +Cc: karthik.b.s, sameer.lattannavar, pranay.samala

When joiner mode is detected, the returned mode pointer from
igt_get_non_joiner_mode() points into connector-owned memory
which can become invalid after subsequent display state changes.

Fix this by copying the mode into local variable for stable
storage. Skip the output if no non-joiner mode is found.

Fixes: 10dccc7fc82f ("tests/intel/kms_sharpness_filter: Detect and bypass joiner modes")
Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/7045
Signed-off-by: Pranay Samala <pranay.samala@intel.com>
---
 tests/intel/kms_sharpness_filter.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/tests/intel/kms_sharpness_filter.c b/tests/intel/kms_sharpness_filter.c
index 96fb139ae..c2295c0ee 100644
--- a/tests/intel/kms_sharpness_filter.c
+++ b/tests/intel/kms_sharpness_filter.c
@@ -430,6 +430,7 @@ run_sharpness_filter_test(data_t *data, enum test_type type)
 	igt_display_t *display = &data->display;
 	igt_output_t *output;
 	igt_crtc_t *crtc;
+	drmModeModeInfo *m, selected_mode;
 	char name[40];
 
 	for_each_connected_output(display, output) {
@@ -438,7 +439,6 @@ run_sharpness_filter_test(data_t *data, enum test_type type)
 
 			data->output = output;
 			data->crtc = crtc;
-			data->mode = igt_output_get_mode(data->output);
 
 			/*
 			 * FIXME: Joiner + CASF currently unsupported.
@@ -446,7 +446,15 @@ run_sharpness_filter_test(data_t *data, enum test_type type)
 			 * Until then, run on non-joiner mode in joiner configuration.
 			 */
 			if (is_joiner_mode(data->drm_fd, data->output)) {
-				data->mode = igt_get_non_joiner_mode(data->drm_fd, data->output);
+				m = igt_get_non_joiner_mode(data->drm_fd, data->output);
+				if (!m) {
+					igt_info("No non-joiner mode found on %s\n",
+						 igt_output_name(data->output));
+					continue;
+				}
+
+				selected_mode = *m;
+				data->mode = &selected_mode;
 				igt_info("Executing on mode %dx%d@%d\n",
 					 data->mode->hdisplay,
 					 data->mode->vdisplay,
@@ -463,6 +471,7 @@ run_sharpness_filter_test(data_t *data, enum test_type type)
 
 			igt_output_set_crtc(data->output,
 					    data->crtc);
+			igt_output_override_mode(data->output, data->mode);
 
 			if (!intel_pipe_output_combo_valid(display)) {
 				igt_output_set_crtc(data->output, NULL);
-- 
2.34.1


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

end of thread, other threads:[~2026-03-25  9:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-23 14:11 [PATCH i-g-t] tests/intel/kms_sharpness_filter: Fix stale mode pointer in joiner bypass Pranay Samala
2026-03-23 16:55 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-03-23 17:21 ` ✓ i915.CI.BAT: " Patchwork
2026-03-24  0:21 ` ✓ Xe.CI.FULL: " Patchwork
2026-03-24  2:52 ` ✗ i915.CI.Full: failure " Patchwork
2026-03-24 15:19 ` [PATCH i-g-t] " Garg, Nemesa
2026-03-25  9:55 ` 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