sdm: Fix topology after adding new mode
1. Driver does not populate topology information for the new
resolution mode being added for virtual display. So hardcode the
topology information in user space based on the width
2. Do not initialize the default mode list for connector, as user
space adds the mode to the mode list as and when requested.
Change-Id: I5be12616dbc8b0f22e5d641c442c884a7651d44b
CRs-Fixed: 2135009
diff --git a/sdm/libs/core/drm/hw_device_drm.cpp b/sdm/libs/core/drm/hw_device_drm.cpp
index 4c7136e..65498be 100644
--- a/sdm/libs/core/drm/hw_device_drm.cpp
+++ b/sdm/libs/core/drm/hw_device_drm.cpp
@@ -346,7 +346,6 @@
}
drm_mgr_intf_->CreateAtomicReq(token_, &drm_atomic_intf_);
- drm_mgr_intf_->GetConnectorInfo(token_.conn_id, &connector_info_);
} else {
display_attributes_.push_back(HWDisplayAttributes());
PopulateDisplayAttributes(current_mode_index_);
diff --git a/sdm/libs/core/drm/hw_peripheral_drm.cpp b/sdm/libs/core/drm/hw_peripheral_drm.cpp
index 92669e1..667cd88 100644
--- a/sdm/libs/core/drm/hw_peripheral_drm.cpp
+++ b/sdm/libs/core/drm/hw_peripheral_drm.cpp
@@ -57,6 +57,7 @@
scalar_data_.resize(hw_resource_.hw_dest_scalar_info.count);
+ drm_mgr_intf_->GetConnectorInfo(token_.conn_id, &connector_info_);
if (connector_info_.topology == DRMTopology::UNKNOWN) {
connector_info_.topology = DRMTopology::DUAL_LM;
}
diff --git a/sdm/libs/core/drm/hw_tv_drm.cpp b/sdm/libs/core/drm/hw_tv_drm.cpp
index e93f065..08e502e 100644
--- a/sdm/libs/core/drm/hw_tv_drm.cpp
+++ b/sdm/libs/core/drm/hw_tv_drm.cpp
@@ -73,6 +73,7 @@
DLOGE("Init failed for %s", device_name_);
return error;
}
+ drm_mgr_intf_->GetConnectorInfo(token_.conn_id, &connector_info_);
InitializeConfigs();
diff --git a/sdm/libs/core/drm/hw_virtual_drm.cpp b/sdm/libs/core/drm/hw_virtual_drm.cpp
index 626beea..5f07fd3 100644
--- a/sdm/libs/core/drm/hw_virtual_drm.cpp
+++ b/sdm/libs/core/drm/hw_virtual_drm.cpp
@@ -55,28 +55,6 @@
HWDeviceDRM::disp_type_ = DRMDisplayType::VIRTUAL;
}
-DisplayError HWVirtualDRM::Init() {
- DisplayError err = HWDeviceDRM::Init();
- if (err != kErrorNone) {
- return err;
- }
- // TODO(user): Remove this code once driver populates appropriate topology based on virtual
- // display configuration
- if (connector_info_.topology == sde_drm::DRMTopology::UNKNOWN) {
- uint32_t max_width = 0;
- for (uint32_t i = 0; i < (uint32_t)connector_info_.modes.size(); i++) {
- max_width = std::max(max_width, UINT32(connector_info_.modes[i].hdisplay));
- }
- connector_info_.topology = sde_drm::DRMTopology::SINGLE_LM;
- if (max_width > hw_resource_.max_mixer_width) {
- connector_info_.topology = sde_drm::DRMTopology::DUAL_LM_MERGE;
- }
- }
- InitializeConfigs();
-
- return kErrorNone;
-}
-
void HWVirtualDRM::ConfigureWbConnectorFbId(uint32_t fb_id) {
drm_atomic_intf_->Perform(DRMOps::CONNECTOR_SET_OUTPUT_FB_ID, token_.conn_id, fb_id);
return;
@@ -133,6 +111,18 @@
}
// Reload connector info for updated info after null commit
drm_mgr_intf_->GetConnectorInfo(token_.conn_id, &connector_info_);
+ // TODO(user): Remove this code once driver populates appropriate topology based on virtual
+ // display configuration
+ if (connector_info_.topology == sde_drm::DRMTopology::UNKNOWN) {
+ uint32_t max_width = 0;
+ for (uint32_t i = 0; i < (uint32_t)connector_info_.modes.size(); i++) {
+ max_width = std::max(max_width, UINT32(connector_info_.modes[i].hdisplay));
+ }
+ connector_info_.topology = sde_drm::DRMTopology::SINGLE_LM;
+ if (max_width > hw_resource_.max_mixer_width) {
+ connector_info_.topology = sde_drm::DRMTopology::DUAL_LM_MERGE;
+ }
+ }
InitializeConfigs();
GetModeIndex(display_attributes, &mode_index);
diff --git a/sdm/libs/core/drm/hw_virtual_drm.h b/sdm/libs/core/drm/hw_virtual_drm.h
index 53e5b56..29ef7b2 100644
--- a/sdm/libs/core/drm/hw_virtual_drm.h
+++ b/sdm/libs/core/drm/hw_virtual_drm.h
@@ -50,7 +50,6 @@
virtual DisplayError PowerOn();
protected:
- virtual DisplayError Init();
virtual DisplayError Validate(HWLayers *hw_layers);
virtual DisplayError Commit(HWLayers *hw_layers);
virtual DisplayError GetPPFeaturesVersion(PPFeatureVersion *vers);