Re: [Mesa-dev] [PATCH 2/3] util/rand_xor: add function to seed rand

2017-03-21 Thread Timothy Arceri
On 22/03/17 05:53, Grazvydas Ignotas wrote: On Tue, Mar 21, 2017 at 10:57 AM, Timothy Arceri wrote: --- src/gallium/drivers/radeon/r600_test_dma.c | 3 +- src/util/rand_xor.c| 62 -- src/util/rand_xor.h| 6 ++- 3 f

Re: [Mesa-dev] [PATCH 2/3] util/rand_xor: add function to seed rand

2017-03-21 Thread Grazvydas Ignotas
On Tue, Mar 21, 2017 at 10:57 AM, Timothy Arceri wrote: > --- > src/gallium/drivers/radeon/r600_test_dma.c | 3 +- > src/util/rand_xor.c| 62 > -- > src/util/rand_xor.h| 6 ++- > 3 files changed, 64 insertions(+), 7 de

Re: [Mesa-dev] [PATCH 2/3] util/rand_xor: add function to seed rand

2017-03-21 Thread Timothy Arceri
On 21/03/17 21:07, Nicolai Hähnle wrote: Thanks, but this is now not thread-safe. I'm not sure how much we should care about that, but anyway, as I see it there are three options: 1) Add some kind of locking. 2) Make the caller provide a struct for the state (similar to rand_r). 3) Ignore the

Re: [Mesa-dev] [PATCH 2/3] util/rand_xor: add function to seed rand

2017-03-21 Thread Nicolai Hähnle
Thanks, but this is now not thread-safe. I'm not sure how much we should care about that, but anyway, as I see it there are three options: 1) Add some kind of locking. 2) Make the caller provide a struct for the state (similar to rand_r). 3) Ignore the issue and add a fat warning comment about i

[Mesa-dev] [PATCH 2/3] util/rand_xor: add function to seed rand

2017-03-21 Thread Timothy Arceri
--- src/gallium/drivers/radeon/r600_test_dma.c | 3 +- src/util/rand_xor.c| 62 -- src/util/rand_xor.h| 6 ++- 3 files changed, 64 insertions(+), 7 deletions(-) diff --git a/src/gallium/drivers/radeon/r600_test_dma.c b