search for: virtio_dma_buf_ops

Displaying 6 results from an estimated 6 matches for "virtio_dma_buf_ops".

2020 Jun 04
2
[PATCH v4 1/3] virtio: add dma-buf support for exported objects
...+} > +EXPORT_SYMBOL(virtio_dma_buf_export); > + > +/** > + * virtio_dma_buf_attach - mandatory attach callback for virtio dma-bufs > + */ > +int virtio_dma_buf_attach(struct dma_buf *dma_buf, > + struct dma_buf_attachment *attach) > +{ > + int ret; > + const struct virtio_dma_buf_ops *ops = container_of( > + dma_buf->ops, const struct virtio_dma_buf_ops, ops); > + > + if (ops->device_attach) { > + ret = ops->device_attach(dma_buf, attach); > + if (ret) > + return ret; > + } > + return 0; > +} > +EXPORT_SYMBOL(virtio_dma_buf_attach);...
2020 Jun 04
2
[PATCH v4 1/3] virtio: add dma-buf support for exported objects
...+} > +EXPORT_SYMBOL(virtio_dma_buf_export); > + > +/** > + * virtio_dma_buf_attach - mandatory attach callback for virtio dma-bufs > + */ > +int virtio_dma_buf_attach(struct dma_buf *dma_buf, > + struct dma_buf_attachment *attach) > +{ > + int ret; > + const struct virtio_dma_buf_ops *ops = container_of( > + dma_buf->ops, const struct virtio_dma_buf_ops, ops); > + > + if (ops->device_attach) { > + ret = ops->device_attach(dma_buf, attach); > + if (ret) > + return ret; > + } > + return 0; > +} > +EXPORT_SYMBOL(virtio_dma_buf_attach);...
2020 Sep 10
0
[PATCH v7 1/3] virtio: add dma-buf support for exported objects
...ight (C) 2020 Google, Inc. > + */ > + > +#include <linux/virtio_dma_buf.h> > + > +/** > + * virtio_dma_buf_export - Creates a new dma-buf for a virtio exported object > + * @exp_info: [in] see dma_buf_export(). ops MUST refer to a dma_buf_ops > + * struct embedded in a virtio_dma_buf_ops. > + * > + * This wraps dma_buf_export() to allow virtio drivers to create a dma-buf > + * for an virtio exported object that can be queried by other virtio drivers > + * for the object's UUID. > + */ > +struct dma_buf *virtio_dma_buf_export > + (const struct dma_buf_export...
2020 Jun 19
0
[PATCH v4 1/3] virtio: add dma-buf support for exported objects
...ach callback for virtio dma-bufs > > > > + */ > > > > +int virtio_dma_buf_attach(struct dma_buf *dma_buf, > > > > + struct dma_buf_attachment *attach) > > > > +{ > > > > + int ret; > > > > + const struct virtio_dma_buf_ops *ops = container_of( > > > > + dma_buf->ops, const struct virtio_dma_buf_ops, ops); > > > > + > > > > + if (ops->device_attach) { > > > > + ret = ops->device_attach(dma_buf, attach); > > > > +...
2020 Aug 18
0
[PATCH v6 0/3] Support virtio cross-device resources
...xport( -:112: CHECK:OPEN_ENDED_LINE: Lines should not end with a '(' #112: FILE: drivers/virtio/virtio_dma_buf.c:19: +struct dma_buf *virtio_dma_buf_export( -:115: CHECK:OPEN_ENDED_LINE: Lines should not end with a '(' #115: FILE: drivers/virtio/virtio_dma_buf.c:22: + const struct virtio_dma_buf_ops *virtio_ops = container_of( -:119: CHECK:LOGICAL_CONTINUATIONS: Logical continuations should be on the previous line #119: FILE: drivers/virtio/virtio_dma_buf.c:26: + if (!exp_info->ops + || exp_info->ops->attach != &virtio_dma_buf_attach -:120: CHECK:LOGICAL_CONTINUATIONS: Logical...
2020 Jun 08
0
[PATCH v4 1/3] virtio: add dma-buf support for exported objects
...on. But really this is just unnecessary complexity anyway. The only difference with dma_buf is get_uuid and device_attacj, isn't it? And they are called like this: + */ +int virtio_dma_buf_get_uuid(struct dma_buf *dma_buf, + uuid_t *uuid) +{ + const struct virtio_dma_buf_ops *ops = container_of( + dma_buf->ops, const struct virtio_dma_buf_ops, ops); + + if (!is_virtio_dma_buf(dma_buf)) + return -EINVAL; + + return ops->get_uuid(dma_buf, uuid); +} So you are doing the container_of trick anyway, the extra str...