broadcom/vc5: Don't forget to get the BO offset when opening a dmabuf.

Fixes black display in DRI due to storing to 0x00000000.
This commit is contained in:
Eric Anholt 2018-01-24 14:23:01 +11:00
parent 314e9ee6c4
commit e5a81ac704
1 changed files with 12 additions and 0 deletions

View File

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