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>
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);