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 5/5] tests/gem_exec_lut_handle: use hars_petruska_f54_1_random() from lib/rand
Date: Fri, 19 Jun 2026 00:26:59 +0530 [thread overview]
Message-ID: <8eba7d04-07a3-4bb0-9658-b5d644bf0098@intel.com> (raw)
In-Reply-To: <5557fc29347fa3a35254ea56c57d81766e6973c0.1781791747.git.jani.nikula@intel.com>
Hi Jani
On 18-06-2026 07:39 pm, Jani Nikula wrote:
> Remove the local duplicate of hars_petruska_f54_1_random() by switching
> to use lib/rand.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Patch LGTM
Reviewed-by: Swati Sharma <swati2.sharma@intel.com>
> ---
> tests/intel/gem_exec_lut_handle.c | 14 ++++----------
> 1 file changed, 4 insertions(+), 10 deletions(-)
>
> diff --git a/tests/intel/gem_exec_lut_handle.c b/tests/intel/gem_exec_lut_handle.c
> index fac7f2fbb45f..6ed304fc6d5e 100644
> --- a/tests/intel/gem_exec_lut_handle.c
> +++ b/tests/intel/gem_exec_lut_handle.c
> @@ -40,6 +40,8 @@
> #include "i915/gem.h"
> #include "i915/gem_create.h"
> #include "igt.h"
> +#include "igt_rand.h"
> +
> /**
> * TEST: gem exec lut handle
> * Description: Exercises the basic execbuffer using the handle LUT interface.
> @@ -65,15 +67,7 @@ int target[MAX_NUM_RELOC];
> struct drm_i915_gem_exec_object2 gem_exec[MAX_NUM_EXEC+1];
> struct drm_i915_gem_relocation_entry mem_reloc[MAX_NUM_RELOC];
>
> -static uint32_t state = 0x12345678;
> -
> -static uint32_t
> -hars_petruska_f54_1_random (void)
> -{
> -#define rol(x,k) ((x << k) | (x >> (32-k)))
> - return state = (state ^ rol (state, 5) ^ rol (state, 24)) + 0x37798849;
> -#undef rol
> -}
> +static uint32_t random_state = 0x12345678;
>
> static int has_exec_lut(int fd)
> {
> @@ -164,7 +158,7 @@ int igt_simple_main()
> execbuf.flags |= I915_EXEC_NO_RELOC;
>
> for (j = 0; j < m; j++) {
> - target[j] = hars_petruska_f54_1_random() % n;
> + target[j] = hars_petruska_f54_1_random(&random_state) % n;
> reloc[j].target_handle = target[j];
> reloc[j].presumed_offset = -1;
> }
next prev parent reply other threads:[~2026-06-18 18:57 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
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 [this message]
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=8eba7d04-07a3-4bb0-9658-b5d644bf0098@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox