summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Foss <robert.foss@collabora.com>2016-11-09 18:49:59 -0500
committerRobert Foss <robert.foss@collabora.com>2017-03-22 14:38:44 -0400
commit11676ef0438667b8a7b31943d17e1e267dc640a0 (patch)
treeaa90b1485da86953bc40c3499097e91becd646a2
parent38ce0ff6bba9d00e48c2061b29de4d95cf35e7a4 (diff)
downloaddrm_hwcomposer-11676ef0438667b8a7b31943d17e1e267dc640a0.tar.gz
drm_hwcomposer-11676ef0438667b8a7b31943d17e1e267dc640a0.tar.xz
drm_hwcomposer: Provide internal version of glworker Commit()
In order to decouple Commit() calls from the issuing thread, provide the internal _Commit() call to be enable it to be run on its own thread. Change-Id: I0c4823c94d6555566cbf7edbb83e12d0aedaf772 Sign-off-by: Robert Foss <robert.foss@collabora.com>
-rw-r--r--drmdisplaycompositor.cpp6
-rw-r--r--glworker.cpp9
-rw-r--r--glworker.h9
3 files changed, 21 insertions, 3 deletions
diff --git a/drmdisplaycompositor.cpp b/drmdisplaycompositor.cpp
index 92bbfd6..2ba6f70 100644
--- a/drmdisplaycompositor.cpp
+++ b/drmdisplaycompositor.cpp
@@ -295,7 +295,8 @@ int DrmDisplayCompositor::ApplySquash(DrmDisplayComposition *display_comp) {
std::vector<DrmCompositionRegion> &regions = display_comp->squash_regions();
ret = pre_compositor_->Composite(display_comp->layers().data(),
- regions.data(), regions.size(), fb.buffer(),
+ regions.data(), regions.size(),
+ &squash_framebuffers_[squash_framebuffer_index_],
display_comp->importer());
pre_compositor_->Finish();
@@ -329,7 +330,8 @@ int DrmDisplayCompositor::ApplyPreComposite(
std::vector<DrmCompositionRegion> &regions = display_comp->pre_comp_regions();
ret = pre_compositor_->Composite(display_comp->layers().data(),
- regions.data(), regions.size(), fb.buffer(),
+ regions.data(), regions.size(),
+ &framebuffers_[framebuffer_index_],
display_comp->importer());
pre_compositor_->Finish();
diff --git a/glworker.cpp b/glworker.cpp
index c0966f3..00a4ceb 100644
--- a/glworker.cpp
+++ b/glworker.cpp
@@ -581,6 +581,15 @@ GLWorkerCompositor::~GLWorkerCompositor() {
int GLWorkerCompositor::Composite(DrmHwcLayer *layers,
DrmCompositionRegion *regions,
size_t num_regions,
+ DrmFramebuffer *framebuffer,
+ Importer *importer) {
+ return _Composite(layers, regions, num_regions,
+ framebuffer->buffer(), importer);
+}
+
+int GLWorkerCompositor::_Composite(DrmHwcLayer *layers,
+ DrmCompositionRegion *regions,
+ size_t num_regions,
const sp<GraphicBuffer> &framebuffer,
Importer *importer) {
ATRACE_CALL();
diff --git a/glworker.h b/glworker.h
index 26de55d..190ab3f 100644
--- a/glworker.h
+++ b/glworker.h
@@ -30,6 +30,7 @@
#include <ui/GraphicBuffer.h>
#include "autogl.h"
+#include "drmframebuffer.h"
namespace android {
@@ -43,7 +44,7 @@ class GLWorkerCompositor {
int Init();
int Composite(DrmHwcLayer *layers, DrmCompositionRegion *regions,
- size_t num_regions, const sp<GraphicBuffer> &framebuffer,
+ size_t num_regions, DrmFramebuffer *framebuffer,
Importer *importer);
void Finish();
@@ -71,6 +72,12 @@ class GLWorkerCompositor {
EGLSurface saved_egl_draw = EGL_NO_SURFACE;
} private_;
+ int _Composite(DrmHwcLayer *layers,
+ DrmCompositionRegion *regions,
+ size_t num_regions,
+ const sp<GraphicBuffer> &framebuffer,
+ Importer *importer);
+
int BeginContext();
int EndContext();