summaryrefslogtreecommitdiff
path: root/freedreno
diff options
context:
space:
mode:
authorVarad Gautam <varadgautam@gmail.com>2015-08-21 22:14:35 +0530
committerRob Clark <robclark@freedesktop.org>2015-08-23 12:33:45 -0400
commit1eba47a76365576447d6346868a074dca24de1bf (patch)
treeb1545dad6094ee17098d9231204c27cd18fe3562 /freedreno
parent425c8e5af7e57d473cb94f1931baa427e58ef2f7 (diff)
freedreno: get bo size for imported dma-buf
Signed-off-by: Varad Gautam <varadgautam@gmail.com> Signed-off-by: Rob Clark <robclark@freedesktop.org>
Diffstat (limited to 'freedreno')
-rw-r--r--freedreno/freedreno_bo.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/freedreno/freedreno_bo.c b/freedreno/freedreno_bo.c
index eabffe93..596bfbc2 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;