OSDN Git Service

Force 3DComposition when DISABLE_OVERLAY_USAGE is enabled.
authorKalyan Kondapally <kalyan.kondapally@intel.com>
Tue, 7 Mar 2017 19:23:17 +0000 (11:23 -0800)
committerKalyan Kondapally <kalyan.kondapally@intel.com>
Tue, 7 Mar 2017 19:24:56 +0000 (11:24 -0800)
In this case we might not have all the support needed for Atomic
Test commits. Lets keep it simple and fallback to 3D composition
in this case.

Jira: None.
Test: No regressions on Android.
Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
common/display/displayplanemanager.cpp

index 6364392..437ff44 100644 (file)
@@ -145,7 +145,6 @@ std::tuple<bool, DisplayPlaneStateList> DisplayPlaneManager::ValidateLayers(
   auto layer_begin = layers->begin();
   auto layer_end = layers->end();
   bool render_layers = false;
-  bool force_gpu = false;
 #ifndef DISABLE_OVERLAY_USAGE
   // Check if the combination of layers is same as last frame
   // and if so check if we can use the result of last validation.
@@ -159,11 +158,6 @@ std::tuple<bool, DisplayPlaneStateList> DisplayPlaneManager::ValidateLayers(
   // Dont use cache next frame if we are doing modeset now. With modeset
   // we force all layers for 3D composition.
   use_cache_ = !pending_modeset;
-#else
-  // When overlay support is disabled, client should take care of blending
-  // all layers together and giving us the final output. If thats not
-  // the case lets handle it here.
-  force_gpu = layers->size() > 1;
 #endif
   // We start off with Primary plane.
   DisplayPlane *current_plane = primary_plane_.get();
@@ -174,7 +168,7 @@ std::tuple<bool, DisplayPlaneStateList> DisplayPlaneManager::ValidateLayers(
   ++layer_begin;
   // Lets ensure we fall back to GPU composition in case
   // primary layer cannot be scanned out directly.
-  if ((pending_modeset && layers->size() > 1) || force_gpu ||
+  if ((pending_modeset && layers->size() > 1) ||
       FallbacktoGPU(current_plane, primary_layer, commit_planes)) {
     DisplayPlaneState &last_plane = composition.back();
     render_layers = true;
@@ -498,6 +492,10 @@ void DisplayPlaneManager::ValidateCachedLayers(
 bool DisplayPlaneManager::FallbacktoGPU(
     DisplayPlane *target_plane, OverlayLayer *layer,
     const std::vector<OverlayPlane> &commit_planes) const {
+#ifdef DISABLE_OVERLAY_USAGE
+  return true;
+#endif
+
   if (!target_plane->ValidateLayer(layer))
     return true;