OSDN Git Service

vc4: add hash table look-up for exported dmabufs
authorRob Herring <robh@kernel.org>
Fri, 22 Jul 2016 20:28:30 +0000 (15:28 -0500)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 1 Sep 2016 10:39:45 +0000 (11:39 +0100)
commitec686002800482a1370ee53cd2a951c9b713fc9e
treecdde6473d735d0a4b702eb5b64cc27ce14a97bf3
parent838c1cbde44ef991effe5af345ab095a9a7899a7
vc4: add hash table look-up for exported dmabufs

It is necessary to reuse existing BOs when dmabufs are imported. There
are 2 cases that need to be handled. dmabufs can be created/exported and
imported by the same process and can be imported multiple times.
Copying other drivers, add a hash table to track exported BOs so the
BOs get reused.

v2: Whitespace fixup (by anholt)

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 9ace2c13550609dfe78164f104500d438821f383)
src/gallium/drivers/vc4/vc4_bufmgr.c
src/gallium/drivers/vc4/vc4_bufmgr.h
src/gallium/drivers/vc4/vc4_screen.c
src/gallium/drivers/vc4/vc4_screen.h