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

Commit b3839ad8 authored by Peiyong Lin's avatar Peiyong Lin
Browse files

[RenderEngine] Remove ConfigStore from RenderEngine.

This patch removes ConfigStore dependency from RenderEngine.

BUG: 112585051
Test: Build, flash, boot and run display verification.
Change-Id: Ibbd0a90491fc9cd39927d15287cf4971a42df866
parent 9b68a25f
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -20,10 +20,6 @@ cc_defaults {
        "-DEGL_EGLEXT_PROTOTYPES",
    ],
    shared_libs: [
        "android.hardware.configstore-utils",
        "android.hardware.configstore@1.0",
        "android.hardware.configstore@1.1",
        "android.hardware.configstore@1.2",
        "libcutils",
        "libEGL",
        "libGLESv1_CM",
+2 −15
Original line number Diff line number Diff line
@@ -18,8 +18,6 @@

#include <vector>

#include <android/hardware/configstore/1.0/ISurfaceFlingerConfigs.h>
#include <configstore/Utils.h>
#include <log/log.h>
#include <private/gui/SyncFeatures.h>
#include <renderengine/Image.h>
@@ -32,8 +30,6 @@
#include "gl/GLExtensions.h"
#include "gl/ProgramCache.h"

using namespace android::hardware::configstore;
using namespace android::hardware::configstore::V1_0;
using namespace android::renderengine::gl;

extern "C" EGLAPI const char* eglQueryStringImplementationANDROID(EGLDisplay dpy, EGLint name);
@@ -82,7 +78,8 @@ std::unique_ptr<RenderEngine> RenderEngine::create(int hwcFormat, uint32_t featu
    contextAttributes.reserve(6);
    contextAttributes.push_back(EGL_CONTEXT_CLIENT_VERSION);
    contextAttributes.push_back(contextClientVersion);
    bool useContextPriority = overrideUseContextPriorityFromConfig(extensions.hasContextPriority());
    bool useContextPriority = extensions.hasContextPriority() &&
                              (featureFlags & RenderEngine::USE_HIGH_PRIORITY_CONTEXT);
    if (useContextPriority) {
        contextAttributes.push_back(EGL_CONTEXT_PRIORITY_LEVEL_IMG);
        contextAttributes.push_back(EGL_CONTEXT_PRIORITY_HIGH_IMG);
@@ -141,16 +138,6 @@ std::unique_ptr<RenderEngine> RenderEngine::create(int hwcFormat, uint32_t featu
    return engine;
}

bool RenderEngine::overrideUseContextPriorityFromConfig(bool useContextPriority) {
    OptionalBool ret;
    ISurfaceFlingerConfigs::getService()->useContextPriority([&ret](OptionalBool b) { ret = b; });
    if (ret.specified) {
        return ret.value;
    } else {
        return useContextPriority;
    }
}

RenderEngine::RenderEngine(uint32_t featureFlags)
      : mEGLDisplay(EGL_NO_DISPLAY),
        mEGLConfig(nullptr),
+1 −2
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ class RenderEngine {
public:
    enum FeatureFlag {
        USE_COLOR_MANAGEMENT = 1 << 0, // Device manages color
        USE_HIGH_PRIORITY_CONTEXT = 1 << 1, // Use high priority context
    };

    virtual ~RenderEngine() = 0;
@@ -169,8 +170,6 @@ protected:
    EGLContext mEGLContext;
    void setEGLHandles(EGLDisplay display, EGLConfig config, EGLContext ctxt);

    static bool overrideUseContextPriorityFromConfig(bool useContextPriority);

    RenderEngine(uint32_t featureFlags);

    const uint32_t mFeatureFlags;
+7 −1
Original line number Diff line number Diff line
@@ -196,6 +196,7 @@ int64_t SurfaceFlinger::maxFrameBufferAcquiredBuffers;
bool SurfaceFlinger::hasWideColorDisplay;
int SurfaceFlinger::primaryDisplayOrientation = DisplayState::eOrientationDefault;
bool SurfaceFlinger::useColorManagement;
bool SurfaceFlinger::useContextPriority;

std::string getHwcServiceName() {
    char value[PROPERTY_VALUE_MAX] = {};
@@ -324,6 +325,9 @@ SurfaceFlinger::SurfaceFlinger() : SurfaceFlinger(SkipInitialization) {
    useColorManagement =
            getBool<V1_2::ISurfaceFlingerConfigs, &V1_2::ISurfaceFlingerConfigs::useColorManagement>(false);

    useContextPriority = getBool<ISurfaceFlingerConfigs,
                                 &ISurfaceFlingerConfigs::useContextPriority>(true);

    V1_1::DisplayOrientation primaryDisplayOrientation =
        getDisplayOrientation< V1_1::ISurfaceFlingerConfigs, &V1_1::ISurfaceFlingerConfigs::primaryDisplayOrientation>(
            V1_1::DisplayOrientation::ORIENTATION_0);
@@ -645,6 +649,8 @@ void SurfaceFlinger::init() {
    int32_t renderEngineFeature = 0;
    renderEngineFeature |= (useColorManagement ?
                            renderengine::RenderEngine::USE_COLOR_MANAGEMENT : 0);
    renderEngineFeature |= (useContextPriority ?
                            renderengine::RenderEngine::USE_HIGH_PRIORITY_CONTEXT : 0);
    getBE().mRenderEngine = renderengine::impl::RenderEngine::create(HAL_PIXEL_FORMAT_RGBA_8888,
                                                                     renderEngineFeature);
    LOG_ALWAYS_FATAL_IF(getBE().mRenderEngine == nullptr, "couldn't create RenderEngine");
+2 −0
Original line number Diff line number Diff line
@@ -294,6 +294,8 @@ public:
    // Indicate if device wants color management on its display.
    static bool useColorManagement;

    static bool useContextPriority;

    static char const* getServiceName() ANDROID_API {
        return "SurfaceFlinger";
    }