diff options
-rw-r--r-- | freedreno/freedreno_bo.c | 5 |
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; |