> -----Original Message----- > From: Daniel Vetter <dan...@ffwll.ch> > Sent: Monday, November 30, 2020 6:58 AM > To: Xiong, Jianxin <jianxin.xi...@intel.com> > Cc: linux-r...@vger.kernel.org; dri-devel@lists.freedesktop.org; Leon > Romanovsky <l...@kernel.org>; Jason Gunthorpe <j...@ziepe.ca>; > Doug Ledford <dledf...@redhat.com>; Vetter, Daniel <daniel.vet...@intel.com>; > Christian Koenig <christian.koe...@amd.com> > Subject: Re: [PATCH rdma-core v3 4/6] pyverbs: Add dma-buf based MR support > > > +cdef class DmaBuf: > > + def __init__(self, size, unit=0): > > + """ > > + Allocate DmaBuf object from a GPU device. This is done through the > > + DRI device interface. Usually this requires the effective user id > > + being a member of the 'render' group. > > + :param size: The size (in number of bytes) of the buffer. > > + :param unit: The unit number of the GPU to allocate the buffer > > from. > > + :return: The newly created DmaBuf object on success. > > + """ > > + self.dmabuf_mrs = weakref.WeakSet() > > + self.dmabuf = dmabuf_alloc(size, unit) > > + if self.dmabuf == NULL: > > + raise PyverbsRDMAErrno(f'Failed to allocate dmabuf of size > > {size} on unit {unit}') > > + self.dri_fd = dmabuf_get_dri_fd(<dmabuf *>self.dmabuf) > > dri_fd seems unused by the tests
It's used by the read/write methods of the DmaBufMR class for performing mmap. _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel