From 1cadc75d1d52ca98012e8236232ded26753e4c76 Mon Sep 17 00:00:00 2001 From: David Stevens Date: Fri, 3 Apr 2020 10:50:51 +0900 Subject: [PATCH] codec2: Fix linear gralloc blobs This fixes a rebase issue between f72774b and 2a24a30. Bug: 153120636 Test: Manually run ARC c2 e2e test app Change-Id: I68987ff27f43380e7ad149c2776830219c42dba9 --- media/codec2/vndk/C2AllocatorGralloc.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/media/codec2/vndk/C2AllocatorGralloc.cpp b/media/codec2/vndk/C2AllocatorGralloc.cpp index 3ac3d89fe4..e1e137776d 100644 --- a/media/codec2/vndk/C2AllocatorGralloc.cpp +++ b/media/codec2/vndk/C2AllocatorGralloc.cpp @@ -520,6 +520,22 @@ c2_status_t C2AllocationGralloc::map( break; } + case static_cast(PixelFormat4::BLOB): { + void *pointer = nullptr; + // TODO: fence + status_t err = GraphicBufferMapper::get().lock( + const_cast(mBuffer), grallocUsage, + { (int32_t)rect.left, (int32_t)rect.top, + (int32_t)rect.width, (int32_t)rect.height }, + &pointer); + if (err) { + ALOGE("failed transaction: lock(BLOB)"); + return C2_CORRUPTED; + } + *addr = (uint8_t *)pointer; + break; + } + case static_cast(PixelFormat4::YCBCR_420_888): // fall-through case static_cast(PixelFormat4::YV12):