drm_hwcomposer: add checks for tegra hardware limitation

Current approach is to allow atomic_check figure out any issues with
composition strategy and fallback to squash if there the atomic_check
fails. This leads to issues when there's a protected content as it
cannot be handled in squash.

Adding a new provisioning stage to check for hardware limitations and
address them early so a proper fall back can be in place.

Bug: 36731060
Change-Id: I6482953044bcea9c9a655f28672927b32ac57097
diff --git a/platformnv.h b/platformnv.h
index 678ccfa..3c1f49e 100644
--- a/platformnv.h
+++ b/platformnv.h
@@ -72,6 +72,19 @@
                       std::map<size_t, DrmHwcLayer *> &layers, DrmCrtc *crtc,
                       std::vector<DrmPlane *> *planes);
 };
+
+// This stage looks for layers that would not be supported by Tegra driver due
+// to limitations such as downscaling. If the layer is unprotected it will be
+// punted for precomp to handle, other wise if protected it will be dropped as
+// it cannot be supported by any means.
+class PlanStageNvLimits : public Planner::PlanStage {
+ public:
+  int ProvisionPlanes(std::vector<DrmCompositionPlane> *composition,
+                      std::map<size_t, DrmHwcLayer *> &layers, DrmCrtc *crtc,
+                      std::vector<DrmPlane *> *planes);
+ protected:
+  bool CheckLayer(DrmHwcLayer *layer);
+};
 }
 
 #endif