Merge "graphics: improve preloading for IMapper default impl" am: 960c33c599 am: 697fddee77

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2459229

Change-Id: Ic2e20f6e616a121a43053fd935e79bce26d7b538
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Chia-I Wu 2023-02-28 19:53:59 +00:00 committed by Automerger Merge Worker
commit 227a9f4155
2 changed files with 16 additions and 0 deletions

View file

@ -19,6 +19,14 @@
using android::hardware::graphics::mapper::V2_0::IMapper;
using android::hardware::graphics::mapper::V2_0::passthrough::GrallocLoader;
// Preload the gralloc module such that GraphicBufferMapper::preloadHal is
// meaningful
class GrallocPreloader {
public:
GrallocPreloader() { GrallocLoader::loadModule(); }
};
static GrallocPreloader sGrallocPreloader;
extern "C" IMapper* HIDL_FETCH_IMapper(const char* /*name*/) {
return GrallocLoader::load();
}

View file

@ -19,6 +19,14 @@
using android::hardware::graphics::mapper::V2_1::IMapper;
using android::hardware::graphics::mapper::V2_1::passthrough::GrallocLoader;
// Preload the gralloc module such that GraphicBufferMapper::preloadHal is
// meaningful
class GrallocPreloader {
public:
GrallocPreloader() { GrallocLoader::loadModule(); }
};
static GrallocPreloader sGrallocPreloader;
extern "C" IMapper* HIDL_FETCH_IMapper(const char* /*name*/) {
return GrallocLoader::load();
}