From: Jani Nikula <jani.nikula@intel.com>
To: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
Cc: 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: Thu, 25 Jun 2026 12:34:14 +0300 [thread overview]
Message-ID: <79e99fc4f138d3287683749b83225822f2406f21@intel.com> (raw)
In-Reply-To: <3apgkow66ofonucapgl5ex55vjcjdbeofqktlrnzxavfexkldf@uorihbgw66oi>
On Thu, 25 Jun 2026, Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> wrote:
> On Wed, Jun 24, 2026 at 11:03:51AM +0300, Jani Nikula wrote:
>> On Mon, 22 Jun 2026, Jani Nikula <jani.nikula@intel.com> wrote:
>> > On Fri, 19 Jun 2026, Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> wrote:
>> >> On Thu, Jun 18, 2026 at 05:09:52PM +0300, 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>
>> >>> ---
>> >>> 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);
>> >>
>> >> With random_state as above this offset is not random. I think adding nop
>> >> to random_state would do this.
>> >
>> > I'm only aiming to do a non-functional conversion to existing library
>> > functions. Please explain how this patch changes behaviour; I don't see
>> > it.
>>
>> Zbigniew, ping?
>
> I'm sorry for the delay.
>
> I wondered to change offsets for each run, with same random_state on the
> beginning we use same offsets sequence.
>
> But it's fine to me, I mean your change doesn't change functionality
> but code placement.
>
> Pick my r-b for this:
>
> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Thanks for the reviews, pushed to igt.
BR,
Jani.
>
> --
> Zbigniew
>
>>
>> >
>> >
>> > BR,
>> > Jani.
>> >
>> >>
>> >> --
>> >> Zbigniew
>> >>
>> >>> eb.batch_start_offset =
>> >>> ((uint64_t)eb.batch_start_offset * range) >> 32;
>> >>> eb.batch_start_offset = ALIGN(eb.batch_start_offset, 64);
>> >>> --
>> >>> 2.47.3
>> >>>
>>
>> --
>> Jani Nikula, Intel
--
Jani Nikula, Intel
next prev parent reply other threads:[~2026-06-25 9:34 UTC|newest]
Thread overview: 20+ 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-19 5:17 ` Zbigniew Kempczyński
2026-06-22 7:36 ` Jani Nikula
2026-06-24 8:03 ` Jani Nikula
2026-06-25 9:00 ` Zbigniew Kempczyński
2026-06-25 9:34 ` Jani Nikula [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
2026-06-19 1:34 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-06-19 23:04 ` ✗ i915.CI.Full: " 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=79e99fc4f138d3287683749b83225822f2406f21@intel.com \
--to=jani.nikula@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=zbigniew.kempczynski@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