[PATCH 4/7] lib: Add gem_userptr helpers

Daniel Vetter daniel at ffwll.ch
Tue Aug 25 00:47:46 PDT 2015

On Sun, Aug 23, 2015 at 01:10:42PM +0100, Chris Wilson wrote:
> On Wed, Aug 12, 2015 at 08:29:17PM -0300, Tiago Vignatti wrote:
> > This patch moves userptr definitions and helpers implementation that were
> > locally in gem_userptr_benchmark and gem_userptr_blits to the library, so other
> > tests can make use of them as well. There's no functional changes.
> We have a pattern in the helpers to use
> gem_userptr() as a no-fail (failures are detected and asserted upon
> inside the handler) and __gem_userptr() where the errno is passed back
> to the caller. Commonly when writing tests it is simpler to just get the
> handle back (and have the test fail appropriately otherwise) and doing
> negative parameter testing is rarer and so delegated to the
> __gem_ variant.

Also please add gtkdoc when adding new wrappers (and generally those doc
comments mention the distinction Chris raised).
Daniel Vetter
Software Engineer, Intel Corporation

More information about the dri-devel mailing list