drm_hwcomposer: Clear connectors and CRTCs on Init
When DRM HWC starts, it resets all the connectors and CRTCs to avoid the mimatch between drm hwc tracked state and actual HW state programmed by the firmware for the splash screen. This fixes the MST connected boot issue. Change-Id: I0773541b6bb227a2880d8442cc46411dc4c0127a Signed-off-by: Manasi Navare <navaremanasi@google.com>
This commit is contained in:
parent
a0f6ed9cc7
commit
d341024047
3 changed files with 34 additions and 0 deletions
|
|
@ -299,6 +299,35 @@ auto DrmDevice::RefreshConnectors() -> void {
|
|||
}
|
||||
}
|
||||
|
||||
auto DrmDevice::ResetConnectorsAndCrtcs() -> void {
|
||||
auto pset = MakeDrmModeAtomicReqUnique();
|
||||
if (!pset) {
|
||||
ALOGE("Failed to allocate property set");
|
||||
return;
|
||||
}
|
||||
for (const auto &conn : connectors_) {
|
||||
if (!conn->GetCrtcIdProperty().AtomicSet(*pset.get(), 0)) {
|
||||
ALOGE("Failed to Set Crtc Id Prop to Null for Conn = %d", conn->GetId());
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (const auto &crtc : crtcs_) {
|
||||
if (!crtc->GetModeProperty().AtomicSet(*pset.get(), 0) ||
|
||||
!crtc->GetActiveProperty().AtomicSet(*pset.get(), 0)) {
|
||||
ALOGE(
|
||||
"Failed to set Mode Property or Active Property to Null for CRTC = "
|
||||
"%d",
|
||||
crtc->GetId());
|
||||
return;
|
||||
}
|
||||
}
|
||||
auto err = drmModeAtomicCommit(*GetFd(), pset.get(),
|
||||
DRM_MODE_ATOMIC_ALLOW_MODESET, this);
|
||||
if (err != 0) {
|
||||
ALOGE("Failed to commit pset ret=%d", err);
|
||||
}
|
||||
}
|
||||
|
||||
auto DrmDevice::GetPlanes() -> const std::vector<std::unique_ptr<DrmPlane>> & {
|
||||
return planes_;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ class DrmDevice {
|
|||
}
|
||||
|
||||
auto RefreshConnectors() -> void;
|
||||
auto ResetConnectorsAndCrtcs() -> void;
|
||||
|
||||
private:
|
||||
explicit DrmDevice(ResourceManager *res_man, uint32_t index);
|
||||
|
|
|
|||
|
|
@ -91,6 +91,10 @@ void ResourceManager::Init() {
|
|||
return;
|
||||
}
|
||||
|
||||
for (auto &drm : drms_) {
|
||||
drm->ResetConnectorsAndCrtcs();
|
||||
}
|
||||
|
||||
uevent_listener_->RegisterHotplugHandler([this] {
|
||||
const std::unique_lock lock(GetMainLock());
|
||||
for (auto &drm : drms_) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue