Use physical memory for software rendering to take a fast path through surface flinger if possible.
related-to-bug: 2386023
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include "../include/SoftwareRenderer.h"
|
||||
|
||||
#include <binder/MemoryHeapBase.h>
|
||||
#include <binder/MemoryHeapPmem.h>
|
||||
#include <media/stagefright/MediaDebug.h>
|
||||
#include <ui/ISurface.h>
|
||||
|
||||
@@ -38,8 +39,16 @@ SoftwareRenderer::SoftwareRenderer(
|
||||
mDecodedWidth(decodedWidth),
|
||||
mDecodedHeight(decodedHeight),
|
||||
mFrameSize(mDecodedWidth * mDecodedHeight * 2), // RGB565
|
||||
mMemoryHeap(new MemoryHeapBase(2 * mFrameSize)),
|
||||
mIndex(0) {
|
||||
// TODO: How do I allocate physical memory on Droid?
|
||||
mMemoryHeap = new MemoryHeapBase("/dev/pmem_adsp", 2 * mFrameSize);
|
||||
if (mMemoryHeap->heapID() < 0) {
|
||||
LOGI("Creating physical memory heap failed, reverting to regular heap.");
|
||||
mMemoryHeap = new MemoryHeapBase(2 * mFrameSize);
|
||||
} else {
|
||||
mMemoryHeap = new MemoryHeapPmem(mMemoryHeap);
|
||||
}
|
||||
|
||||
CHECK(mISurface.get() != NULL);
|
||||
CHECK(mDecodedWidth > 0);
|
||||
CHECK(mDecodedHeight > 0);
|
||||
|
||||
Reference in New Issue
Block a user