tests/prime_nv_api: check multiple foreign imports with flink
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 15 Jul 2013 09:55:09 +0000 (11:55 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 16 Jul 2013 11:36:38 +0000 (13:36 +0200)
commit05cc515f3a9782fdf7e1553df61437db51625ea0
tree1b1de32eea985cdc949fdc94eb1c49e5e5598a59
parentd64a9458b26794cb85314a145581376cf128bc08
tests/prime_nv_api: check multiple foreign imports with flink

We want prime to only ever create one native gem object for each
dma-buf it sees. This can e.g. happen if multiple processes import the
same foreign dma-buf, e.g. the application imports a yuv frame from
v4l to encode it into a video stream and the compositor imports it
into his fd again to display it with an overlay.

Hence add a bunch of tests which check all the various orders in which
this could happen. Currently they all fail.

Checking flink names is the easiest (and afaik only) way to check
whether we're indeed dealing with the same object.

This checks both ways, i.e. exporting from i915 and from nouveau, each
with two variants of the test: One reuses the prime fd, the other
closes it and creates a new one.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
tests/prime_nv_api.c