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 4/5] benchmarks/gem_exec_trace: use hars_petruska_f54_1_random() from lib/rand
Date: Fri, 19 Jun 2026 00:26:35 +0530 [thread overview]
Message-ID: <e9fa990f-6475-4134-b23b-0786e072a44d@intel.com> (raw)
In-Reply-To: <c78b332ceeaa0c00b80e99f4e49765bc22abd0ab.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>
> ---
> benchmarks/gem_exec_trace.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/benchmarks/gem_exec_trace.c b/benchmarks/gem_exec_trace.c
> index 4263ccb03dbd..c27639105903 100644
> --- a/benchmarks/gem_exec_trace.c
> +++ b/benchmarks/gem_exec_trace.c
> @@ -42,6 +42,7 @@
> #include "drm.h"
> #include "drmtest.h"
> #include "i915/gem_create.h"
> +#include "igt_rand.h"
> #include "igt_stats.h"
> #include "intel_io.h"
> #include "ioctl_wrappers.h"
> @@ -92,14 +93,7 @@ struct trace_wait {
> uint32_t handle;
> } __attribute__((packed));
>
> -static uint32_t hars_petruska_f54_1_random(void)
> -{
> - static uint32_t state = 0x12345678;
> -
> -#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 double elapsed(const struct timespec *start, const struct timespec *end)
> {
> @@ -277,7 +271,7 @@ static double replay(const char *filename, long nop, long range)
> sizeof(*exec_objects)))->handle = bo[0];
>
> if (nop > 0) {
> - eb.batch_start_offset = hars_petruska_f54_1_random();
> + eb.batch_start_offset = hars_petruska_f54_1_random(&random_state);
> eb.batch_start_offset =
> ((uint64_t)eb.batch_start_offset * range) >> 32;
> eb.batch_start_offset = ALIGN(eb.batch_start_offset, 64);
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 [this message]
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=e9fa990f-6475-4134-b23b-0786e072a44d@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.