[Freedreno] [PATCH libdrm 3/4] freedreno: get bo size for imported dma-buf
Varad Gautam
varadgautam at gmail.com
Fri Aug 21 09:44:35 PDT 2015
Signed-off-by: Varad Gautam <varadgautam at gmail.com>
---
freedreno/freedreno_bo.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/freedreno/freedreno_bo.c b/freedreno/freedreno_bo.c
index eabffe9..596bfbc 100644
--- a/freedreno/freedreno_bo.c
+++ b/freedreno/freedreno_bo.c
@@ -237,8 +237,9 @@ fd_bo_from_dmabuf(struct fd_device *dev, int fd)
return NULL;
}
- /* hmm, would be nice if we had a way to figure out the size.. */
- size = 0;
+ /* lseek() to get bo size */
+ size = lseek(fd, 0, SEEK_END);
+ lseek(fd, 0, SEEK_CUR);
bo = fd_bo_from_handle(dev, req.handle, size);
bo->fd = fd;
--
2.4.6
More information about the Freedreno
mailing list