summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Stratiienko <roman.stratiienko@globallogic.com>2020-01-23 18:17:41 +0200
committerRoman Stratiienko <roman.stratiienko@globallogic.com>2020-01-24 16:25:53 +0200
commitb2f2baeb9db0d0f4cbc0cac3184058d3fce85ea6 (patch)
treec1c663876f8221ce8d63e3239d6d94b4fe2afd79
parent309570872cb989d5530d7a7a60ac0d9d5581f056 (diff)
drm_hwcomposer: Extract more BO data by Imagination importer
Fields bo->hal_format and bo->pixel_stride should be set to pass validation by Mapper HAL v2.1 and v3.0. Otherwise UI is missing and the following message appears in the logcat: ``` 2576 E GraphicBufferMapper: validateBufferSize(0xe663b3637400) failed: 7 2576 E hwc-drm-utils: Failed to import buffer handle err: 7 2576 E hwc-drm-two: Failed to import layer, ret=7 ``` Also copy suballocs data for future usage. Fixes: e3ed48d728aa ("drm_hwcomposer: Add Imagination platform support") Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
-rw-r--r--platform/platformimagination.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/platform/platformimagination.cpp b/platform/platformimagination.cpp
index ea34ecc..63d8130 100644
--- a/platform/platformimagination.cpp
+++ b/platform/platformimagination.cpp
@@ -37,8 +37,15 @@ int ImaginationImporter::ConvertBoInfo(buffer_handle_t handle,
bo->width = hnd->iWidth;
bo->height = hnd->iHeight;
bo->usage = hnd->usage;
- bo->prime_fds[0] = hnd->fd[0];
- bo->pitches[0] = ALIGN(hnd->iWidth, HW_ALIGN) * hnd->uiBpp >> 3;
+ bo->hal_format = hnd->iFormat;
+ bo->pixel_stride = hnd->aiStride[0];
+
+ int sub = std::min(hnd->iNumSubAllocs, HWC_DRM_BO_MAX_PLANES);
+ for (int i = 0; i < sub; i++) {
+ bo->prime_fds[i] = hnd->fd[i];
+ bo->offsets[i] = hnd->aulPlaneOffset[i];
+ bo->pitches[i] = ALIGN(hnd->iWidth, HW_ALIGN) * hnd->uiBpp >> 3;
+ }
switch (hnd->iFormat) {
#ifdef HAL_PIXEL_FORMAT_BGRX_8888