On Wed, 22 Feb 2012 20:29:19 +0100, Ben Widawsky ben@bwidawsk.net wrote:
- mutex_lock(&dev->prime_mutex);
- /* First check that we don't dup on this file */
- ret = drm_prime_lookup_fd_handle_mapping(&file_priv->prime, dma_buf,
handle);
The other example of importing bo we have already in GEM is through the use of flink and global names. There we create a new handle every time a process opens a name, and de-duplication is indeed handled in userspace if it so desires.
Multiple handles pointing to the same object simplifies the code without risking kernel integrity, so why bother with kernel de-dupe? And allow userspace the extra bit of freedom to shoot itself in the foot! -Chris