summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-01-24 14:23:01 +1100
committerEric Anholt <[email protected]>2018-01-27 19:40:14 +1100
commite5a81ac70431502bc592c05e4ae639c0504ec816 (patch)
treec3815d3b582ab8c9e36ddddcbdcfef8e54496c75 /src/gallium
parent314e9ee6c4367942cccb9da9b01a67d0f8e29819 (diff)
broadcom/vc5: Don't forget to get the BO offset when opening a dmabuf.
Fixes black display in DRI due to storing to 0x00000000.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/vc5/vc5_bufmgr.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc5/vc5_bufmgr.c b/src/gallium/drivers/vc5/vc5_bufmgr.c
index c6c06dcfda7..5e068400fd8 100644
--- a/src/gallium/drivers/vc5/vc5_bufmgr.c
+++ b/src/gallium/drivers/vc5/vc5_bufmgr.c
@@ -348,6 +348,18 @@ vc5_bo_open_handle(struct vc5_screen *screen,
bo->name = "winsys";
bo->private = false;
+ struct drm_vc5_get_bo_offset get = {
+ .handle = handle,
+ };
+ int ret = vc5_ioctl(screen->fd, DRM_IOCTL_VC5_GET_BO_OFFSET, &get);
+ if (ret) {
+ fprintf(stderr, "Failed to get BO offset: %s\n",
+ strerror(errno));
+ free(bo);
+ return NULL;
+ }
+ bo->offset = get.offset;
+
#ifdef USE_VC5_SIMULATOR
vc5_simulator_open_from_handle(screen->fd, winsys_stride,
bo->handle, bo->size);