summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/DisplayHardware/HWComposer.cpp
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2014-03-03 15:42:54 -0800
committerJesse Hall <jessehall@google.com>2014-03-11 12:23:14 -0700
commit399184a4cd728ea1421fb0bc1722274a29e38f4a (patch)
tree7185bc1ac84eec1afebc221ed91d90b90fa9a7fb /services/surfaceflinger/DisplayHardware/HWComposer.cpp
parent05fe2d1cfbf580c04ef1b1f0130b5dccba6dfe33 (diff)
downloadframeworks_native-399184a4cd728ea1421fb0bc1722274a29e38f4a.zip
frameworks_native-399184a4cd728ea1421fb0bc1722274a29e38f4a.tar.gz
frameworks_native-399184a4cd728ea1421fb0bc1722274a29e38f4a.tar.bz2
Add sideband streams to BufferQueue and related classes
Sideband streams are essentially a device-specific buffer queue that bypasses the BufferQueue system. They can be used for situations with hard real-time requirements like high-quality TV and video playback with A/V sync. A handle to the stream is provided by the source HAL, and attached to a BufferQueue. The sink HAL can read buffers via the stream handle rather than acquiring individual buffers from the BufferQueue. Change-Id: Ib3f262eddfc520f4bbe3d9b91753ed7dd09d3a9b
Diffstat (limited to 'services/surfaceflinger/DisplayHardware/HWComposer.cpp')
-rw-r--r--services/surfaceflinger/DisplayHardware/HWComposer.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
index 474f633..0ca93c8 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
@@ -25,6 +25,7 @@
#include <utils/Errors.h>
#include <utils/misc.h>
+#include <utils/NativeHandle.h>
#include <utils/String8.h>
#include <utils/Thread.h>
#include <utils/Trace.h>
@@ -942,12 +943,22 @@ public:
SharedBuffer const* sb = reg.getSharedBuffer(&visibleRegion.numRects);
visibleRegion.rects = reinterpret_cast<hwc_rect_t const *>(sb->data());
}
+ virtual void setSidebandStream(const sp<NativeHandle>& stream) {
+ ALOG_ASSERT(stream->handle() != NULL);
+ getLayer()->compositionType = HWC_SIDEBAND;
+ getLayer()->sidebandStream = stream->handle();
+ }
virtual void setBuffer(const sp<GraphicBuffer>& buffer) {
if (buffer == 0 || buffer->handle == 0) {
getLayer()->compositionType = HWC_FRAMEBUFFER;
getLayer()->flags |= HWC_SKIP_LAYER;
getLayer()->handle = 0;
} else {
+ if (getLayer()->compositionType == HWC_SIDEBAND) {
+ // If this was a sideband layer but the stream was removed, reset
+ // it to FRAMEBUFFER. The HWC can change it to OVERLAY in prepare.
+ getLayer()->compositionType = HWC_FRAMEBUFFER;
+ }
getLayer()->handle = buffer->handle;
}
}