All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Sharma, Swati2" <swati2.sharma@intel.com>
To: Jani Nikula <jani.nikula@intel.com>, <igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t 1/5] lib/kms: simplify igt_random_crtc()
Date: Fri, 19 Jun 2026 00:24:34 +0530	[thread overview]
Message-ID: <20ecaa52-681f-493e-a072-d1714c5fdb85@intel.com> (raw)
In-Reply-To: <d19355cb9a4952af550912ef95fd4d79b653050c.1781791747.git.jani.nikula@intel.com>

Hi Jani

On 18-06-2026 07:39 pm, Jani Nikula wrote:
> Now that igt_display_n_crtcs() reflects the actual number of CRTCs
> again, we no longer have to count them separately.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Patch LGTM

Reviewed-by: Swati Sharma <swati2.sharma@intel.com>

> ---
>   lib/igt_kms.c | 9 ++-------
>   1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index e82d32130666..06138ad7125d 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -7922,16 +7922,11 @@ igt_crtc_t *igt_next_crtc(igt_display_t *display, igt_crtc_t *crtc)
>    */
>   igt_crtc_t *igt_random_crtc(igt_display_t *display)
>   {
> -	igt_crtc_t *crtcs[IGT_MAX_PIPES];
> -	igt_crtc_t *crtc;
> -	int n = 0;
> -
> -	for_each_crtc(display, crtc)
> -		crtcs[n++] = crtc;
> +	int n = igt_display_n_crtcs(display);
>   
>   	igt_skip_on_f(!n, "No CRTCs on device\n");
>   
> -	return crtcs[rand() % n];
> +	return igt_crtc_for_crtc_index(display, rand() % n);
>   }
>   
>   static drmModeConnectorPtr igt_wait_for_connector(int drm_fd, unsigned int connector_id,

  reply	other threads:[~2026-06-18 18:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-18 14:09 [PATCH i-g-t 0/5] igt: cleanups to random functions Jani Nikula
2026-06-18 14:09 ` [PATCH i-g-t 1/5] lib/kms: simplify igt_random_crtc() Jani Nikula
2026-06-18 18:54   ` Sharma, Swati2 [this message]
2026-06-18 14:09 ` [PATCH i-g-t 2/5] lib/rand: move static inlines to proper functions Jani Nikula
2026-06-18 18:55   ` Sharma, Swati2
2026-06-18 14:09 ` [PATCH i-g-t 3/5] benchmarks/gem_exec_reloc: use hars_petruska_f54_1_random() from lib/rand Jani Nikula
2026-06-18 18:56   ` Sharma, Swati2
2026-06-18 14:09 ` [PATCH i-g-t 4/5] benchmarks/gem_exec_trace: " Jani Nikula
2026-06-18 18:56   ` Sharma, Swati2
2026-06-18 14:09 ` [PATCH i-g-t 5/5] tests/gem_exec_lut_handle: " Jani Nikula
2026-06-18 18:56   ` Sharma, Swati2
2026-06-18 17:49 ` ✓ Xe.CI.BAT: success for igt: cleanups to random functions Patchwork
2026-06-18 18:30 ` ✓ i915.CI.BAT: " Patchwork

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=20ecaa52-681f-493e-a072-d1714c5fdb85@intel.com \
    --to=swati2.sharma@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jani.nikula@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.