diff --git a/composer/hwc_display.cpp b/composer/hwc_display.cpp
index b992a04..226df67 100755
--- a/composer/hwc_display.cpp
+++ b/composer/hwc_display.cpp
@@ -1610,8 +1610,8 @@
   layer_stack_.client_incompatible = false;
 
   validate_done_ = true;
-
-  return ((*out_num_types > 0) ? HWC2::Error::HasChanges : HWC2::Error::None);
+  return (((*out_num_types > 0) || (has_client_composition_ && *out_num_requests > 0))
+          ? HWC2::Error::HasChanges : HWC2::Error::None);
 }
 
 HWC2::Error HWCDisplay::AcceptDisplayChanges() {
@@ -3090,7 +3090,7 @@
       }
       break;
     case kTUITransitionStart:
-      if (secure_event_ != kSecureEventMax) {
+      if (secure_event_ != kTUITransitionPrepare) {
         DLOGE("Invalid TUI transition from %d to %d", secure_event_, secure_event);
         return kErrorParameters;
       }
@@ -3108,11 +3108,17 @@
   return kErrorNone;
 }
 
-DisplayError HWCDisplay::HandleSecureEvent(SecureEvent secure_event, bool *needs_refresh) {
+DisplayError HWCDisplay::HandleSecureEvent(SecureEvent secure_event, bool *needs_refresh,
+                                           bool update_event_only) {
   if (secure_event == secure_event_) {
     return kErrorNone;
   }
 
+  if (update_event_only) {
+    secure_event_ = secure_event;
+    return kErrorNone;
+  }
+
   DisplayError err = ValidateTUITransition(secure_event);
   if (err != kErrorNone) {
     return err;
@@ -3151,6 +3157,9 @@
 DisplayError HWCDisplay::PostHandleSecureEvent(SecureEvent secure_event) {
   DisplayError err = display_intf_->PostHandleSecureEvent(secure_event);
   if (err == kErrorNone) {
+    if (secure_event == kTUITransitionEnd || secure_event == kTUITransitionUnPrepare) {
+      return kErrorNone;
+    }
     secure_event_ = secure_event;
   }
   return err;
@@ -3181,6 +3190,9 @@
   pending_cwb_request = !!cwb_buffer_map_.size();
   }
 
+  *needs_refresh = true;
+  display_intf_->HandleCwbTeardown();
+
   if (!pending_cwb_request) {
     dump_frame_count_ = 0;
     dump_frame_index_ = 0;
@@ -3198,13 +3210,8 @@
     output_buffer_base_ = nullptr;
     frame_capture_buffer_queued_ = false;
     frame_capture_status_ = 0;
-    *needs_refresh = false;
-    return kErrorNone;
-  } else {
-    *needs_refresh = true;
-    display_intf_->HandleCwbTeardown();
-    return kErrorNone;
   }
+  return kErrorNone;
 }
 
 void HWCDisplay::MMRMEvent(bool restricted) {
@@ -3276,7 +3283,7 @@
   }
 
   if (secure_event_ != kSecureEventMax) {
-    DLOGE("CWB is not supported as TUI transition is in progress");
+    DLOGW("CWB is not supported as TUI transition is in progress");
     return HWC2::Error::Unsupported;
   }
 
@@ -3357,6 +3364,24 @@
   LayerRect &full_rect = config.cwb_full_rect;
   CwbTapPoint &tap_point = config.tap_point;
 
+  LayerRect full_rect_with_window_rect = full_rect;
+  LayerRect cwb_roi_with_window_rect = roi;
+
+  full_rect_with_window_rect.left += window_rect_.left;
+  full_rect_with_window_rect.top += window_rect_.top;
+  full_rect_with_window_rect.right -= window_rect_.right;
+  full_rect_with_window_rect.bottom -= window_rect_.bottom;
+
+  cwb_roi_with_window_rect.left += window_rect_.left;
+  cwb_roi_with_window_rect.top += window_rect_.top;
+  cwb_roi_with_window_rect.right += window_rect_.left;
+  cwb_roi_with_window_rect.bottom += window_rect_.top;
+
+  if (windowed_display_ && (!(Contains(full_rect_with_window_rect, cwb_roi_with_window_rect)))) {
+    DLOGW("Requested CWB ROI is out of bounds");
+    return HWC2::Error::Unsupported;
+  }
+
   DisplayError error = kErrorNone;
   error = display_intf_->CaptureCwb(output_buffer, config);
   if (error) {
diff --git a/composer/hwc_display.h b/composer/hwc_display.h
index 017c41e..ae98ccb 100644
--- a/composer/hwc_display.h
+++ b/composer/hwc_display.h
@@ -247,7 +247,8 @@
   virtual int Perform(uint32_t operation, ...);
   virtual int HandleSecureSession(const std::bitset<kSecureMax> &secure_sessions,
                                   bool *power_on_pending, bool is_active_secure_display);
-  virtual DisplayError HandleSecureEvent(SecureEvent secure_event, bool *needs_refresh);
+  virtual DisplayError HandleSecureEvent(SecureEvent secure_event, bool *needs_refresh,
+                                         bool update_event_only);
   virtual DisplayError PostHandleSecureEvent(SecureEvent secure_event);
   virtual int GetActiveSecureSession(std::bitset<kSecureMax> *secure_sessions) { return 0; };
   virtual DisplayError SetMixerResolution(uint32_t width, uint32_t height);
diff --git a/composer/hwc_layers.cpp b/composer/hwc_layers.cpp
index c18930d..842269f 100644
--- a/composer/hwc_layers.cpp
+++ b/composer/hwc_layers.cpp
@@ -620,8 +620,16 @@
     return HWC2::Error::BadParameter;
   }
 
+  uint8_t kMaxPlaneAlpha = 255;
   //  Conversion of float alpha in range 0.0 to 1.0 similar to the HWC Adapter
-  uint8_t plane_alpha = static_cast<uint8_t>(std::round(255.0f * alpha));
+  uint8_t plane_alpha = static_cast<uint8_t>(std::round(float(kMaxPlaneAlpha) * alpha));
+
+  //  if alpha lies in the range (0.998, 1), plane_alpha becomes 255 when rounded off,
+  //  while alpha < 1. HWC knows layer as opaque and marks punch hole for that layer in fbt,
+  //  while SF knows it as non-opaque and doesn't create punch hole.
+  if ((plane_alpha == kMaxPlaneAlpha) && (alpha < 1.0f)) {
+    plane_alpha = (kMaxPlaneAlpha - 1);
+  }
 
   if (layer_->plane_alpha != plane_alpha) {
     geometry_changes_ |= kPlaneAlpha;
diff --git a/composer/hwc_session.cpp b/composer/hwc_session.cpp
index 7aa5ddc..4d3908e 100644
--- a/composer/hwc_session.cpp
+++ b/composer/hwc_session.cpp
@@ -2798,10 +2798,13 @@
 }
 
 android::status_t HWCSession::SetDsiClk(const android::Parcel *input_parcel) {
-  int disp_id = input_parcel->readInt32();
+  uint32_t disp_id = UINT32(input_parcel->readInt32());
   uint64_t clk = UINT64(input_parcel->readInt64());
   if (disp_id != HWC_DISPLAY_PRIMARY) {
-    return -EINVAL;
+    if (!std::any_of(map_info_builtin_.begin(), map_info_builtin_.end(),
+                    [&disp_id](auto &i) {return disp_id == i.client_id;})) {
+                      return -EINVAL;
+                   }
   }
 
   SEQUENCE_WAIT_SCOPE_LOCK(locker_[disp_id]);
@@ -4274,7 +4277,6 @@
   {
     SEQUENCE_WAIT_SCOPE_LOCK(locker_[display]);
     DLOGI("Acquired lock for client %d display %" PRIu64, client_id, display);
-    callbacks_.Refresh(display);
     clients_waiting_for_commit_[display].set(client_id);
     locker_[display].Wait();
     if (commit_error_[display] != 0) {
@@ -4370,11 +4372,9 @@
   for (auto &info : map_info) {
     SEQUENCE_WAIT_SCOPE_LOCK(locker_[info.client_id]);
     if (hwc_display_[info.client_id]) {
-      if (info.client_id == target_display) {
-        continue;
-      }
-      if (hwc_display_[info.client_id]->HandleSecureEvent(kTUITransitionPrepare,
-                                                          &needs_refresh) != kErrorNone) {
+      if (hwc_display_[info.client_id]->HandleSecureEvent(kTUITransitionPrepare, &needs_refresh,
+                                                          info.client_id == target_display) !=
+                                                          kErrorNone) {
         return -EINVAL;
       }
     }
@@ -4418,8 +4418,8 @@
   {
     SEQUENCE_WAIT_SCOPE_LOCK(locker_[target_display]);
     if (hwc_display_[target_display]) {
-      if (hwc_display_[target_display]->HandleSecureEvent(kTUITransitionStart,
-                                                          &needs_refresh) != kErrorNone) {
+      if (hwc_display_[target_display]->HandleSecureEvent(kTUITransitionStart, &needs_refresh,
+                                                          false) != kErrorNone) {
         return -EINVAL;
       }
       uint32_t config = 0;
@@ -4479,8 +4479,8 @@
     hwc_display_[target_display]->SetIdleTimeoutMs(idle_time_active_ms_, idle_time_inactive_ms_);
     hwc_display_[target_display]->SetQSyncMode(hwc_display_qsync_[target_display]);
     if (hwc_display_[target_display]) {
-      if (hwc_display_[target_display]->HandleSecureEvent(kTUITransitionEnd,
-                                                          &needs_refresh) != kErrorNone) {
+      if (hwc_display_[target_display]->HandleSecureEvent(kTUITransitionEnd, &needs_refresh,
+                                                          false) != kErrorNone) {
         return -EINVAL;
       }
     } else {
@@ -4535,14 +4535,12 @@
     {
       SEQUENCE_WAIT_SCOPE_LOCK(locker_[info.client_id]);
       if (hwc_display_[info.client_id]) {
-        if (info.client_id == target_display) {
-          continue;
-        }
         if (info.disp_type == kPluggable && pending_hotplug_event_ == kHotPlugEvent) {
           continue;
         }
-        if (hwc_display_[info.client_id]->HandleSecureEvent(kTUITransitionUnPrepare,
-                                                            &needs_refresh) != kErrorNone) {
+        if (hwc_display_[info.client_id]->HandleSecureEvent(kTUITransitionUnPrepare, &needs_refresh,
+                                                            info.client_id == target_display) !=
+                                                            kErrorNone) {
           return -EINVAL;
         }
       }
diff --git a/gralloc/gr_allocator.cpp b/gralloc/gr_allocator.cpp
index feda5b5..b9c3491 100644
--- a/gralloc/gr_allocator.cpp
+++ b/gralloc/gr_allocator.cpp
@@ -62,7 +62,6 @@
 
 int Allocator::AllocateMem(AllocData *alloc_data, uint64_t usage, int format) {
   int ret;
-  int err = 0;
   bool is_secure = false;
   alloc_data->uncached = UseUncached(format, usage);
 
@@ -88,15 +87,16 @@
   } else {
     ALOGE("%s: Failed to allocate buffer - heap name: %s flags: 0x%x ret: %d", __FUNCTION__,
           alloc_data->heap_name.c_str(), alloc_data->flags, ret);
+    return ret;
   }
 
   if (!alloc_data->vm_names.empty()) {
-    err = alloc_intf->SecureMemPerms(alloc_data);
+    ret = alloc_intf->SecureMemPerms(alloc_data);
   }
 
-  if (err) {
+  if (ret) {
     ALOGE("%s: Failed to modify secure use permissions - heap name: %s flags: 0x%x, err: %d",
-          __FUNCTION__, alloc_data->heap_name.c_str(), alloc_data->flags, err);
+          __FUNCTION__, alloc_data->heap_name.c_str(), alloc_data->flags, ret);
   }
 
   return ret;
diff --git a/gralloc/gr_utils.h b/gralloc/gr_utils.h
index 1c4ec56..acc0e95 100644
--- a/gralloc/gr_utils.h
+++ b/gralloc/gr_utils.h
@@ -68,7 +68,7 @@
 #define OVERFLOW(x, y) (((y) != 0) && ((x) > (UINT_MAX / (y))))
 
 #define ROUND_UP_PAGESIZE(x) roundUpToPageSize(x)
-inline int roundUpToPageSize(int x) {
+inline size_t roundUpToPageSize(size_t x) {
   return (x + (getpagesize() - 1)) & ~(getpagesize() - 1);
 }
 
diff --git a/include/display_properties.h b/include/display_properties.h
index ca304fd..8d33e5a 100644
--- a/include/display_properties.h
+++ b/include/display_properties.h
@@ -134,6 +134,8 @@
 // Disable SDR dimming support
 #define DISABLE_SDR_DIMMING                  DISPLAY_PROP("disable_sdr_dimming")
 #define FORCE_TONEMAPPING                    DISPLAY_PROP("force_tonemapping")
+// Allows color management(tonemapping) in native mode (native mode is considered BT709+sRGB)
+#define ALLOW_TONEMAP_NATIVE                 DISPLAY_PROP("allow_tonemap_native")
 
 // RC
 #define ENABLE_ROUNDED_CORNER                DISPLAY_PROP("enable_rounded_corner")
@@ -161,6 +163,8 @@
 #define ANTI_AGING_RECALIB_TIMER             DISPLAY_PROP("demura_recalib_timer")
 #define ANTI_AGING_RECORD_TIMER              DISPLAY_PROP("demura_record_timer")
 #define ANTI_AGING_IDLE_TIMER                DISPLAY_PROP("demura_idle_timer")
+#define ANTI_AGING_MEMORY_SIZE               DISPLAY_PROP("demura_memory_size")
+#define ANTI_AGING_RECALIB_TIMER_DIVIDER     DISPLAY_PROP("demura_recalib_timer_divider")
 
 // PERF hint properties
 #define ENABLE_PERF_HINT_LARGE_COMP_CYCLE    DISPLAY_PROP("enable_perf_hint_large_comp_cycle")
diff --git a/init/init.qti.display_boot.sh b/init/init.qti.display_boot.sh
index bf65e8f..2df8b36 100644
--- a/init/init.qti.display_boot.sh
+++ b/init/init.qti.display_boot.sh
@@ -57,8 +57,13 @@
     ;;
     "kalama")
     #SOC ID for Kalama is 519
+    #SOC ID for Kalama SG36 is 600
+    #SOC ID for Kalama SG p is 601
     case "$soc_hwid" in
-      519)
+       519|600|601|603|604)
+        #Set property for kalama
+        #SOC ID for QCS Kalama is 603
+        #SOC ID for QCM Kalama is 604
         setprop vendor.display.enable_fb_scaling 0
         setprop vendor.display.target.version 4
         setprop vendor.gralloc.use_dma_buf_heaps 1
diff --git a/sdm/include/private/demuratn_core_uvm_intf.h b/sdm/include/private/demuratn_core_uvm_intf.h
index 1639ea7..78b44cd 100644
--- a/sdm/include/private/demuratn_core_uvm_intf.h
+++ b/sdm/include/private/demuratn_core_uvm_intf.h
@@ -11,8 +11,15 @@
 
 namespace sdm {
 
+enum DemuraTnCoreState {
+  kDemuraTnCoreNotReady,
+  kDemuraTnCoreReady,
+  kDemuraTnCoreError,
+  kDemuraTnCoreStateMax,
+};
+
 enum DemuraTnCoreUvmParams {
-  /* Getter: bool */
+  /* Getter: DemuraTnCoreState */
   kDemuraTnCoreUvmParamInitReady,
   /* Getter/Setter: bool */
   kDemuraTnCoreUvmParamEnable,
diff --git a/sdm/libs/core/display_base.cpp b/sdm/libs/core/display_base.cpp
index 18bec0f..13abdc7 100644
--- a/sdm/libs/core/display_base.cpp
+++ b/sdm/libs/core/display_base.cpp
@@ -125,6 +125,7 @@
   DisplayError error = kErrorNone;
   hw_panel_info_ = HWPanelInfo();
   hw_intf_->GetHWPanelInfo(&hw_panel_info_);
+  default_panel_mode_ = hw_panel_info_.mode;
   if (hw_info_intf_) {
     hw_info_intf_->GetHWResourceInfo(&hw_resource_info_);
   }
@@ -217,6 +218,10 @@
   if (Debug::Get()->GetProperty(DISABLE_LLCC_DURING_AOD, &prop) == kErrorNone) {
     disable_llcc_during_aod_ = (prop == 1);
   }
+  prop = 0;
+  if (Debug::Get()->GetProperty(ALLOW_TONEMAP_NATIVE, &prop) == kErrorNone) {
+    allow_tonemap_native_ = (prop == 1);
+  }
 
   SetupPanelFeatureFactory();
 
@@ -2540,6 +2545,9 @@
   }
 
   LayerRect &roi = cwb_config->cwb_roi;
+  // Set cwb full rect as per window rect.
+  cwb_config->cwb_full_rect.right -= (window_rect_.left + window_rect_.right);
+  cwb_config->cwb_full_rect.bottom -= (window_rect_.top + window_rect_.bottom);
   LayerRect &full_frame = cwb_config->cwb_full_rect;
   uint32_t cwb_roi_supported = 0;  // Check whether CWB ROI is supported.
   IsSupportedOnDisplay(kCwbCrop, &cwb_roi_supported);
@@ -2581,7 +2589,8 @@
     DLOGI_IF(kTagDisplay, "Client provided invalid ROI. Going for Full frame CWB.");
     roi = full_frame;
   }
-
+  // Reposition CWB ROI as per window rect.
+  roi = Reposition(roi, window_rect_.left, window_rect_.top);
   DLOGI_IF(kTagDisplay, "Cwb_config: tap_point %d, CWB ROI Rect(%f %f %f %f), PU_as_CWB_ROI %d",
            tap_point, roi.left, roi.top, roi.right, roi.bottom, pu_as_cwb_roi);
 
@@ -3580,7 +3589,8 @@
   } else if (color_gamut == kDcip3) {
     pt.primaries = GetColorPrimariesFromAttribute(color_gamut);
     pt.transfer = Transfer_sRGB;
-  } else if (color_gamut == kNative) {
+  } else if (color_gamut == kNative && !allow_tonemap_native_) {
+    // if allow_tonemap_native_ is set, blend space is defaulted to BT709 + sRGB
     pt.primaries = GetColorPrimariesFromAttribute(color_gamut);
     pt.transfer = Transfer_Max;
   }
@@ -3763,9 +3773,11 @@
   DLOGI("Secure event %d for display %d-%d", secure_event, display_id_, display_type_);
 
   if (secure_event == kTUITransitionStart &&
-      (state_ != kStateOn || (pending_power_state_ != kPowerStateNone))) {
-    DLOGW("Cannot start TUI session when display state is %d or pending_power_state %d",
-          state_, pending_power_state_);
+      (state_ != kStateOn || (pending_power_state_ != kPowerStateNone) ||
+       (hw_panel_info_.mode != default_panel_mode_))) {
+    DLOGW("Cannot start TUI session when display state is %d or pending_power_state %d "
+          "or panel mode is changed; current panel mode = %d, panel mode during bootup = %d",
+           state_, pending_power_state_, hw_panel_info_.mode, default_panel_mode_);
     return kErrorPermission;
   }
   shared_ptr<Fence> release_fence = nullptr;
diff --git a/sdm/libs/core/display_base.h b/sdm/libs/core/display_base.h
index 3b54419..a40e986 100644
--- a/sdm/libs/core/display_base.h
+++ b/sdm/libs/core/display_base.h
@@ -431,6 +431,7 @@
   bool pending_commit_ = false;
   uint32_t active_refresh_rate_ = 0;
   bool disable_cwb_idle_fallback_ = false;
+  bool allow_tonemap_native_ = false;
 
  private:
   // Max tolerable power-state-change wait-times in milliseconds.
@@ -480,6 +481,7 @@
   bool windowed_display_ = false;
   LayerRect window_rect_ = {};
   bool enable_win_rect_mask_ = false;
+  HWDisplayMode default_panel_mode_ = kModeDefault;
 };
 
 }  // namespace sdm
diff --git a/sdm/libs/core/display_builtin.cpp b/sdm/libs/core/display_builtin.cpp
index 2a4bc76..5402d8e 100644
--- a/sdm/libs/core/display_builtin.cpp
+++ b/sdm/libs/core/display_builtin.cpp
@@ -778,9 +778,9 @@
   *en = enable;
 
   if (enable) {  // make sure init is ready before enabling
-    bool *init_ready = nullptr;
+    DemuraTnCoreState *init_ready = nullptr;
     GenericPayload ready_pl;
-    ret = ready_pl.CreatePayload<bool>(init_ready);
+    ret = ready_pl.CreatePayload<DemuraTnCoreState>(init_ready);
     if (ret) {
       DLOGE("failed to create the payload. Error:%d", ret);
       return kErrorUndefined;
@@ -791,16 +791,25 @@
       DLOGE("GetParameter for InitReady failed ret %d", ret);
       return kErrorUndefined;
     }
-    if (!(*init_ready)) {
+    if (*init_ready == kDemuraTnCoreNotReady) {
       return kErrorNone;
-    }
-
-    ret = demuratn_->SetParameter(kDemuraTnCoreUvmParamEnable, payload);
-    if (ret) {
-      DLOGE("SetParameter for enable failed ret %d", ret);
+    } else if (*init_ready == kDemuraTnCoreError) {
+      DLOGE("DemuraTn init ready state returns error");
+      int rc = demuratn_->Deinit();
+      if (rc)
+        DLOGE("Failed to deinit DemuraTn ret %d", rc);
+      demuratn_factory_ = nullptr;
+      demuratn_.reset();
+      demuratn_ = nullptr;
       return kErrorUndefined;
+    } else if (*init_ready == kDemuraTnCoreReady) {
+      ret = demuratn_->SetParameter(kDemuraTnCoreUvmParamEnable, payload);
+      if (ret) {
+        DLOGE("SetParameter for enable failed ret %d", ret);
+        return kErrorUndefined;
+      }
+      demuratn_enabled_ = true;
     }
-    demuratn_enabled_ = true;
   } else {
     ret = demuratn_->SetParameter(kDemuraTnCoreUvmParamEnable, payload);
     if (ret) {
@@ -2394,7 +2403,9 @@
   }
 
   // Set sRGB as default blend space.
-  if (stc_color_modes_.list.empty()) {
+  bool native_mode = (color_mode.intent == snapdragoncolor::kNative) ||
+                     (color_mode.gamut == ColorPrimaries_Max && color_mode.gamma == Transfer_Max);
+  if (stc_color_modes_.list.empty() || (native_mode && allow_tonemap_native_)) {
     return blend_space;
   }
 
diff --git a/sdm/libs/dal/hw_device_drm.cpp b/sdm/libs/dal/hw_device_drm.cpp
index c70ff12..8164111 100644
--- a/sdm/libs/dal/hw_device_drm.cpp
+++ b/sdm/libs/dal/hw_device_drm.cpp
@@ -585,6 +585,14 @@
   PopulateHWPanelInfo();
   UpdateMixerAttributes();
 
+  LayerRect window_rect = {};
+  windowed_display_ = Debug::GetWindowRect(hw_panel_info_.is_primary_panel, &window_rect.left,
+                                           &window_rect.top, &window_rect.right,
+                                           &window_rect.bottom) == 0;
+  if (windowed_display_) {
+    window_rect_ = window_rect;
+  }
+
   // TODO(user): In future, remove has_qseed3 member, add version and pass version to constructor
   if (hw_resource_.has_qseed3) {
     hw_scale_ = new HWScaleDRM(HWScaleDRM::Version::V2);
@@ -2024,7 +2032,8 @@
   // for other metadata types we will run into issues.
   bool extended_md_present = input_buffer.extended_content_metadata != nullptr &&
                               input_buffer.extended_content_metadata->size;
-  if (extended_md_present && input_buffer.color_metadata.transfer == Transfer_SMPTE_170M) {
+  if (extended_md_present && (input_buffer.color_metadata.transfer == Transfer_SMPTE_170M
+                          || input_buffer.color_metadata.transfer == Transfer_sRGB)) {
       *type = DRMCscType::kCscYuv2RgbDolbyVisionP5;
       return;
   }
@@ -3058,6 +3067,13 @@
   sde_drm::DRMRect cwb_dst = full_frame;
   LayerRect cwb_roi = cwb_config->cwb_roi;
 
+  if (windowed_display_) {
+    cwb_roi.left += window_rect_.left;
+    cwb_roi.right += window_rect_.left;
+    cwb_roi.top += window_rect_.top;
+    cwb_roi.bottom += window_rect_.top;
+  }
+
   if (has_cwb_crop_) {  // If CWB ROI feature is supported, then set WB connector's roi_v1 property
     // to PU ROI and DST_* properties to CWB ROI. Else, set DST_* properties to full frame ROI.
     bool is_full_frame_update = IsFullFrameUpdate(hw_layer_info);
diff --git a/sdm/libs/dal/hw_device_drm.h b/sdm/libs/dal/hw_device_drm.h
index 144debf..63eba31 100644
--- a/sdm/libs/dal/hw_device_drm.h
+++ b/sdm/libs/dal/hw_device_drm.h
@@ -364,6 +364,8 @@
   static HWCwbConfig cwb_config_;
   static std::mutex cwb_state_lock_;  // cwb state lock. Set before accesing or updating cwb_config_
   uint32_t transfer_time_updated_ = 0;
+  LayerRect window_rect_ = {};
+  bool windowed_display_ = false;
 
  private:
   void GetCWBCapabilities();
