summaryrefslogtreecommitdiff
path: root/drmdisplaycomposition.cpp
diff options
context:
space:
mode:
authorZach Reizner <zachr@google.com>2015-07-31 15:12:44 -0700
committerZach Reizner <zachr@google.com>2015-08-07 15:49:33 -0700
commit713a6788528d4cc4cd477b2f546c8b922beb6dde (patch)
tree6bd39b93a08a71ce7cf5f392c4254e68671ad78e /drmdisplaycomposition.cpp
parentcbe9c01336e23a63259db65d22d63d6a697b8813 (diff)
downloaddrm_hwcomposer-713a6788528d4cc4cd477b2f546c8b922beb6dde.tar.gz
drm_hwcomposer-713a6788528d4cc4cd477b2f546c8b922beb6dde.tar.xz
Revert "Revert "drm_hwcomposer: have DrmDisplayCompositor do its own OpenGL composition""
This reverts commit cbe9c01336e23a63259db65d22d63d6a697b8813.
Diffstat (limited to 'drmdisplaycomposition.cpp')
-rw-r--r--drmdisplaycomposition.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/drmdisplaycomposition.cpp b/drmdisplaycomposition.cpp
index cce1d56..21a9c2a 100644
--- a/drmdisplaycomposition.cpp
+++ b/drmdisplaycomposition.cpp
@@ -112,6 +112,28 @@ int DrmDisplayComposition::AddLayer(hwc_layer_1_t *layer, hwc_drm_bo_t *bo,
return 0;
}
+int DrmDisplayComposition::AddLayer(hwc_layer_1_t *layer, DrmCrtc *crtc,
+ DrmPlane *plane) {
+ if (layer->transform != 0)
+ return -EINVAL;
+
+ if (!validate_composition_type(DRM_COMPOSITION_TYPE_FRAME))
+ return -EINVAL;
+
+ hwc_drm_bo_t bo;
+ int ret = importer_->ImportBuffer(layer->handle, &bo);
+ if (ret) {
+ ALOGE("Failed to import handle of layer %d", ret);
+ return ret;
+ }
+
+ ret = AddLayer(layer, &bo, crtc, plane);
+ if (ret)
+ importer_->ReleaseBuffer(&bo);
+
+ return ret;
+}
+
int DrmDisplayComposition::AddDpmsMode(uint32_t dpms_mode) {
if (!validate_composition_type(DRM_COMPOSITION_TYPE_DPMS))
return -EINVAL;