diff options
author | Roman Stratiienko <roman.o.stratiienko@globallogic.com> | 2021-10-28 15:52:38 +0300 |
---|---|---|
committer | Roman Stratiienko <roman.o.stratiienko@globallogic.com> | 2021-11-10 19:30:54 +0200 |
commit | 0ee8f58b93a037c5a54bb0a05c12228845a70a76 (patch) | |
tree | b50599506acf298c34e2121c9796357de48b027b /bufferinfo | |
parent | 1e053b4e1913beeddc74b423cbd3a753192822c0 (diff) | |
download | drm_hwcomposer-0ee8f58b93a037c5a54bb0a05c12228845a70a76.tar.gz |
drm_hwcomposer: Don't use Mapper@4 metadata API for legacy getters
As it turned out Mapper@4 metadata API calls are slow.
Allow using legacy getters again.
Closes: https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/-/issues/56
Signed-off-by: Roman Stratiienko <roman.o.stratiienko@globallogic.com>
Diffstat (limited to 'bufferinfo')
-rw-r--r-- | bufferinfo/BufferInfoGetter.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bufferinfo/BufferInfoGetter.cpp b/bufferinfo/BufferInfoGetter.cpp index 7f7f8ae..c284365 100644 --- a/bufferinfo/BufferInfoGetter.cpp +++ b/bufferinfo/BufferInfoGetter.cpp @@ -32,17 +32,17 @@ namespace android { BufferInfoGetter *BufferInfoGetter::GetInstance() { static std::unique_ptr<BufferInfoGetter> inst; - if (inst == nullptr) { -#if PLATFORM_SDK_VERSION >= 30 + if (!inst) { +#if PLATFORM_SDK_VERSION >= 30 && defined(USE_IMAPPER4_METADATA_API) inst.reset(BufferInfoMapperMetadata::CreateInstance()); - if (inst == nullptr) { + if (!inst) { ALOGW( "Generic buffer getter is not available. Falling back to legacy..."); + } #endif + if (!inst) { inst = LegacyBufferInfoGetter::CreateInstance(); -#if PLATFORM_SDK_VERSION >= 30 } -#endif } return inst.get(); |