intel: Track known prime buffers for re-use
authorKeith Packard <keithp@keithp.com>
Fri, 22 Nov 2013 13:31:01 +0000 (05:31 -0800)
committerKeith Packard <keithp@keithp.com>
Wed, 27 Nov 2013 05:45:40 +0000 (21:45 -0800)
commitc3d96897de647bd5f6d4802c108a3f65a307d61b
tree2ee4277900b76fcaf328ebaf5ab6aed1f320172a
parentc8a437f4c76527b3c8385699ccee07f35fe3f166
 intel: Track known prime buffers for re-use

If the application sends us a file descriptor pointing at a prime
buffer that we've already got, we have to re-use the same bo_gem
structure or chaos will result.

Track the set of all known prime objects and look to see if the kernel
has returned one of those for a new file descriptor.

Also checks for prime buffers in the flink case.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
intel/intel_bufmgr_gem.c