All of lore.kernel.org
 help / color / mirror / Atom feed
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: Mon, 22 Jun 2026 10:36:31 +0300	[thread overview]
Message-ID: <af243a66da77bb294c3c985233f3decbf1b86b89@intel.com> (raw)
In-Reply-To: <f4zbjx4zch4c5c3m6ihqwkkw4ysm6rjkyjb24qkeoc6644lnhj@vk5kpqt4kljl>

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.


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

  reply	other threads:[~2026-06-22  7:37 UTC|newest]

Thread overview: 17+ 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 [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=af243a66da77bb294c3c985233f3decbf1b86b89@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 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.