public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 0/2] Fix non-joiner mode helper and use it in test
@ 2026-03-23  5:10 Pranay Samala
  2026-03-23  5:10 ` [PATCH i-g-t 1/2] lib/igt_kms: Make helper use out-parameter Pranay Samala
  2026-03-23  5:10 ` [PATCH i-g-t 2/2] tests/intel/kms_sharpness_filter: Use stable non-joiner mode for joiner bypass Pranay Samala
  0 siblings, 2 replies; 7+ messages in thread
From: Pranay Samala @ 2026-03-23  5:10 UTC (permalink / raw)
  To: igt-dev; +Cc: karthik.b.s, sameer.lattannavar, pranay.samala

The get-non-joiner-mode helper returns a pointer to connected-owned
memory which could become invalid after display state changes, causing
stale mode data and test failures.

So 1st patch converts the helper to use an output-parameter, and 2nd patch
updates the test to use local stable mode for joiner bypass and applies
the selected mode to output before commit.

Pranay Samala (2):
  lib/igt_kms: Make helper use out-parameter
  tests/intel/kms_sharpness_filter: Use stable non-joiner mode for
    joiner bypass

 lib/igt_kms.c                      | 10 ++++++----
 lib/igt_kms.h                      |  2 +-
 tests/intel/kms_sharpness_filter.c | 10 +++++++---
 3 files changed, 14 insertions(+), 8 deletions(-)

-- 
2.34.1


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

* [PATCH i-g-t 1/2] lib/igt_kms: Make helper use out-parameter
  2026-03-23  5:10 [PATCH i-g-t 0/2] Fix non-joiner mode helper and use it in test Pranay Samala
@ 2026-03-23  5:10 ` Pranay Samala
  2026-03-23  9:25   ` Jani Nikula
  2026-03-23  5:10 ` [PATCH i-g-t 2/2] tests/intel/kms_sharpness_filter: Use stable non-joiner mode for joiner bypass Pranay Samala
  1 sibling, 1 reply; 7+ messages in thread
From: Pranay Samala @ 2026-03-23  5:10 UTC (permalink / raw)
  To: igt-dev; +Cc: karthik.b.s, sameer.lattannavar, pranay.samala

Convert igt_get_non_joiner_mode() helper from returning a mode
pointer to returning bool and filling an output parameter.

Returning connector-owned pointer becomes invalid after connecter
state changes/resets. Hence copying into called-owned argument,
which keeps data stable and safe.
Also update the doc for the new argument and return semantics.

Fixes: e404926ca0d7 ("lib/igt_kms: Add helper to get non-joiner mode")
Signed-off-by: Pranay Samala <pranay.samala@intel.com>
---
 lib/igt_kms.c | 10 ++++++----
 lib/igt_kms.h |  2 +-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 197ed15d1..118890014 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -7057,13 +7057,14 @@ bool ultrajoiner_mode_found(int drm_fd, drmModeConnector *connector,
  * igt_get_non_joiner_mode:
  * @drm_fd: drm file descriptor
  * @output: pointer to the output structure
+ * @mode: a pointer to a drm mode structure
  *
  * Finds the display mode from the output that does not require
  * Big Joiner or Ultra Joiner.
  *
- * Returns: Pointer to non-joiner mode, or NULL if not found.
+ * Returns: True if non-joiner mode found.
  */
-drmModeModeInfo *igt_get_non_joiner_mode(int drm_fd, igt_output_t *output)
+bool igt_get_non_joiner_mode(int drm_fd, igt_output_t *output, drmModeModeInfo *mode)
 {
 	drmModeConnector *connector;
 	int max_dotclock;
@@ -7077,11 +7078,12 @@ drmModeModeInfo *igt_get_non_joiner_mode(int drm_fd, igt_output_t *output)
 		/* Check if mode requires joiner */
 		if (!igt_bigjoiner_possible(drm_fd, current_mode, max_dotclock) &&
 		    !igt_ultrajoiner_possible(drm_fd, current_mode, max_dotclock)) {
-			return current_mode;
+			*mode = *current_mode;
+			return true;
 		}
 	}
 
-	return NULL;
+	return false;
 }
 
 /**
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 71ed4604e..d63836588 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -1259,7 +1259,7 @@ bool igt_ultrajoiner_possible(int drmfd, drmModeModeInfo *mode, int max_dotclock
 bool ultrajoiner_mode_found(int drm_fd, drmModeConnector *connector,
 			  int max_dotclock, drmModeModeInfo *mode);
 bool igt_has_force_joiner_debugfs(int drmfd, char *conn_name);
-drmModeModeInfo *igt_get_non_joiner_mode(int drm_fd, igt_output_t *output);
+bool igt_get_non_joiner_mode(int drm_fd, igt_output_t *output, drmModeModeInfo *mode);
 bool is_joiner_mode(int drm_fd, igt_output_t *output);
 bool igt_check_force_joiner_status(int drmfd, char *connector_name);
 bool igt_check_bigjoiner_support(igt_display_t *display);
-- 
2.34.1


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

* [PATCH i-g-t 2/2] tests/intel/kms_sharpness_filter: Use stable non-joiner mode for joiner bypass
  2026-03-23  5:10 [PATCH i-g-t 0/2] Fix non-joiner mode helper and use it in test Pranay Samala
  2026-03-23  5:10 ` [PATCH i-g-t 1/2] lib/igt_kms: Make helper use out-parameter Pranay Samala
@ 2026-03-23  5:10 ` Pranay Samala
  2026-03-23  7:29   ` Garg, Nemesa
  1 sibling, 1 reply; 7+ messages in thread
From: Pranay Samala @ 2026-03-23  5:10 UTC (permalink / raw)
  To: igt-dev; +Cc: karthik.b.s, sameer.lattannavar, pranay.samala

When joiner mode is detected, fetch a non-joiner mode into local
variable and store it into the caller-owned copy.

Also override the selected mode before commit so the programmed
output mode matches the mode used by the test.

Fixes: 10dccc7fc82f ("tests/intel/kms_sharpness_filter: Detect and bypass joiner modes")
Signed-off-by: Pranay Samala <pranay.samala@intel.com>
---
 tests/intel/kms_sharpness_filter.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tests/intel/kms_sharpness_filter.c b/tests/intel/kms_sharpness_filter.c
index 96fb139ae..881fab746 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 selected_mode;
 	char name[40];
 
 	for_each_connected_output(display, output) {
@@ -438,15 +439,17 @@ 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.
 			 * Remove this check once support is implemented.
 			 * 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);
+			if (is_joiner_mode(data->drm_fd, data->output) &&
+			    igt_get_non_joiner_mode(data->drm_fd,
+						    data->output,
+						    &selected_mode)) {
+				data->mode = &selected_mode;
 				igt_info("Executing on mode %dx%d@%d\n",
 					 data->mode->hdisplay,
 					 data->mode->vdisplay,
@@ -463,6 +466,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

* RE: [PATCH i-g-t 2/2] tests/intel/kms_sharpness_filter: Use stable non-joiner mode for joiner bypass
  2026-03-23  5:10 ` [PATCH i-g-t 2/2] tests/intel/kms_sharpness_filter: Use stable non-joiner mode for joiner bypass Pranay Samala
@ 2026-03-23  7:29   ` Garg, Nemesa
  2026-03-23  9:29     ` Jani Nikula
  0 siblings, 1 reply; 7+ messages in thread
From: Garg, Nemesa @ 2026-03-23  7:29 UTC (permalink / raw)
  To: Samala, Pranay, igt-dev@lists.freedesktop.org
  Cc: B S, Karthik, Lattannavar, Sameer, Samala, Pranay



> -----Original Message-----
> From: igt-dev <igt-dev-bounces@lists.freedesktop.org> On Behalf Of Pranay
> Samala
> Sent: Monday, March 23, 2026 10:41 AM
> To: igt-dev@lists.freedesktop.org
> Cc: B S, Karthik <karthik.b.s@intel.com>; Lattannavar, Sameer
> <sameer.lattannavar@intel.com>; Samala, Pranay
> <pranay.samala@intel.com>
> Subject: [PATCH i-g-t 2/2] tests/intel/kms_sharpness_filter: Use stable non-
> joiner mode for joiner bypass
> 
> When joiner mode is detected, fetch a non-joiner mode into local variable
> and store it into the caller-owned copy.
> 
> Also override the selected mode before commit so the programmed output
> mode matches the mode used by the test.
> 
> Fixes: 10dccc7fc82f ("tests/intel/kms_sharpness_filter: Detect and bypass
> joiner modes")
> Signed-off-by: Pranay Samala <pranay.samala@intel.com>
> ---
>  tests/intel/kms_sharpness_filter.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/intel/kms_sharpness_filter.c
> b/tests/intel/kms_sharpness_filter.c
> index 96fb139ae..881fab746 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 selected_mode;
>  	char name[40];
> 
>  	for_each_connected_output(display, output) { @@ -438,15 +439,17
> @@ 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.
>  			 * Remove this check once support is implemented.
>  			 * 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);

Hi Pranay,
I guess instead of retuning bool value we can the pointer whether NULL or not and then assign the mode , something like this:
If(!igt_get_non_joiner_mode(data->drm_fd, data->output))
   data->mode = igt_get_non_joiner_mode(data->drm_fd, data->output);

Thanks,
Nemesa

> +			if (is_joiner_mode(data->drm_fd, data->output) &&
> +			    igt_get_non_joiner_mode(data->drm_fd,
> +						    data->output,
> +						    &selected_mode)) {
> +				data->mode = &selected_mode;
>  				igt_info("Executing on mode %dx%d@%d\n",
>  					 data->mode->hdisplay,
>  					 data->mode->vdisplay,
> @@ -463,6 +466,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	[flat|nested] 7+ messages in thread

* Re: [PATCH i-g-t 1/2] lib/igt_kms: Make helper use out-parameter
  2026-03-23  5:10 ` [PATCH i-g-t 1/2] lib/igt_kms: Make helper use out-parameter Pranay Samala
@ 2026-03-23  9:25   ` Jani Nikula
  0 siblings, 0 replies; 7+ messages in thread
From: Jani Nikula @ 2026-03-23  9:25 UTC (permalink / raw)
  To: Pranay Samala, igt-dev; +Cc: karthik.b.s, sameer.lattannavar, pranay.samala

On Mon, 23 Mar 2026, Pranay Samala <pranay.samala@intel.com> wrote:
> Convert igt_get_non_joiner_mode() helper from returning a mode
> pointer to returning bool and filling an output parameter.
>
> Returning connector-owned pointer becomes invalid after connecter
> state changes/resets. Hence copying into called-owned argument,
> which keeps data stable and safe.
> Also update the doc for the new argument and return semantics.

This breaks the build and thus bisect.

Please do something like

$ git rebase -i origin -x 'ninja -C build'

before sending to ensure every commit builds.

BR,
Jani.

>
> Fixes: e404926ca0d7 ("lib/igt_kms: Add helper to get non-joiner mode")
> Signed-off-by: Pranay Samala <pranay.samala@intel.com>
> ---
>  lib/igt_kms.c | 10 ++++++----
>  lib/igt_kms.h |  2 +-
>  2 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 197ed15d1..118890014 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -7057,13 +7057,14 @@ bool ultrajoiner_mode_found(int drm_fd, drmModeConnector *connector,
>   * igt_get_non_joiner_mode:
>   * @drm_fd: drm file descriptor
>   * @output: pointer to the output structure
> + * @mode: a pointer to a drm mode structure
>   *
>   * Finds the display mode from the output that does not require
>   * Big Joiner or Ultra Joiner.
>   *
> - * Returns: Pointer to non-joiner mode, or NULL if not found.
> + * Returns: True if non-joiner mode found.
>   */
> -drmModeModeInfo *igt_get_non_joiner_mode(int drm_fd, igt_output_t *output)
> +bool igt_get_non_joiner_mode(int drm_fd, igt_output_t *output, drmModeModeInfo *mode)
>  {
>  	drmModeConnector *connector;
>  	int max_dotclock;
> @@ -7077,11 +7078,12 @@ drmModeModeInfo *igt_get_non_joiner_mode(int drm_fd, igt_output_t *output)
>  		/* Check if mode requires joiner */
>  		if (!igt_bigjoiner_possible(drm_fd, current_mode, max_dotclock) &&
>  		    !igt_ultrajoiner_possible(drm_fd, current_mode, max_dotclock)) {
> -			return current_mode;
> +			*mode = *current_mode;
> +			return true;
>  		}
>  	}
>  
> -	return NULL;
> +	return false;
>  }
>  
>  /**
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index 71ed4604e..d63836588 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -1259,7 +1259,7 @@ bool igt_ultrajoiner_possible(int drmfd, drmModeModeInfo *mode, int max_dotclock
>  bool ultrajoiner_mode_found(int drm_fd, drmModeConnector *connector,
>  			  int max_dotclock, drmModeModeInfo *mode);
>  bool igt_has_force_joiner_debugfs(int drmfd, char *conn_name);
> -drmModeModeInfo *igt_get_non_joiner_mode(int drm_fd, igt_output_t *output);
> +bool igt_get_non_joiner_mode(int drm_fd, igt_output_t *output, drmModeModeInfo *mode);
>  bool is_joiner_mode(int drm_fd, igt_output_t *output);
>  bool igt_check_force_joiner_status(int drmfd, char *connector_name);
>  bool igt_check_bigjoiner_support(igt_display_t *display);

-- 
Jani Nikula, Intel

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

* RE: [PATCH i-g-t 2/2] tests/intel/kms_sharpness_filter: Use stable non-joiner mode for joiner bypass
  2026-03-23  7:29   ` Garg, Nemesa
@ 2026-03-23  9:29     ` Jani Nikula
  2026-03-23 13:02       ` Samala, Pranay
  0 siblings, 1 reply; 7+ messages in thread
From: Jani Nikula @ 2026-03-23  9:29 UTC (permalink / raw)
  To: Garg, Nemesa, Samala, Pranay, igt-dev@lists.freedesktop.org
  Cc: B S, Karthik, Lattannavar, Sameer, Samala, Pranay

On Mon, 23 Mar 2026, "Garg, Nemesa" <nemesa.garg@intel.com> wrote:
>> -----Original Message-----
>> From: igt-dev <igt-dev-bounces@lists.freedesktop.org> On Behalf Of Pranay
>> Samala
>> Sent: Monday, March 23, 2026 10:41 AM
>> To: igt-dev@lists.freedesktop.org
>> Cc: B S, Karthik <karthik.b.s@intel.com>; Lattannavar, Sameer
>> <sameer.lattannavar@intel.com>; Samala, Pranay
>> <pranay.samala@intel.com>
>> Subject: [PATCH i-g-t 2/2] tests/intel/kms_sharpness_filter: Use stable non-
>> joiner mode for joiner bypass
>> 
>> When joiner mode is detected, fetch a non-joiner mode into local variable
>> and store it into the caller-owned copy.
>> 
>> Also override the selected mode before commit so the programmed output
>> mode matches the mode used by the test.
>> 
>> Fixes: 10dccc7fc82f ("tests/intel/kms_sharpness_filter: Detect and bypass
>> joiner modes")
>> Signed-off-by: Pranay Samala <pranay.samala@intel.com>
>> ---
>>  tests/intel/kms_sharpness_filter.c | 10 +++++++---
>>  1 file changed, 7 insertions(+), 3 deletions(-)
>> 
>> diff --git a/tests/intel/kms_sharpness_filter.c
>> b/tests/intel/kms_sharpness_filter.c
>> index 96fb139ae..881fab746 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 selected_mode;
>>  	char name[40];
>> 
>>  	for_each_connected_output(display, output) { @@ -438,15 +439,17
>> @@ 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.
>>  			 * Remove this check once support is implemented.
>>  			 * 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);
>
> Hi Pranay,
> I guess instead of retuning bool value we can the pointer whether NULL or not and then assign the mode , something like this:
> If(!igt_get_non_joiner_mode(data->drm_fd, data->output))
>    data->mode = igt_get_non_joiner_mode(data->drm_fd, data->output);

Yeah, there are many ways to accomplish the same without changing
igt_get_non_joiner_mode() function.

BR,
Jani.



>
> Thanks,
> Nemesa
>
>> +			if (is_joiner_mode(data->drm_fd, data->output) &&
>> +			    igt_get_non_joiner_mode(data->drm_fd,
>> +						    data->output,
>> +						    &selected_mode)) {
>> +				data->mode = &selected_mode;
>>  				igt_info("Executing on mode %dx%d@%d\n",
>>  					 data->mode->hdisplay,
>>  					 data->mode->vdisplay,
>> @@ -463,6 +466,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
>

-- 
Jani Nikula, Intel

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

* RE: [PATCH i-g-t 2/2] tests/intel/kms_sharpness_filter: Use stable non-joiner mode for joiner bypass
  2026-03-23  9:29     ` Jani Nikula
@ 2026-03-23 13:02       ` Samala, Pranay
  0 siblings, 0 replies; 7+ messages in thread
From: Samala, Pranay @ 2026-03-23 13:02 UTC (permalink / raw)
  To: Nikula, Jani, Garg, Nemesa, igt-dev@lists.freedesktop.org
  Cc: B S, Karthik, Lattannavar, Sameer



> -----Original Message-----
> From: Nikula, Jani <jani.nikula@intel.com>
> Sent: Monday, March 23, 2026 2:59 PM
> To: Garg, Nemesa <nemesa.garg@intel.com>; Samala, Pranay
> <pranay.samala@intel.com>; igt-dev@lists.freedesktop.org
> Cc: B S, Karthik <karthik.b.s@intel.com>; Lattannavar, Sameer
> <sameer.lattannavar@intel.com>; Samala, Pranay
> <pranay.samala@intel.com>
> Subject: RE: [PATCH i-g-t 2/2] tests/intel/kms_sharpness_filter: Use stable
> non-joiner mode for joiner bypass
> 
> On Mon, 23 Mar 2026, "Garg, Nemesa" <nemesa.garg@intel.com> wrote:
> >> -----Original Message-----
> >> From: igt-dev <igt-dev-bounces@lists.freedesktop.org> On Behalf Of
> >> Pranay Samala
> >> Sent: Monday, March 23, 2026 10:41 AM
> >> To: igt-dev@lists.freedesktop.org
> >> Cc: B S, Karthik <karthik.b.s@intel.com>; Lattannavar, Sameer
> >> <sameer.lattannavar@intel.com>; Samala, Pranay
> >> <pranay.samala@intel.com>
> >> Subject: [PATCH i-g-t 2/2] tests/intel/kms_sharpness_filter: Use
> >> stable non- joiner mode for joiner bypass
> >>
> >> When joiner mode is detected, fetch a non-joiner mode into local
> >> variable and store it into the caller-owned copy.
> >>
> >> Also override the selected mode before commit so the programmed
> >> output mode matches the mode used by the test.
> >>
> >> Fixes: 10dccc7fc82f ("tests/intel/kms_sharpness_filter: Detect and
> >> bypass joiner modes")
> >> Signed-off-by: Pranay Samala <pranay.samala@intel.com>
> >> ---
> >>  tests/intel/kms_sharpness_filter.c | 10 +++++++---
> >>  1 file changed, 7 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/tests/intel/kms_sharpness_filter.c
> >> b/tests/intel/kms_sharpness_filter.c
> >> index 96fb139ae..881fab746 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 selected_mode;
> >>  	char name[40];
> >>
> >>  	for_each_connected_output(display, output) { @@ -438,15 +439,17
> @@
> >> 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.
> >>  			 * Remove this check once support is implemented.
> >>  			 * 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);
> >
> > Hi Pranay,
> > I guess instead of retuning bool value we can the pointer whether NULL or
> not and then assign the mode , something like this:
> > If(!igt_get_non_joiner_mode(data->drm_fd, data->output))
> >    data->mode = igt_get_non_joiner_mode(data->drm_fd, data->output);
> 
> Yeah, there are many ways to accomplish the same without changing
> igt_get_non_joiner_mode() function.
Hi Jani, Nemesa
Thanks for the review, I will keep the helper as pointer-returning and avoid changing the API.
I will take the returned mode pointer once, check for NULL, copy it into local variable, and set data->mode = &selected_mode before mode override/commit.

This keeps the change minimal while still fixing the stale mode pointer usage.

Regards,
Pranay.
> 
> BR,
> Jani.
> 
> 
> 
> >
> > Thanks,
> > Nemesa
> >
> >> +			if (is_joiner_mode(data->drm_fd, data->output) &&
> >> +			    igt_get_non_joiner_mode(data->drm_fd,
> >> +						    data->output,
> >> +						    &selected_mode)) {
> >> +				data->mode = &selected_mode;
> >>  				igt_info("Executing on mode %dx%d@%d\n",
> >>  					 data->mode->hdisplay,
> >>  					 data->mode->vdisplay,
> >> @@ -463,6 +466,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
> >
> 
> --
> Jani Nikula, Intel

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

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

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-23  5:10 [PATCH i-g-t 0/2] Fix non-joiner mode helper and use it in test Pranay Samala
2026-03-23  5:10 ` [PATCH i-g-t 1/2] lib/igt_kms: Make helper use out-parameter Pranay Samala
2026-03-23  9:25   ` Jani Nikula
2026-03-23  5:10 ` [PATCH i-g-t 2/2] tests/intel/kms_sharpness_filter: Use stable non-joiner mode for joiner bypass Pranay Samala
2026-03-23  7:29   ` Garg, Nemesa
2026-03-23  9:29     ` Jani Nikula
2026-03-23 13:02       ` Samala, Pranay

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