Create max acquired buffer for framebuffer for SF

Change-Id: I502cfea9e03943c2f2bb353e71cfd860b2797fd5
This commit is contained in:
Fabien Sanglard 2017-03-10 15:37:07 -08:00
parent 4caea7b92d
commit 3d9f5ad284
4 changed files with 21 additions and 17 deletions

View file

@ -40,8 +40,6 @@ interface ISurfaceFlingerConfigs {
vsyncEventPhaseOffsetNs() generates (OptionalInt64 value);
vsyncSfEventPhaseOffsetNs() generates (OptionalInt64 value);
useTripleFramebuffer() generates (OptionalBool value);
/*
* Instruct the Render Engine to use EGL_IMG_context_priority hint if
* availabe.
@ -104,4 +102,10 @@ interface ISurfaceFlingerConfigs {
* return true for full vr support.
*/
useVrFlinger() generates (OptionalBool value);
/*
* Controls the number of buffers SurfaceFlinger will allocate for use in
* FramebufferSurface.
*/
maxFrameBufferAcquiredBuffers() generates(OptionalInt64 value);
};

View file

@ -29,16 +29,6 @@ Return<void> SurfaceFlingerConfigs::vsyncSfEventPhaseOffsetNs(vsyncEventPhaseOff
return Void();
}
Return<void> SurfaceFlingerConfigs::useTripleFramebuffer(useTripleFramebuffer_cb _hidl_cb) {
bool value = false;
#ifdef USE_TRIPLE_FRAMEBUFFER
value = true;
#endif
_hidl_cb({true, value});
LOG(INFO) << "SurfaceFlinger FrameBuffer: " << (value ? "triple" : "double");
return Void();
}
Return<void> SurfaceFlingerConfigs::useContextPriority(useContextPriority_cb _hidl_cb) {
#ifdef USE_CONTEXT_PRIORITY
_hidl_cb({true, USE_CONTEXT_PRIORITY});
@ -49,6 +39,16 @@ Return<void> SurfaceFlingerConfigs::useContextPriority(useContextPriority_cb _hi
return Void();
}
Return<void> SurfaceFlingerConfigs::maxFrameBufferAcquiredBuffers(maxFrameBufferAcquiredBuffers_cb _hidl_cb) {
#ifdef NUM_FRAMEBUFFER_SURFACE_BUFFERS
_hidl_cb({true, NUM_FRAMEBUFFER_SURFACE_BUFFERS});
LOG(INFO) << "SurfaceFlinger FrameBuffer max acquired buffers : " << NUM_FRAMEBUFFER_SURFACE_BUFFERS;
#else
_hidl_cb({false, 0});
#endif
return Void();
}
Return<void> SurfaceFlingerConfigs::hasWideColorDisplay(hasWideColorDisplay_cb _hidl_cb) {
bool value = false;
#ifdef HAS_WIDE_COLOR_DISPLAY

View file

@ -26,7 +26,6 @@ struct SurfaceFlingerConfigs : public ISurfaceFlingerConfigs {
// Methods from ::android::hardware::configstore::V1_0::ISurfaceFlingerConfigs follow.
Return<void> vsyncEventPhaseOffsetNs(vsyncEventPhaseOffsetNs_cb _hidl_cb) override;
Return<void> vsyncSfEventPhaseOffsetNs(vsyncEventPhaseOffsetNs_cb _hidl_cb) override;
Return<void> useTripleFramebuffer(useTripleFramebuffer_cb _hidl_cb) override;
Return<void> useContextPriority(useContextPriority_cb _hidl_cb) override;
Return<void> hasWideColorDisplay(hasWideColorDisplay_cb _hidl_cb) override;
Return<void> hasHDRDisplay(hasHDRDisplay_cb _hidl_cb) override;
@ -35,6 +34,7 @@ struct SurfaceFlingerConfigs : public ISurfaceFlingerConfigs {
Return<void> maxVirtualDisplaySize(maxVirtualDisplaySize_cb _hidl_cb) override;
Return<void> hasSyncFramework(hasSyncFramework_cb _hidl_cb) override;
Return<void> useVrFlinger(useVrFlinger_cb _hidl_cb) override;
Return<void> maxFrameBufferAcquiredBuffers(maxFrameBufferAcquiredBuffers_cb _hidl_cb) override;
// Methods from ::android::hidl::base::V1_0::IBase follow.

View file

@ -9,10 +9,6 @@ ifneq ($(SF_VSYNC_EVENT_PHASE_OFFSET_NS),)
LOCAL_CFLAGS += -DSF_VSYNC_EVENT_PHASE_OFFSET_NS=$(SF_VSYNC_EVENT_PHASE_OFFSET_NS)
endif
ifeq ($(NUM_FRAMEBUFFER_SURFACE_BUFFERS),3)
LOCAL_CFLAGS += -DUSE_TRIPLE_FRAMEBUFFER
endif
ifeq ($(TARGET_BOARD_PLATFORM),omap4)
LOCAL_CFLAGS += -DUSE_CONTEXT_PRIORITY=1
endif
@ -50,3 +46,7 @@ endif
ifneq ($(USE_VR_FLINGER),)
LOCAL_CFLAGS += -DUSE_VR_FLINGER
endif
ifneq ($(NUM_FRAMEBUFFER_SURFACE_BUFFERS),)
LOCAL_CFLAGS += -DNUM_FRAMEBUFFER_SURFACE_BUFFERS=$(NUM_FRAMEBUFFER_SURFACE_BUFFERS)
endif