mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-03-30 11:11:21 -04:00
backend/drm: don't unset mode/CRTC when disabling output
Closes: https://github.com/swaywm/wlroots/issues/2203
This commit is contained in:
parent
dcae6f1431
commit
bfd7625813
4 changed files with 36 additions and 37 deletions
|
|
@ -56,7 +56,7 @@ static void atomic_add(struct atomic *atom, uint32_t id, uint32_t prop, uint64_t
|
|||
|
||||
static bool create_mode_blob(struct wlr_drm_backend *drm,
|
||||
struct wlr_drm_crtc *crtc, uint32_t *blob_id) {
|
||||
if (!crtc->pending.active) {
|
||||
if (crtc->pending.mode == NULL) {
|
||||
*blob_id = 0;
|
||||
return true;
|
||||
}
|
||||
|
|
@ -170,6 +170,11 @@ static bool atomic_crtc_commit(struct wlr_drm_backend *drm,
|
|||
struct wlr_output *output = &conn->output;
|
||||
struct wlr_drm_crtc *crtc = conn->crtc;
|
||||
|
||||
uint32_t active = output->enabled;
|
||||
if (output->pending.committed & WLR_OUTPUT_STATE_ENABLED) {
|
||||
active = output->pending.enabled;
|
||||
}
|
||||
|
||||
uint32_t mode_id = crtc->mode_id;
|
||||
if (crtc->pending_modeset) {
|
||||
if (!create_mode_blob(drm, crtc, &mode_id)) {
|
||||
|
|
@ -213,15 +218,14 @@ static bool atomic_crtc_commit(struct wlr_drm_backend *drm,
|
|||
struct atomic atom;
|
||||
atomic_begin(&atom);
|
||||
atomic_add(&atom, conn->id, conn->props.crtc_id,
|
||||
crtc->pending.active ? crtc->id : 0);
|
||||
if (crtc->pending_modeset && crtc->pending.active &&
|
||||
conn->props.link_status != 0) {
|
||||
mode_id != 0 ? crtc->id : 0);
|
||||
if (crtc->pending_modeset && active && conn->props.link_status != 0) {
|
||||
atomic_add(&atom, conn->id, conn->props.link_status,
|
||||
DRM_MODE_LINK_STATUS_GOOD);
|
||||
}
|
||||
atomic_add(&atom, crtc->id, crtc->props.mode_id, mode_id);
|
||||
atomic_add(&atom, crtc->id, crtc->props.active, crtc->pending.active);
|
||||
if (crtc->pending.active) {
|
||||
atomic_add(&atom, crtc->id, crtc->props.active, active);
|
||||
if (mode_id != 0) {
|
||||
if (crtc->props.gamma_lut != 0) {
|
||||
atomic_add(&atom, crtc->id, crtc->props.gamma_lut, gamma_lut);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue