diff options
author | Roman Kiryanov <rkir@google.com> | 2023-05-10 21:25:01 -0700 |
---|---|---|
committer | Roman Kiryanov <rkir@google.com> | 2023-05-11 16:18:06 -0700 |
commit | 3f448e0f63be747d4f0a04a1e7efaa68c10e0ecf (patch) | |
tree | 65a56831cfe26d227103d4d0f73f8ccd33920537 | |
parent | 3a15976f326d878c658c1a527ed369414c9c4811 (diff) | |
download | goldfish-opengl-3f448e0f63be747d4f0a04a1e7efaa68c10e0ecf.tar.gz |
Revert "codecs: set cpu read and write usage for encoder and decoder"
the allocation usage bits must be configured outside
of gralloc.
This reverts commit 3a15976f326d878c658c1a527ed369414c9c4811.
Bug: 281549716
Test: atest CtsMediaV2TestCases
Change-Id: I90b9a84bbca6d8d461bb80232e3d421cd4a8536e
Signed-off-by: Roman Kiryanov <rkir@google.com>
-rw-r--r-- | system/hals/allocator3.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/system/hals/allocator3.cpp b/system/hals/allocator3.cpp index 3ff8c848..8a05abd9 100644 --- a/system/hals/allocator3.cpp +++ b/system/hals/allocator3.cpp @@ -27,7 +27,6 @@ #include "debug.h" const int kOMX_COLOR_FormatYUV420Planar = 19; -const int kC2_COLOR_FormatYCBCR_420_888 = 0x23; using ::android::hardware::hidl_handle; using ::android::hardware::hidl_vec; @@ -102,7 +101,7 @@ private: if (!descriptor.height) { RETURN_ERROR(Error3::UNSUPPORTED); } if (descriptor.layerCount != 1) { RETURN_ERROR(Error3::UNSUPPORTED); } - uint32_t usage = descriptor.usage; + const uint32_t usage = descriptor.usage; int bpp = 1; int glFormat = 0; @@ -113,7 +112,7 @@ private: EmulatorFrameworkFormat::GL_COMPATIBLE; PixelFormat format; - Error3 e = getBufferFormat(descriptor.format, &usage, &format); + Error3 e = getBufferFormat(descriptor.format, usage, &format); if (e != Error3::NONE) { ALOGE("%s:%d Unsupported format: frameworkFormat=%d, usage=%x", __func__, __LINE__, descriptor.format, usage); @@ -291,22 +290,19 @@ private: } } - static Error3 getBufferFormat(const PixelFormat frameworkFormat, uint32_t* pusage, + static Error3 getBufferFormat(const PixelFormat frameworkFormat, + const uint32_t usage, PixelFormat* format) { - uint32_t& usage = *pusage; if (frameworkFormat == PixelFormat::IMPLEMENTATION_DEFINED) { RETURN_ERROR(Error3::UNSUPPORTED); - } else if ((static_cast<int>(frameworkFormat) == kOMX_COLOR_FormatYUV420Planar || - static_cast<int>(frameworkFormat) == kC2_COLOR_FormatYCBCR_420_888) && - (usage & BufferUsage::VIDEO_DECODER)) { + } else if (static_cast<int>(frameworkFormat) == kOMX_COLOR_FormatYUV420Planar && + (usage & BufferUsage::VIDEO_DECODER)) { ALOGW("gralloc_alloc: Requested OMX_COLOR_FormatYUV420Planar, given " "YCbCr_420_888, taking experimental path. " "usage=%x", usage); *format = PixelFormat::YCBCR_420_888; - usage = static_cast<typeof(usage)>(usage | BufferUsage::CPU_READ_OFTEN); - usage = static_cast<typeof(usage)>(usage | BufferUsage::CPU_WRITE_OFTEN); RETURN(Error3::NONE); - } else { + } else { *format = frameworkFormat; RETURN(Error3::NONE); } |