DisplayHardware/HWComposer_hwc1.cpp
endif
-ifneq ($(NUM_FRAMEBUFFER_SURFACE_BUFFERS),)
- LOCAL_CFLAGS += -DNUM_FRAMEBUFFER_SURFACE_BUFFERS=$(NUM_FRAMEBUFFER_SURFACE_BUFFERS)
-endif
-
LOCAL_CFLAGS += -fvisibility=hidden -Werror=format
LOCAL_HEADER_LIBRARIES := \
using namespace android::hardware::configstore;
using namespace android::hardware::configstore::V1_0;
-static bool useTripleFramebuffer = getBool<
- ISurfaceFlingerConfigs,
- &ISurfaceFlingerConfigs::useTripleFramebuffer>(false);
+static bool useTripleFramebuffer = getInt64< ISurfaceFlingerConfigs,
+ &ISurfaceFlingerConfigs::maxFrameBufferAcquiredBuffers>(2) == 3;
#if !defined(EGL_EGLEXT_PROTOTYPES) || !defined(EGL_ANDROID_swap_rectangle)
// Dummy implementation in case it is missing.
#include "FramebufferSurface.h"
#include "HWComposer.h"
-
-#ifndef NUM_FRAMEBUFFER_SURFACE_BUFFERS
-#define NUM_FRAMEBUFFER_SURFACE_BUFFERS (2)
-#endif
+#include "../SurfaceFlinger.h"
// ----------------------------------------------------------------------------
namespace android {
mConsumer->setDefaultBufferFormat(mHwc.getFormat(disp));
mConsumer->setDefaultBufferSize(mHwc.getWidth(disp), mHwc.getHeight(disp));
#endif
- mConsumer->setMaxAcquiredBufferCount(NUM_FRAMEBUFFER_SURFACE_BUFFERS - 1);
+ mConsumer->setMaxAcquiredBufferCount(
+ SurfaceFlinger::maxFrameBufferAcquiredBuffers - 1);
}
status_t FramebufferSurface::beginFrame(bool /*mustRecompose*/) {
uint64_t SurfaceFlinger::maxVirtualDisplaySize;
bool SurfaceFlinger::hasSyncFramework;
bool SurfaceFlinger::useVrFlinger;
+int64_t SurfaceFlinger::maxFrameBufferAcquiredBuffers;
SurfaceFlinger::SurfaceFlinger()
: BnSurfaceComposer(),
useVrFlinger = getBool< ISurfaceFlingerConfigs,
&ISurfaceFlingerConfigs::useVrFlinger>(false);
+ maxFrameBufferAcquiredBuffers = getInt64< ISurfaceFlingerConfigs,
+ &ISurfaceFlingerConfigs::maxFrameBufferAcquiredBuffers>(2);
+
// debugging stuff...
char value[PROPERTY_VALUE_MAX];
result.appendFormat(" FORCE_HWC_FOR_RBG_TO_YUV=%d", useHwcForRgbToYuv);
result.appendFormat(" MAX_VIRT_DISPLAY_DIM=%" PRIu64, maxVirtualDisplaySize);
result.appendFormat(" RUNNING_WITHOUT_SYNC_FRAMEWORK=%d", !hasSyncFramework);
+ result.appendFormat(" NUM_FRAMEBUFFER_SURFACE_BUFFERS=%" PRId64,
+ maxFrameBufferAcquiredBuffers);
result.append("]");
}
// Equal to min(max_height, max_width).
static uint64_t maxVirtualDisplaySize;
+ // Controls the number of buffers SurfaceFlinger will allocate for use in
+ // FramebufferSurface
+ static int64_t maxFrameBufferAcquiredBuffers;
+
static char const* getServiceName() ANDROID_API {
return "SurfaceFlinger";
}
bool SurfaceFlinger::useHwcForRgbToYuv;
uint64_t SurfaceFlinger::maxVirtualDisplaySize;
bool SurfaceFlinger::hasSyncFramework;
+int64_t SurfaceFlinger::maxFrameBufferAcquiredBuffers;
SurfaceFlinger::SurfaceFlinger()
: BnSurfaceComposer(),
useHwcForRgbToYuv = getBool< ISurfaceFlingerConfigs,
&ISurfaceFlingerConfigs::useHwcForRGBtoYUV>(false);
+ maxFrameBufferAcquiredBuffers = getInt64< ISurfaceFlingerConfigs,
+ &ISurfaceFlingerConfigs::maxFrameBufferAcquiredBuffers>(2);
+
char value[PROPERTY_VALUE_MAX];
property_get("ro.bq.gpu_to_cpu_unsupported", value, "0");
result.appendFormat(" FORCE_HWC_FOR_RBG_TO_YUV=%d", useHwcForRgbToYuv);
result.appendFormat(" MAX_VIRT_DISPLAY_DIM=%" PRIu64, maxVirtualDisplaySize);
result.appendFormat(" RUNNING_WITHOUT_SYNC_FRAMEWORK=%d", !hasSyncFramework);
+ result.appendFormat(" NUM_FRAMEBUFFER_SURFACE_BUFFERS=%" PRId64,
+ maxFrameBufferAcquiredBuffers);
result.append("]");
}