diff options
author | Gurchetan Singh <gurchetansingh@chromium.org> | 2016-08-19 16:26:46 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-08-25 01:44:59 -0700 |
commit | b72badb6c83a497b299873136e37435261b174ad (patch) | |
tree | 94ff885273652308a91770b2ef8b24c306202979 /gbm.c | |
parent | 83dc4fb6e4de05d683ddc044445aa4a80ad32efe (diff) |
minigbm: Added support for multiplane import
Gralloc requires flexible YUV formats (YV12, NV12) to be importable.
This change modifies our internal import API to support this.
TEST=ran graphics_Gbm
BUG=chromium:616275
CQ-DEPEND=CL:373048
Change-Id: I4100e1c1639828e4adf08764b45fe5a44b7078a3
Reviewed-on: https://chromium-review.googlesource.com/374162
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Diffstat (limited to 'gbm.c')
-rw-r--r-- | gbm.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -170,11 +170,20 @@ gbm_bo_import(struct gbm_device *gbm, uint32_t type, if (!bo) return NULL; - drv_data.fd = fd_data->fd; + /* + * Minigbm only supports importing single-plane formats at moment. + * If multi-plane import is desired, the interface will have to be + * modified. + */ + + memset(&drv_data, 0, sizeof(drv_data)); + drv_data.fds[0] = fd_data->fd; + drv_data.strides[0] = fd_data->stride; + drv_data.offsets[0] = 0; + drv_data.sizes[0] = fd_data->height * fd_data->stride; drv_data.width = fd_data->width; drv_data.height = fd_data->height; drv_data.format = gbm_convert_format(fd_data->format); - drv_data.stride = fd_data->stride; bo->bo = drv_bo_import(gbm->drv, &drv_data); |