drm_hwcomposer: Introduce Planner interface
This patch introduces a new Planner interface to the platform specific
code. This new interface will allow for platform-specific plane provisioning
decisions to cover various hardware quirks.
Each platform must provide a Planner with one or more PlanStage steps. These
stages are run in order and are used to move the given layers onto composition
planes.
There are two generic stages provided by the platform:
- Protected: Places layers on dedicated planes
- Greedy: Provisions as many layers to planes and sticks the rest in precomp
There is also one platform-specific stage included:
- ProtectedRotated: Places any protected & rotated layer on the primary plane
BUG=b/28117135
TEST=Tested on ryu with a variety of window layouts
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Change-Id: Ib6062ab4779166753afaf122450bb63126bf9161
diff --git a/platformnv.h b/platformnv.h
index 652409b..a9e5d39 100644
--- a/platformnv.h
+++ b/platformnv.h
@@ -19,6 +19,7 @@
#include "drmresources.h"
#include "platform.h"
+#include "platformdrmgeneric.h"
#include <stdatomic.h>
@@ -53,6 +54,23 @@
const gralloc_module_t *gralloc_;
};
+
+// This stage looks for any layers that contain transformed protected content
+// and puts it in the primary plane since Tegra doesn't support planar rotation
+// on the overlay planes.
+//
+// There are two caveats to this approach: 1- Protected content isn't
+// necessarily planar, but it's usually a safe bet, and 2- This doesn't catch
+// non-protected planar content. If we wanted to fix this, we'd need to import
+// the buffer in this stage and peek at it's format. The overhead of doing this
+// doesn't seem worth it since we'll end up displaying the right thing in both
+// cases anyways.
+class PlanStageProtectedRotated : public Planner::PlanStage {
+ public:
+ int ProvisionPlanes(std::vector<DrmCompositionPlane> *composition,
+ std::map<size_t, DrmHwcLayer *> &layers, DrmCrtc *crtc,
+ std::vector<DrmPlane *> *planes);
+};
}
#endif