summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHsin-Yi Wang <hsinyi@chromium.org>2022-03-25 17:50:35 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-03-31 11:34:43 +0000
commitc37de982401b9a09b3781d411c0e4857043e9c94 (patch)
tree4686be339f42502ee13a079b614cc73f17bfb031
parent4674c0ea746c719b1c10b72e529011cdce2d5fec (diff)
downloadminigbm-c37de982401b9a09b3781d411c0e4857043e9c94.tar.gz
minigbm: mediatek: use the HW_VIDEO_ENCODE padding for camera preview
Since CL:3515652, preview under photo mode no longer uses hw video encoder. This results in the wrong padding set in minigbm. Make camera preview mode to use the original padding by detecting the GRALLOC_USAGE_HW_COMPOSER (BO_USE_SCANOUT) flag. BUG=b:224698291 TEST=check camera preview on krane Change-Id: I299886a8f2106678f19ffff308331afec9627614 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3551188 Tested-by: Hsin-Yi Wang <hsinyi@chromium.org> Auto-Submit: Hsin-Yi Wang <hsinyi@chromium.org> Reviewed-by: Miguel Casas-Sanchez <mcasas@chromium.org> Reviewed-by: Miguel Casas <mcasas@google.com> Commit-Queue: Hsin-Yi Wang <hsinyi@chromium.org>
-rw-r--r--mediatek.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mediatek.c b/mediatek.c
index cd3e641..076f478 100644
--- a/mediatek.c
+++ b/mediatek.c
@@ -163,7 +163,7 @@ static int mediatek_bo_create_with_modifiers(struct bo *bo, uint32_t width, uint
stride = ALIGN(stride, 64);
#endif
- if (bo->meta.use_flags & BO_USE_HW_VIDEO_ENCODER) {
+ if (bo->meta.use_flags & (BO_USE_HW_VIDEO_ENCODER | BO_USE_SCANOUT)) {
uint32_t aligned_height = ALIGN(height, 32);
uint32_t padding[DRV_MAX_PLANES] = { 0 };