Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Karthik B S <karthik.b.s@intel.com>
To: Santhosh Reddy Guddati <santhosh.reddy.guddati@intel.com>,
	<igt-dev@lists.freedesktop.org>
Cc: <arun.r.murthy@intel.com>, <jeevan.b@intel.com>,
	<kunal1.joshi@intel.com>,  <luca@coelho.fi>
Subject: Re: [PATCH i-g-t v2] lib/igt_kms: Backup connector modes before sorting
Date: Tue, 7 Jan 2025 14:03:13 +0530	[thread overview]
Message-ID: <89a83e9d-c7c2-44f2-9b19-21218aa57902@intel.com> (raw)
In-Reply-To: <20250103153333.4253-1-santhosh.reddy.guddati@intel.com>


On 1/3/2025 9:03 PM, Santhosh Reddy Guddati wrote:
> Backup connector modes before sorting to ensure the original mode
> is not changed if the joiner is not found.This will skip updating
> connector->mode[0] if joiner is not available.
>
> v2: Dont sort the modes, instead check for the required modes (Luca Coelho)
>
> Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13287
> Signed-off-by: Santhosh Reddy Guddati <santhosh.reddy.guddati@intel.com>
Reviewed-by: Karthik B S <karthik.b.s@intel.com>
> ---
>   lib/igt_kms.c | 27 +++++++++++++--------------
>   1 file changed, 13 insertions(+), 14 deletions(-)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index a67d17c4f..95e3059f7 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -6418,14 +6418,13 @@ bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
>   {
>   	bool found = false;
>   
> -	igt_sort_connector_modes(connector, sort_drm_modes_by_res_dsc);
> -	found = igt_bigjoiner_possible(drm_fd, &connector->modes[0], max_dotclock);
> -	if (!found) {
> -		igt_sort_connector_modes(connector, sort_drm_modes_by_clk_dsc);
> -		found = igt_bigjoiner_possible(drm_fd, &connector->modes[0], max_dotclock);
> +	for (int i=0; i< connector->count_modes; i++) {
> +		if (igt_bigjoiner_possible(drm_fd, &connector->modes[i], max_dotclock)) {
> +			*mode = connector->modes[i];
> +			found = true;
> +			break;
> +		}
>   	}
> -	if (found)
> -		*mode = connector->modes[0];
>   	return found;
>   }
>   
> @@ -6462,14 +6461,14 @@ bool ultrajoiner_mode_found(int drm_fd, drmModeConnector *connector,
>   {
>   	bool found = false;
>   
> -	igt_sort_connector_modes(connector, sort_drm_modes_by_res_dsc);
> -	found = igt_ultrajoiner_possible(&connector->modes[0], max_dotclock);
> -	if (!found) {
> -		igt_sort_connector_modes(connector, sort_drm_modes_by_clk_dsc);
> -		found = igt_ultrajoiner_possible(&connector->modes[0], max_dotclock);
> +	for (int i = 0; i < connector->count_modes; i++) {
> +		if (igt_ultrajoiner_possible(&connector->modes[i], max_dotclock)) {
> +			*mode = connector->modes[i];
> +			found = true;
> +			break;
> +		}
>   	}
> -	if (found)
> -		*mode = connector->modes[0];
> +
>   	return found;
>   }
>   

      parent reply	other threads:[~2025-01-07  8:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-03 15:33 [PATCH i-g-t v2] lib/igt_kms: Backup connector modes before sorting Santhosh Reddy Guddati
2025-01-03 16:37 ` ✓ Xe.CI.BAT: success for lib/igt_kms: Backup connector modes before sorting (rev2) Patchwork
2025-01-03 16:39 ` ✓ i915.CI.BAT: " Patchwork
2025-01-03 20:16 ` ✗ i915.CI.Full: failure " Patchwork
2025-01-04  0:39 ` ✗ Xe.CI.Full: " Patchwork
2025-01-07  6:43 ` [PATCH i-g-t v2] lib/igt_kms: Backup connector modes before sorting Luca Coelho
2025-01-07  9:29   ` Luca Coelho
2025-01-07  8:33 ` Karthik B S [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=89a83e9d-c7c2-44f2-9b19-21218aa57902@intel.com \
    --to=karthik.b.s@intel.com \
    --cc=arun.r.murthy@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jeevan.b@intel.com \
    --cc=kunal1.joshi@intel.com \
    --cc=luca@coelho.fi \
    --cc=santhosh.reddy.guddati@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox