OSDN Git Service

msm: Don't height align R8, height 1 buffers used for camera output
authorJeffrey Kardatzke <jkardatzke@google.com>
Fri, 21 Feb 2020 23:35:01 +0000 (15:35 -0800)
committerCommit Bot <commit-bot@chromium.org>
Tue, 25 Feb 2020 08:01:05 +0000 (08:01 +0000)
We height align to multiples of 64 and the camera will create a height
one buffer of length 13MB for JPEG output with R8 format. If we see R8
format with height 1, then don't do the height alignment.

BUG=b:148152367
TEST=Camera app works on trogdor

Change-Id: I6e4260f37cc45fe3b7e9bd132844cbde4a58fc26
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2066796
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Jeffrey Kardatzke <jkardatzke@google.com>
Auto-Submit: Jeffrey Kardatzke <jkardatzke@google.com>
Commit-Queue: Jeffrey Kardatzke <jkardatzke@google.com>

msm.c

diff --git a/msm.c b/msm.c
index d902968..6a1a3de 100644 (file)
--- a/msm.c
+++ b/msm.c
@@ -105,8 +105,11 @@ static void msm_calculate_layout(struct bo *bo)
                uint32_t stride, alignw, alignh;
 
                alignw = ALIGN(width, DEFAULT_ALIGNMENT);
-               /* HAL_PIXEL_FORMAT_YV12 requires that the buffer's height not be aligned. */
-               if (bo->meta.format == DRM_FORMAT_YVU420_ANDROID) {
+               /* HAL_PIXEL_FORMAT_YV12 requires that the buffer's height not be aligned.
+                       DRM_FORMAT_R8 of height one is used for JPEG camera output, so don't
+                       height align that. */
+               if (bo->meta.format == DRM_FORMAT_YVU420_ANDROID ||
+                                               (bo->meta.format == DRM_FORMAT_R8 && height == 1)) {
                        alignh = height;
                } else {
                        alignh = ALIGN(height, DEFAULT_ALIGNMENT);