freedreno: get bo size for imported dma-buf

Signed-off-by: Varad Gautam <varadgautam@gmail.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
main
Varad Gautam 2015-08-21 22:14:35 +05:30 committed by Rob Clark
parent 425c8e5af7
commit 1eba47a763
1 changed files with 3 additions and 2 deletions

View File

@ -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;