DO NOT MERGE: drm_hwcomposer: Use Planner interface to provision planes
Use the new Planner interface to handle the layer->plane mapping.
This allows us to simplify the Plan() function by offloading the
plane provisioning to the platform specific code.
BUG=b/28117135
TEST=Tested on ryu with a variety of window layouts/workloads
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Change-Id: I75a0c5d87a9096e7a83ecbc848c75fee42ee1131
diff --git a/drmcomposition.cpp b/drmcomposition.cpp
index 72f00f1..1aaf920 100644
--- a/drmcomposition.cpp
+++ b/drmcomposition.cpp
@@ -20,6 +20,7 @@
#include "drmcrtc.h"
#include "drmplane.h"
#include "drmresources.h"
+#include "platform.h"
#include <stdlib.h>
@@ -30,8 +31,9 @@
namespace android {
-DrmComposition::DrmComposition(DrmResources *drm, Importer *importer)
- : drm_(drm), importer_(importer) {
+DrmComposition::DrmComposition(DrmResources *drm, Importer *importer,
+ Planner *planner)
+ : drm_(drm), importer_(importer), planner_(planner) {
char use_overlay_planes_prop[PROPERTY_VALUE_MAX];
property_get("hwc.drm.use_overlay_planes", use_overlay_planes_prop, "1");
bool use_overlay_planes = atoi(use_overlay_planes_prop);
@@ -56,7 +58,8 @@
// If the display hasn't been modeset yet, this will be NULL
DrmCrtc *crtc = drm_->GetCrtcForDisplay(display);
- int ret = composition_map_[display]->Init(drm_, crtc, importer_, frame_no);
+ int ret = composition_map_[display]->Init(drm_, crtc, importer_, planner_,
+ frame_no);
if (ret) {
ALOGE("Failed to init display composition for %d", display);
return ret;