summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger/LayerBuffer.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-03-08 11:14:20 -0800
committerMathias Agopian <mathias@google.com>2010-03-08 11:14:20 -0800
commitfcfeb4b5970c8f361634429934a2518d7e8328dd (patch)
tree5a8337f84c6d707b28c9be732842555c622786d6 /libs/surfaceflinger/LayerBuffer.cpp
parent8addafe823381addbb8b9ca4edeca846fa13122f (diff)
downloadframeworks_native-fcfeb4b5970c8f361634429934a2518d7e8328dd.zip
frameworks_native-fcfeb4b5970c8f361634429934a2518d7e8328dd.tar.gz
frameworks_native-fcfeb4b5970c8f361634429934a2518d7e8328dd.tar.bz2
fixes for [2474091] Saw Poor behaviour playing a video.
- fix a bug when hacking video buffers into gralloc buffers where the buffer size was incorrect this was causing the "direct-form-texture" mode to fail - also when the above fails, make sure to revert to the "mdp copy mode" before going to "slow mode" - finally disable completely the "direct-from-texture" mode for now. It cannot work because the allocated buffers can't respect the GPU constraints (alignment and such). We'll have to find a solution for that.
Diffstat (limited to 'libs/surfaceflinger/LayerBuffer.cpp')
-rw-r--r--libs/surfaceflinger/LayerBuffer.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/libs/surfaceflinger/LayerBuffer.cpp b/libs/surfaceflinger/LayerBuffer.cpp
index 6d1685b..5c21593 100644
--- a/libs/surfaceflinger/LayerBuffer.cpp
+++ b/libs/surfaceflinger/LayerBuffer.cpp
@@ -261,7 +261,8 @@ sp<OverlayRef> LayerBuffer::SurfaceLayerBuffer::createOverlay(
// LayerBuffer::Buffer
// ============================================================================
-LayerBuffer::Buffer::Buffer(const ISurface::BufferHeap& buffers, ssize_t offset)
+LayerBuffer::Buffer::Buffer(const ISurface::BufferHeap& buffers,
+ ssize_t offset, size_t bufferSize)
: mBufferHeap(buffers), mSupportsCopybit(false)
{
NativeBuffer& src(mNativeBuffer);
@@ -280,7 +281,7 @@ LayerBuffer::Buffer::Buffer(const ISurface::BufferHeap& buffers, ssize_t offset)
if (module && module->perform) {
int err = module->perform(module,
GRALLOC_MODULE_PERFORM_CREATE_HANDLE_FROM_BUFFER,
- buffers.heap->heapID(), buffers.heap->getSize(),
+ buffers.heap->heapID(), bufferSize,
offset, buffers.heap->base(),
&src.img.handle);
@@ -415,7 +416,7 @@ void LayerBuffer::BufferSource::postBuffer(ssize_t offset)
sp<Buffer> buffer;
if (buffers.heap != 0) {
- buffer = new LayerBuffer::Buffer(buffers, offset);
+ buffer = new LayerBuffer::Buffer(buffers, offset, mBufferSize);
if (buffer->getStatus() != NO_ERROR)
buffer.clear();
setBuffer(buffer);
@@ -469,6 +470,11 @@ void LayerBuffer::BufferSource::onDraw(const Region& clip) const
if (mLayer.mFlags & DisplayHardware::DIRECT_TEXTURE) {
err = INVALID_OPERATION;
if (ourBuffer->supportsCopybit()) {
+
+ // there are constraints on buffers used by the GPU and these may not
+ // be honored here. We need to change the API so the buffers
+ // are allocated with gralloc. For now disable this code-path
+#if 0
// First, try to use the buffer as an EGLImage directly
if (mUseEGLImageDirectly) {
// NOTE: Assume the buffer is allocated with the proper USAGE flags
@@ -483,6 +489,8 @@ void LayerBuffer::BufferSource::onDraw(const Region& clip) const
mUseEGLImageDirectly = false;
}
}
+#endif
+
copybit_device_t* copybit = mLayer.mBlitEngine;
if (copybit && err != NO_ERROR) {
// create our EGLImageKHR the first time