hwc2: Set cursor composition if it is not skip layer.

Some scenarios demand GPU composition even though client expects
device composition. Ex: First frame after display connection,
non-integral source crop etc; In such cases, prioritize skip flag
over composition types.

CRs-Fixed: 2452357
Change-Id: I7e6c70c46b1b3744e7872dff34961991f879d269
diff --git a/composer/hwc_display.cpp b/composer/hwc_display.cpp
index 5b90c16..bb9b4b6 100644
--- a/composer/hwc_display.cpp
+++ b/composer/hwc_display.cpp
@@ -739,14 +739,6 @@
       layer_stack_.flags.single_buffered_layer_present = true;
     }
 
-    if (hwc_layer->GetClientRequestedCompositionType() == HWC2::Composition::Cursor) {
-      // Currently we support only one HWCursor & only at top most z-order
-      if ((*layer_set_.rbegin())->GetId() == hwc_layer->GetId()) {
-        layer->flags.cursor = true;
-        layer_stack_.flags.cursor_present = true;
-      }
-    }
-
     bool hdr_layer = layer->input_buffer.color_metadata.colorPrimaries == ColorPrimaries_BT2020 &&
                      (layer->input_buffer.color_metadata.transfer == Transfer_SMPTE_ST2084 ||
                      layer->input_buffer.color_metadata.transfer == Transfer_HLG);
@@ -761,6 +753,15 @@
       layer->flags.skip = true;
     }
 
+    if (!layer->flags.skip &&
+        (hwc_layer->GetClientRequestedCompositionType() == HWC2::Composition::Cursor)) {
+      // Currently we support only one HWCursor & only at top most z-order
+      if ((*layer_set_.rbegin())->GetId() == hwc_layer->GetId()) {
+        layer->flags.cursor = true;
+        layer_stack_.flags.cursor_present = true;
+      }
+    }
+
     if (layer->flags.skip) {
       layer_stack_.flags.skip_present = true;
     }