OSDN Git Service

drm_hwcomposer: Revert "drm_hwcomposer: Extract more BO data by Imagination importer"
authorJohn Stultz <john.stultz@linaro.org>
Tue, 4 Feb 2020 21:53:13 +0000 (21:53 +0000)
committerJohn Stultz <john.stultz@linaro.org>
Tue, 4 Feb 2020 22:04:09 +0000 (22:04 +0000)
This reverts commit b2f2baeb9db0d0f4cbc0cac3184058d3fce85ea6.

I'm trying to utilize a policy of lighter reviews w/ quick reverts
when there are issues to keep things moving. So with that in mind
I'm reverting "Extract more BO data by Imagination importer" since
its breaking the build in AOSP.

See:
  https://android-review.googlesource.com/c/platform/external/drm_hwcomposer/+/1225155/-1..1#message-828f83ed7fa89b3bdfff7b0b5b1dd7364c822892
  https://android-review.googlesource.com/c/platform/external/drm_hwcomposer/+/1225916

This breakage is due to the importer code being tightly tied to
the gralloc private handle definitions, which is a common problem
as the gralloc and drm_hwcomposers are separately maintained.
The beagle_x15 gralloc is apparently older, and doesn't have
the newly utilized fields.

So for now, revert this to stay in sync w/ AOSP. I'm happy to
re-apply as soon as a fix is in place which adds some sort of
versioning checks so hopefully drm_hwc can work with different
versions of the gralloc code.

Once users of the old gralloc code are updated, we can remove
such version checks if needed.

Change-Id: Ie72561061ea12cb58d3ba9616a62d05f4ffe78b0
Signed-off-by: John Stultz <john.stultz@linaro.org>
platform/platformimagination.cpp

index 63d8130..ea34ecc 100644 (file)
@@ -37,15 +37,8 @@ int ImaginationImporter::ConvertBoInfo(buffer_handle_t handle,
   bo->width = hnd->iWidth;
   bo->height = hnd->iHeight;
   bo->usage = hnd->usage;
-  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;
-  }
+  bo->prime_fds[0] = hnd->fd[0];
+  bo->pitches[0] = ALIGN(hnd->iWidth, HW_ALIGN) * hnd->uiBpp >> 3;
 
   switch (hnd->iFormat) {
 #ifdef HAL_PIXEL_FORMAT_BGRX_8888