1
0
Fork 0

drm_hwcomposer: Teardown the pipeline and DRM resources on disconnect

This commit properly tears down the display pieline when the
display is disconnected. This frees up the DRM CRTC and other
resources used by the connector. This ensures that the
consecutive hotplugs work correctly to reallocate the CRTCs
when new displays are connected.

This was verified by ensuring the CRTCs, mode, connectors
are freed up in modetest.

Change-Id: Icdca56433b5cd565d1658b1a415565adc7980088
Signed-off-by: Manasi Navare <navaremanasi@google.com>
This commit is contained in:
Manasi Navare 2025-04-02 22:19:52 +00:00
parent de1b4f40c3
commit 025ea5bfbb

View file

@ -120,9 +120,16 @@ auto DrmAtomicStateManager::CommitFrame(AtomicCommitArgs &args) -> int {
nonblock = false;
new_frame_state.crtc_active_state = *args.active;
if (!crtc->GetActiveProperty().AtomicSet(*pset, *args.active ? 1 : 0) ||
!connector->GetCrtcIdProperty().AtomicSet(*pset, crtc->GetId())) {
!connector->GetCrtcIdProperty().AtomicSet(*pset, *args.active
? crtc->GetId()
: 0)) {
return -EINVAL;
}
if (!*args.active) {
if (!crtc->GetModeProperty().AtomicSet(*pset, 0)) {
return -EINVAL;
}
}
}
auto *drm = pipe_->device;