Merge "qdutils: Provide a way to reset MetaData key"
diff --git a/sdm/libs/hwc2/hwc_display.cpp b/sdm/libs/hwc2/hwc_display.cpp
index 868b0f7..1f901d8 100644
--- a/sdm/libs/hwc2/hwc_display.cpp
+++ b/sdm/libs/hwc2/hwc_display.cpp
@@ -360,9 +360,14 @@
       layer_stack_.flags.skip_present = true;
     }
 
-    if (layer->flags.cursor) {
-      layer_stack_.flags.cursor_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;
+      }
     }
+
     // TODO(user): Move to a getter if this is needed at other places
     hwc_rect_t scaled_display_frame = {INT(layer->dst_rect.left), INT(layer->dst_rect.top),
                                        INT(layer->dst_rect.right), INT(layer->dst_rect.bottom)};
diff --git a/sdm/libs/hwc2/hwc_layers.cpp b/sdm/libs/hwc2/hwc_layers.cpp
index d35523d..225b599 100644
--- a/sdm/libs/hwc2/hwc_layers.cpp
+++ b/sdm/libs/hwc2/hwc_layers.cpp
@@ -148,7 +148,6 @@
       layer_->flags.solid_fill = true;
       break;
     case HWC2::Composition::Cursor:
-      layer_->flags.cursor = true;
       break;
     case HWC2::Composition::Invalid:
       return HWC2::Error::BadParameter;