OSDN Git Service

cros_gralloc: Fix PlaneLayout width/height metadata
authorJason Macnak <natsu@google.com>
Tue, 27 Oct 2020 18:58:35 +0000 (11:58 -0700)
committerCommit Bot <commit-bot@chromium.org>
Wed, 28 Oct 2020 14:01:26 +0000 (14:01 +0000)
... by using the horizontal/vertical subsampling of
each plane.

BUG=b:171019648
TEST=vts -m VtsHalGraphicsMapperV4_0TargetTest

Change-Id: I3eccfa1c0ac30394314c83b54ca50d690c679724
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2503481
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Jason Macnak <natsu@google.com>
Auto-Submit: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>

cros_gralloc/gralloc4/CrosGralloc4Mapper.cc

index 7c85eff..0e26156 100644 (file)
@@ -504,8 +504,8 @@ Return<void> CrosGralloc4Mapper::get(cros_gralloc_handle_t crosHandle,
             planeLayout.offsetInBytes = crosHandle->offsets[plane];
             planeLayout.strideInBytes = crosHandle->strides[plane];
             planeLayout.totalSizeInBytes = crosHandle->sizes[plane];
-            planeLayout.widthInSamples = crosHandle->width;
-            planeLayout.heightInSamples = crosHandle->height;
+            planeLayout.widthInSamples = crosHandle->width / planeLayout.horizontalSubsampling;
+            planeLayout.heightInSamples = crosHandle->height / planeLayout.verticalSubsampling;
         }
 
         status = android::gralloc4::encodePlaneLayouts(planeLayouts, &encodedMetadata);