From e04c9b50d4f50ed661f06db883e77c8b56acf386 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Marchesin?= Date: Fri, 11 Mar 2016 22:01:35 -0800 Subject: [PATCH] minigbm: Fill sizes[0] in gbm_bo_import MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Tested-by: Stéphane Marchesin Reviewed-by: Ilja Friedel Reviewed-by: Stéphane Marchesin --- gbm.c | 5 +++-- 1 file 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); -- 2.11.0