diff options
author | Manoj Kumar AVM <manojavm@codeaurora.org> | 2016-01-13 19:10:20 -0800 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-03-13 03:28:46 -0700 |
commit | 65a4c0c045185e8bf5ad54ef8db2a3dbbf6c2813 (patch) | |
tree | 053a723a6d9c79a30811f877c62738e804555160 | |
parent | a9cbaf5097c089372cf152401007d70bcb13a95d (diff) | |
download | frameworks_native-65a4c0c045185e8bf5ad54ef8db2a3dbbf6c2813.zip frameworks_native-65a4c0c045185e8bf5ad54ef8db2a3dbbf6c2813.tar.gz frameworks_native-65a4c0c045185e8bf5ad54ef8db2a3dbbf6c2813.tar.bz2 |
vds: Allocate Framebuffer target buffer
Increase frame buffer surface buffers to 3. Call allocateBuffers
from the producer so that buffers are allocated. With out this,
BufferQueue implementation will only allocate 1 buffer
CRs-Fixed: 930504
@Buganizer: 26778657
Change-Id: Id0cadeb78957273d670d63f9956a09454b45eb69
-rw-r--r-- | services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp index 1e4f907..5fd2136 100644 --- a/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp +++ b/services/surfaceflinger/DisplayHardware/VirtualDisplaySurface.cpp @@ -19,6 +19,7 @@ #include "HWComposer.h" #include <gui/BufferItem.h> +#include <gui/Surface.h> // --------------------------------------------------------------------------- namespace android { @@ -30,6 +31,10 @@ static const bool sForceHwcCopy = true; static const bool sForceHwcCopy = false; #endif +#ifndef NUM_FRAMEBUFFER_SURFACE_BUFFERS +#define NUM_FRAMEBUFFER_SURFACE_BUFFERS (2) +#endif + #define VDS_LOGE(msg, ...) ALOGE("[%s] " msg, \ mDisplayName.string(), ##__VA_ARGS__) #define VDS_LOGW_IF(cond, msg, ...) ALOGW_IF(cond, "[%s] " msg, \ @@ -64,6 +69,7 @@ VirtualDisplaySurface::VirtualDisplaySurface(HWComposer& hwc, int32_t dispId, { mSource[SOURCE_SINK] = sink; mSource[SOURCE_SCRATCH] = bqProducer; + sp<Surface> surface(new Surface(bqProducer, false)); resetPerFrameState(); @@ -92,7 +98,9 @@ VirtualDisplaySurface::VirtualDisplaySurface(HWComposer& hwc, int32_t dispId, mConsumer->setConsumerName(ConsumerBase::mName); mConsumer->setConsumerUsageBits(GRALLOC_USAGE_HW_COMPOSER); mConsumer->setDefaultBufferSize(sinkWidth, sinkHeight); - mConsumer->setDefaultMaxBufferCount(2); + mConsumer->setDefaultMaxBufferCount(NUM_FRAMEBUFFER_SURFACE_BUFFERS); + + surface->allocateBuffers(); } VirtualDisplaySurface::~VirtualDisplaySurface() { |