From e5a81ac70431502bc592c05e4ae639c0504ec816 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 24 Jan 2018 14:23:01 +1100 Subject: [PATCH] broadcom/vc5: Don't forget to get the BO offset when opening a dmabuf. Fixes black display in DRI due to storing to 0x00000000. --- src/gallium/drivers/vc5/vc5_bufmgr.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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); -- 2.30.2