Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09dfa20c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add GraphicBufferMapper::preloadHal"

parents 1e19f272 5dac7819
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

#define LOG_TAG "Gralloc2"

#include <hidl/ServiceManagement.h>
#include <hwbinder/IPCThreadState.h>
#include <ui/Gralloc2.h>

@@ -31,6 +32,10 @@ namespace Gralloc2 {

static constexpr Error kTransactionError = Error::NO_RESOURCES;

void Mapper::preload() {
    android::hardware::preloadPassthroughService<hardware::graphics::mapper::V2_0::IMapper>();
}

Mapper::Mapper()
{
    mMapper = IMapper::getService();
+4 −0
Original line number Diff line number Diff line
@@ -42,6 +42,10 @@ namespace android {

ANDROID_SINGLETON_STATIC_INSTANCE( GraphicBufferMapper )

void GraphicBufferMapper::preloadHal() {
    Gralloc2::Mapper::preload();
}

GraphicBufferMapper::GraphicBufferMapper()
  : mMapper(std::make_unique<const Gralloc2::Mapper>())
{
+2 −0
Original line number Diff line number Diff line
@@ -38,6 +38,8 @@ using hardware::graphics::mapper::V2_0::YCbCrLayout;
// A wrapper to IMapper
class Mapper {
public:
    static void preload();

    Mapper();

    Error createDescriptor(
+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ class Rect;
class GraphicBufferMapper : public Singleton<GraphicBufferMapper>
{
public:
    static void preloadHal();
    static inline GraphicBufferMapper& get() { return getInstance(); }

    // The imported outHandle must be freed with freeBuffer when no longer