am dd57d551: Merge "SurfaceFlinger: make the num FBs a board config" into jb-mr1-dev
* commit 'dd57d551944c01394bc2807d962be4953c58c7c1':
SurfaceFlinger: make the num FBs a board config
diff --git a/services/surfaceflinger/Android.mk b/services/surfaceflinger/Android.mk
index 0d559e7..5a57697 100644
--- a/services/surfaceflinger/Android.mk
+++ b/services/surfaceflinger/Android.mk
@@ -38,6 +38,10 @@
LOCAL_CFLAGS += -DTARGET_DISABLE_TRIPLE_BUFFERING
endif
+ifneq ($(NUM_FRAMEBUFFER_SURFACE_BUFFERS),)
+ LOCAL_CFLAGS += -DNUM_FRAMEBUFFER_SURFACE_BUFFERS=$(NUM_FRAMEBUFFER_SURFACE_BUFFERS)
+endif
+
LOCAL_SHARED_LIBRARIES := \
libcutils \
libdl \
diff --git a/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp b/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp
index 9ada197..6c86a53 100644
--- a/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp
+++ b/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp
@@ -36,6 +36,10 @@
#include "DisplayHardware/GraphicBufferAlloc.h"
#include "DisplayHardware/HWComposer.h"
+#ifndef NUM_FRAMEBUFFER_SURFACE_BUFFERS
+#define NUM_FRAMEBUFFER_SURFACE_BUFFERS (2)
+#endif
+
// ----------------------------------------------------------------------------
namespace android {
// ----------------------------------------------------------------------------
@@ -61,7 +65,7 @@
mBufferQueue->setDefaultBufferFormat(mHwc.getFormat(disp));
mBufferQueue->setDefaultBufferSize(mHwc.getWidth(disp), mHwc.getHeight(disp));
mBufferQueue->setSynchronousMode(true);
- mBufferQueue->setDefaultMaxBufferCount(NUM_FRAME_BUFFERS);
+ mBufferQueue->setDefaultMaxBufferCount(NUM_FRAMEBUFFER_SURFACE_BUFFERS);
}
status_t FramebufferSurface::nextBuffer(sp<GraphicBuffer>& outBuffer, sp<Fence>& outFence) {
diff --git a/services/surfaceflinger/DisplayHardware/FramebufferSurface.h b/services/surfaceflinger/DisplayHardware/FramebufferSurface.h
index d64fea7..6336345 100644
--- a/services/surfaceflinger/DisplayHardware/FramebufferSurface.h
+++ b/services/surfaceflinger/DisplayHardware/FramebufferSurface.h
@@ -22,8 +22,6 @@
#include <gui/ConsumerBase.h>
-#define NUM_FRAME_BUFFERS 2
-
// ---------------------------------------------------------------------------
namespace android {
// ---------------------------------------------------------------------------