drm_hwcomposer: Remove GL compositing support

The GL based compositing adds alot of complexity and was only ever well
tested on closed stacks. It also only supports GLES3.x and still relies
on sw_sync timeline which is now a debugfs feature. Those are just the
known issues.

Removing the GL compositor means everything related to squashing layers
and pre-compositing can be removed. The planner is left as it may be
useful when adding back support for overlay planes. With this change,
only a single plane is supported until ValidateDisplay learns to do
atomic modesetting test for overlay planes.

Tested-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
diff --git a/platform.cpp b/platform.cpp
index 62b03a8..b6c39d0 100644
--- a/platform.cpp
+++ b/platform.cpp
@@ -37,7 +37,7 @@
 }
 
 std::tuple<int, std::vector<DrmCompositionPlane>> Planner::ProvisionPlanes(
-    std::map<size_t, DrmHwcLayer *> &layers, bool use_squash_fb, DrmCrtc *crtc,
+    std::map<size_t, DrmHwcLayer *> &layers, DrmCrtc *crtc,
     std::vector<DrmPlane *> *primary_planes,
     std::vector<DrmPlane *> *overlay_planes) {
   std::vector<DrmCompositionPlane> composition;
@@ -48,30 +48,6 @@
     return std::make_tuple(-ENODEV, std::vector<DrmCompositionPlane>());
   }
 
-  // If needed, reserve the squash plane at the highest z-order
-  DrmPlane *squash_plane = NULL;
-  if (use_squash_fb) {
-    if (!planes.empty()) {
-      squash_plane = planes.back();
-      planes.pop_back();
-    } else {
-      ALOGI("Not enough planes to reserve for squash fb");
-    }
-  }
-
-  // If needed, reserve the precomp plane at the next highest z-order
-  DrmPlane *precomp_plane = NULL;
-  if (layers.size() > planes.size()) {
-    if (!planes.empty()) {
-      precomp_plane = planes.back();
-      planes.pop_back();
-      composition.emplace_back(DrmCompositionPlane::Type::kPrecomp,
-                               precomp_plane, crtc);
-    } else {
-      ALOGE("Not enough planes to reserve for precomp fb");
-    }
-  }
-
   // Go through the provisioning stages and provision planes
   for (auto &i : stages_) {
     int ret = i->ProvisionPlanes(&composition, layers, crtc, &planes);
@@ -81,10 +57,6 @@
     }
   }
 
-  if (squash_plane)
-    composition.emplace_back(DrmCompositionPlane::Type::kSquash, squash_plane,
-                             crtc);
-
   return std::make_tuple(0, std::move(composition));
 }
 
@@ -109,62 +81,6 @@
     i = layers.erase(i);
   }
 
-  if (protected_zorder == -1)
-    return 0;
-
-  // Add any layers below the protected content to the precomposition since we
-  // need to punch a hole through them.
-  for (auto i = layers.begin(); i != layers.end();) {
-    // Skip layers above the z-order of the protected content
-    if (i->first > static_cast<size_t>(protected_zorder)) {
-      ++i;
-      continue;
-    }
-
-    // If there's no precomp layer already queued, queue one now.
-    DrmCompositionPlane *precomp = GetPrecomp(composition);
-    if (precomp) {
-      precomp->source_layers().emplace_back(i->first);
-    } else {
-      if (!planes->empty()) {
-        DrmPlane *precomp_plane = planes->back();
-        planes->pop_back();
-        composition->emplace_back(DrmCompositionPlane::Type::kPrecomp,
-                                  precomp_plane, crtc, i->first);
-      } else {
-        ALOGE("Not enough planes to reserve for precomp fb");
-      }
-    }
-    i = layers.erase(i);
-  }
-  return 0;
-}
-
-int PlanStagePrecomp::ProvisionPlanes(
-    std::vector<DrmCompositionPlane> *composition,
-    std::map<size_t, DrmHwcLayer *> &layers, DrmCrtc * /*crtc*/,
-    std::vector<DrmPlane *> * /*planes*/) {
-  DrmCompositionPlane *precomp = GetPrecomp(composition);
-  if (!precomp || precomp->source_layers().empty())
-    return 0;
-
-  // Find lowest zorder out of precomp layers
-  size_t precomp_zorder = *std::min_element(
-      precomp->source_layers().begin(), precomp->source_layers().end(),
-      [](size_t a, size_t b) { return a < b; });
-
-  // if there are any remaining layers on top of any of the precomp layers,
-  // add them to precomp to avoid blending issues since precomp is always at
-  // highest zorder
-  for (auto i = layers.begin(); i != layers.end();) {
-    if (i->first < precomp_zorder) {
-      i++;
-      continue;
-    }
-    precomp->source_layers().emplace_back(i->first);
-    i = layers.erase(i);
-  }
-
   return 0;
 }
 
@@ -183,13 +99,6 @@
       ALOGE("Failed to emplace layer %zu, dropping it", i->first);
   }
 
-  // Put the rest of the layers in the precomp plane
-  DrmCompositionPlane *precomp = GetPrecomp(composition);
-  if (precomp) {
-    for (auto i = layers.begin(); i != layers.end(); i = layers.erase(i))
-      precomp->source_layers().emplace_back(i->first);
-  }
-
   return 0;
 }
 }