We want to use the same buffer from camera to JPEG hardware encoder so
align the height of camera usage buffer 16 that is required by the JPEG
hardware encoder.
BUG=b:
141516308
TEST=Check if data offset is correct. Take picture with CCA.
Change-Id: I0db10762494423f7c4a340725015839803b40af4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/
1984211
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Hsu Wei-Cheng <mojahsu@chromium.org>
Commit-Queue: Hsu Wei-Cheng <mojahsu@chromium.org>
drv_bo_from_format_and_padding(bo, stride, aligned_height, format, padding);
} else {
+#ifdef MTK_MT8183
+ /*
+ * JPEG Encoder Accelerator requires 16x16 alignment. We want the buffer
+ * from camera can be put in JEA directly so align the height to 16
+ * bytes.
+ */
+ if (format == DRM_FORMAT_NV12)
+ height = ALIGN(height, 16);
+#endif
drv_bo_from_format(bo, stride, height, format);
}