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

Commit 720a7247 authored by Jaesoo Lee's avatar Jaesoo Lee
Browse files

configstore: removing BoardConfig variables (NUM_FRAMEBUFFER_SURFACE_BUFFERS)

This change removes the use of NUM_FRAMEBUFFER_SURFACE_BUFFERS from
SurfaceFlinger.

Instead of using it, the implementation is changed so that it retrieves
corresponding configuration value (useTripleFramebuffer) from
configstore.

Design doc: go/design-confighal
Bug: 34723491
Test: build, run, log message "SurfaceFlinger FrameBuffer: ?" should be seen.

Change-Id: If6f6d13738d894b4880f42576f4ce8220b4a8bef
parent 4351857c
Loading
Loading
Loading
Loading
+14 −3
Original line number Diff line number Diff line
@@ -47,6 +47,9 @@
#include "SurfaceFlinger.h"
#include "Layer.h"

#include <android/hardware/configstore/1.0/ISurfaceFlingerConfigs.h>
#include <configstore/Utils.h>

// ----------------------------------------------------------------------------
using namespace android;
// ----------------------------------------------------------------------------
@@ -57,6 +60,14 @@ static constexpr bool kEGLAndroidSwapRectangle = true;
static constexpr bool kEGLAndroidSwapRectangle = false;
#endif

// retrieve triple buffer setting from configstore
using namespace android::hardware::configstore;
using namespace android::hardware::configstore::V1_0;

static bool useTripleFramebuffer = getBool<
        ISurfaceFlingerConfigs,
        &ISurfaceFlingerConfigs::useTripleFramebuffer>(false);

#if !defined(EGL_EGLEXT_PROTOTYPES) || !defined(EGL_ANDROID_swap_rectangle)
// Dummy implementation in case it is missing.
inline void eglSetSwapRectangleANDROID (EGLDisplay, EGLSurface, EGLint, EGLint, EGLint, EGLint) {
@@ -165,9 +176,9 @@ DisplayDevice::DisplayDevice(
    // initialize the display orientation transform.
    setProjection(DisplayState::eOrientationDefault, mViewport, mFrame);

#ifdef NUM_FRAMEBUFFER_SURFACE_BUFFERS
    if (useTripleFramebuffer) {
        surface->allocateBuffers();
#endif
    }
}

DisplayDevice::~DisplayDevice() {