[PATCH 06/34] drm: Add a simple linear congruent generator PRNG

Chris Wilson chris at chris-wilson.co.uk
Tue Dec 13 20:50:04 UTC 2016


On Tue, Dec 13, 2016 at 09:39:06PM +0200, Laurent Pinchart wrote:
> Hello,
> 
> On Tuesday 13 Dec 2016 16:16:41 David Herrmann wrote:
> > On Mon, Dec 12, 2016 at 12:53 PM, Chris Wilson wrote:
> > > For testing, we want a reproducible PRNG, a plain linear congruent
> > > generator is suitable for our very limited selftests.
> > > 
> > > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> 
> This doesn't seem very DRM-specific, is there a reason why we can't use the 
> ansi_cprng already present in the kernel ?

That would be a nightmare to drag in a crypto dependency, for what
should be a 5 cycle function. However, I will replace the Hars-Petruska
lcg for prandom (from lib/random32.c). That meets the requirement of
being a seeded PRNG.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the dri-devel mailing list