Merge 97cd61330667628b1365cc4b2e9285832c18a623 on remote branch

Change-Id: I9e14b1deed3e60b658ef9dd01adebcf33fd45dd7
diff --git a/sdm/libs/hwc2/hwc_session.cpp b/sdm/libs/hwc2/hwc_session.cpp
index 8a51ea7..2cd107b 100644
--- a/sdm/libs/hwc2/hwc_session.cpp
+++ b/sdm/libs/hwc2/hwc_session.cpp
@@ -1158,6 +1158,33 @@
   return HWC2_ERROR_NONE;
 }
 
+int32_t HWCSession::SetAutoLowLatencyMode(hwc2_device_t *device, hwc2_display_t display, bool on) {
+  if (!device || display >= HWCCallbacks::kNumDisplays) {
+    return HWC2_ERROR_BAD_DISPLAY;
+  }
+  return HWC2_ERROR_UNSUPPORTED;
+}
+
+int32_t HWCSession::GetSupportedContentTypes(hwc2_device_t *device, hwc2_display_t display,
+                                 uint32_t *count, uint32_t *contentTypes) {
+  contentTypes = {};
+  if (!device || display >= HWCCallbacks::kNumDisplays) {
+    return HWC2_ERROR_BAD_DISPLAY;
+  }
+  return HWC2_ERROR_NONE;
+}
+
+int32_t HWCSession::SetContentType(hwc2_device_t *device, hwc2_display_t display,
+                                   int32_t type) {
+  if (!device || display >= HWCCallbacks::kNumDisplays) {
+    return HWC2_ERROR_BAD_DISPLAY;
+  }
+  if (type == UINT32(composer_V2_4::IComposerClient::ContentType::NONE)) {
+    return HWC2_ERROR_NONE;
+  }
+  return HWC2_ERROR_UNSUPPORTED;
+}
+
 int32_t HWCSession::ValidateDisplay(hwc2_device_t *device, hwc2_display_t display,
                                     uint32_t *out_num_types, uint32_t *out_num_requests) {
   //  out_num_types and out_num_requests will be non-NULL
@@ -1327,6 +1354,12 @@
     case HWC2::FunctionDescriptor::SetActiveConfigWithConstraints:
       return AsFP<HWC2_PFN_SET_ACTIVE_CONFIG_WITH_CONSTRAINTS>
                   (HWCSession::SetActiveConfigWithConstraints);
+    case HWC2::FunctionDescriptor::SetAutoLowLatencyMode:
+      return AsFP<HWC2_PFN_SET_AUTO_LOW_LATENCY_MODE>(HWCSession::SetAutoLowLatencyMode);
+    case HWC2::FunctionDescriptor::GetSupportedContentTypes:
+      return AsFP<HWC2_PFN_GET_SUPPORTED_CONTENT_TYPES>(HWCSession::GetSupportedContentTypes);
+    case HWC2::FunctionDescriptor::SetContentType:
+      return AsFP<HWC2_PFN_SET_CONTENT_TYPE>(HWCSession::SetContentType);
     default:
       DLOGD("Unknown/Unimplemented function descriptor: %d (%s)", int_descriptor,
             to_string(descriptor).c_str());
@@ -3306,7 +3339,7 @@
   if (!outCapabilities) {
     *outNumCapabilities = 0;
     if (isBuiltin) {
-      *outNumCapabilities = 3;
+      *outNumCapabilities = 4;
     }
     return HWC2_ERROR_NONE;
   } else {
@@ -3320,6 +3353,7 @@
         outCapabilities[index++] = HWC2_DISPLAY_CAPABILITY_DOZE;
       }
       outCapabilities[index++] = HWC2_DISPLAY_CAPABILITY_BRIGHTNESS;
+      outCapabilities[index++] = UINT32(HwcDisplayCapability::PROTECTED_CONTENTS);
       *outNumCapabilities = index;
     }
     return HWC2_ERROR_NONE;
diff --git a/sdm/libs/hwc2/hwc_session.h b/sdm/libs/hwc2/hwc_session.h
index 50b79bc..f1b054a 100644
--- a/sdm/libs/hwc2/hwc_session.h
+++ b/sdm/libs/hwc2/hwc_session.h
@@ -43,14 +43,16 @@
 #include "hwc_socket_handler.h"
 #include "hwc_display_event_handler.h"
 #include "hwc_buffer_sync_handler.h"
-
+#include <android/hardware/graphics/composer/2.4/IComposerClient.h>
 namespace sdm {
-
 using ::android::hardware::Return;
 using ::android::hardware::hidl_string;
 using android::hardware::hidl_handle;
 using ::android::hardware::hidl_vec;
 
+namespace composer_V2_4 = ::android::hardware::graphics::composer::V2_4;
+using HwcDisplayCapability = composer_V2_4::IComposerClient::DisplayCapability;
+
 int32_t GetDataspaceFromColorMode(ColorMode mode);
 
 typedef DisplayConfig::DisplayType DispType;
@@ -230,7 +232,10 @@
                                  int32_t int_enabled);
   static int32_t GetDozeSupport(hwc2_device_t *device, hwc2_display_t display,
                                 int32_t *out_support);
-
+  static int32_t SetAutoLowLatencyMode(hwc2_device_t *device, hwc2_display_t display, bool on);
+  static int32_t GetSupportedContentTypes(hwc2_device_t *device, hwc2_display_t display,
+                                          uint32_t *count, uint32_t *contentTypes);
+  static int32_t SetContentType(hwc2_device_t *device, hwc2_display_t display,int32_t type);
   static Locker locker_[HWCCallbacks::kNumDisplays];
   static Locker power_state_[HWCCallbacks::kNumDisplays];
   static Locker display_config_locker_;