Re: [Mesa-dev] [PATCH] intel: Track known prime buffers for re-use

2013-11-26 Thread Daniel Vetter
On Mon, Nov 25, 2013 at 01:22:41PM -0800, Keith Packard wrote: 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

Re: [Mesa-dev] [PATCH] intel: Track known prime buffers for re-use

2013-11-26 Thread Keith Packard
Daniel Vetter dan...@ffwll.ch writes: The kernel actually doesn't bother with this, i.e. an open on an flink name will always create a new handle. Given that it was a major pita to get the prime reimporting going (due to a pile of funny lifetime issues around reference loops and some assorted

Re: [Mesa-dev] [PATCH] intel: Track known prime buffers for re-use

2013-11-25 Thread Daniel Vetter
On Fri, Nov 22, 2013 at 05:35:54AM -0800, Keith Packard wrote: 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

Re: [Mesa-dev] [PATCH] intel: Track known prime buffers for re-use

2013-11-25 Thread Keith Packard
Daniel Vetter dan...@ffwll.ch writes: Yeah, it unfortunately took a few rounds of kernel fixes and other haggling to get the semantics right on this one. The kernel atm promises to userspace (minus one big in a racy corner case no one should care about, still need to fix that one) that it'll

[Mesa-dev] [PATCH] intel: Track known prime buffers for re-use

2013-11-25 Thread Keith Packard
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

[Mesa-dev] [PATCH] intel: Track known prime buffers for re-use

2013-11-22 Thread Keith Packard
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.