Skip to content

Commit

Permalink
xen/gntdev: Implement dma-buf export functionality
Browse files Browse the repository at this point in the history
1. Create a dma-buf from grant references provided by the foreign
   domain. By default dma-buf is backed by system memory pages, but
   by providing GNTDEV_DMA_FLAG_XXX flags it can also be created
   as a DMA write-combine/coherent buffer, e.g. allocated with
   corresponding dma_alloc_xxx API.
   Export the resulting buffer as a new dma-buf.

2. Implement waiting for the dma-buf to be released: block until the
   dma-buf with the file descriptor provided is released.
   If within the time-out provided the buffer is not released then
   -ETIMEDOUT error is returned. If the buffer with the file descriptor
   does not exist or has already been released, then -ENOENT is
   returned. For valid file descriptors this must not be treated as
   error.

3. Make gntdev's common code and structures available to dma-buf.

[boris: added 'args.fd = -1' to dmabuf_exp_from_refs() to avoid an
 unnecessary warning about it not being initialized on i386 with gcc 8.1.1]

Signed-off-by: Oleksandr Andrushchenko <[email protected]>
Reviewed-by: Boris Ostrovsky <[email protected]>
Signed-off-by: Boris Ostrovsky <[email protected]>
  • Loading branch information
Oleksandr Andrushchenko authored and Boris Ostrovsky committed Jul 27, 2018
1 parent 932d656 commit a240d6e
Showing 1 changed file with 453 additions and 3 deletions.
Loading

0 comments on commit a240d6e

Please sign in to comment.