summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2017-07-04 23:08:27 +0200
committerAleksander Morgado <aleksander@aleksander.es>2017-07-05 10:08:22 +0200
commitf310a14e09fd587f47971de99b92e8a2bdbf46fa (patch)
treeb89cba1454f274538aab41ef63991898f2d757bd
parent07f1aed0dad760a501315f1a30c5c2c7ec0bc210 (diff)
downloadgbm_gralloc-f310a14e09fd587f47971de99b92e8a2bdbf46fa.tar.gz
Sync with the gbm API to import FD with modifier
Commit 4026744fcb31f1d27c1b32e6945aadd4da415c6d in mesa introduced an updated `struct gbm_import_fd_modifier_data' with arrays for fds, strides and offsets, instead of single values. Fix just by specifying one single item in the arrays. Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
-rw-r--r--gralloc_gbm.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/gralloc_gbm.cpp b/gralloc_gbm.cpp
index 990cc3f..8f9bfc4 100644
--- a/gralloc_gbm.cpp
+++ b/gralloc_gbm.cpp
@@ -118,10 +118,8 @@ static struct gralloc_gbm_bo_t *gbm_import(struct gbm_device *gbm,
return NULL;
}
- data.fd = handle->prime_fd;
data.width = handle->width;
data.height = handle->height;
- data.stride = handle->stride;
data.format = format;
/* Adjust the width and height for a GBM GR88 buffer */
if (handle->format == HAL_PIXEL_FORMAT_YV12) {
@@ -130,9 +128,14 @@ static struct gralloc_gbm_bo_t *gbm_import(struct gbm_device *gbm,
}
#ifdef GBM_BO_IMPORT_FD_MODIFIER
+ data.num_fds = 1;
+ data.fds[0] = handle->prime_fd;
+ data.strides[0] = handle->stride;
data.modifier = handle->modifier;
buf->bo = gbm_bo_import(gbm, GBM_BO_IMPORT_FD_MODIFIER, &data, 0);
#else
+ data.fd = handle->prime_fd;
+ data.stride = handle->stride;
buf->bo = gbm_bo_import(gbm, GBM_BO_IMPORT_FD, &data, 0);
#endif
if (!buf->bo) {