summaryrefslogtreecommitdiff
path: root/gbm.c
diff options
context:
space:
mode:
authorStéphane Marchesin <marcheu@chromium.org>2016-03-11 22:01:35 -0800
committerchrome-bot <chrome-bot@chromium.org>2016-03-12 03:41:45 -0800
commite04c9b50d4f50ed661f06db883e77c8b56acf386 (patch)
tree0219687758ae266a35c2c292214a1ed267b64994 /gbm.c
parent5ecebea7df338a31a4bf44d5f885830d1efe0eff (diff)
minigbm: Fill sizes[0] in gbm_bo_import
We need to give useable sizes to imported buffers, not just the ones we create. BUG=chromium:592681 TEST=run the test on lumpy Change-Id: Ife99988600607e2f4a56bbad37b48c21829701dd Reviewed-on: https://chromium-review.googlesource.com/332448 Commit-Ready: Stéphane Marchesin <marcheu@chromium.org> Tested-by: Stéphane Marchesin <marcheu@chromium.org> Reviewed-by: Ilja Friedel <ihf@chromium.org> Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Diffstat (limited to 'gbm.c')
-rw-r--r--gbm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gbm.c b/gbm.c
index b38ba9c..671fec0 100644
--- a/gbm.c
+++ b/gbm.c
@@ -269,11 +269,12 @@ gbm_bo_import(struct gbm_device *gbm, uint32_t type,
return NULL;
bo = gbm_bo_new(gbm, fd_data->width, fd_data->height, fd_data->format);
- bo->strides[0] = fd_data->stride;
-
if (!bo)
return NULL;
+ bo->strides[0] = fd_data->stride;
+ bo->sizes[0] = fd_data->height * fd_data->stride;
+
prime_handle.fd = fd_data->fd;
ret = drmIoctl(bo->gbm->fd, DRM_IOCTL_PRIME_FD_TO_HANDLE, &prime_handle);