Merge remote-tracking branch 'aosp/upstream-master' into HEAD

Merge in upstream-master branch from freedesktop.

This syncs the AOSP tree completely with the upstream
branch - with the exception of the OWNERS file.

Change-Id: If87394e44fcec163daddcd51d7f7a451d49aec8c
Signed-off-by: John Stultz <john.stultz@linaro.org>
diff --git a/Android.mk b/Android.mk
index a2fe0ef..d5ee200 100644
--- a/Android.mk
+++ b/Android.mk
@@ -77,9 +77,6 @@
 
 LOCAL_CFLAGS := $(common_drm_hwcomposer_cflags)
 
-# Suppress warnings until they are fixed in drmhwctwo.cpp
-LOCAL_CFLAGS += -Wno-error=implicit-fallthrough
-
 LOCAL_CPPFLAGS += \
 	-DHWC2_USE_CPP11 \
 	-DHWC2_INCLUDE_STRINGIFICATION
diff --git a/drmhwctwo.cpp b/drmhwctwo.cpp
index cd79e7b..cf4ec11 100644
--- a/drmhwctwo.cpp
+++ b/drmhwctwo.cpp
@@ -745,18 +745,11 @@
 
   for (std::pair<const hwc2_layer_t, DrmHwcTwo::HwcLayer> &l : layers_) {
     DrmHwcTwo::HwcLayer &layer = l.second;
-    switch (layer.sf_type()) {
-      case HWC2::Composition::Device:
-        if (layer.validated_type() == HWC2::Composition::Device)
-          break;
-      // fall thru
-      case HWC2::Composition::SolidColor:
-      case HWC2::Composition::Cursor:
-      case HWC2::Composition::Sideband:
-      default:
-        layer.set_validated_type(HWC2::Composition::Client);
-        ++*num_types;
-        break;
+    // We can only handle layers of Device type, send everything else to SF
+    if (layer.sf_type() != HWC2::Composition::Device ||
+        layer.validated_type() != HWC2::Composition::Device) {
+      layer.set_validated_type(HWC2::Composition::Client);
+      ++*num_types;
     }
   }
   return *num_types ? HWC2::Error::HasChanges : HWC2::Error::None;