mirror of
https://github.com/hyprwm/aquamarine.git
synced 2025-12-20 04:40:12 +01:00
drop fbs on disconnect and disable
This commit is contained in:
parent
c8282f4982
commit
5a0ebf15b8
2 changed files with 27 additions and 9 deletions
|
|
@ -107,6 +107,7 @@ namespace Aquamarine {
|
|||
|
||||
struct SDRMPlane {
|
||||
bool init(drmModePlane* plane);
|
||||
void dropFBs();
|
||||
|
||||
uint64_t type = 0;
|
||||
uint32_t id = 0;
|
||||
|
|
|
|||
|
|
@ -1154,6 +1154,12 @@ bool Aquamarine::SDRMPlane::init(drmModePlane* plane) {
|
|||
return true;
|
||||
}
|
||||
|
||||
void Aquamarine::SDRMPlane::dropFBs() {
|
||||
front.reset();
|
||||
back.reset();
|
||||
last.reset();
|
||||
}
|
||||
|
||||
SP<SDRMCRTC> Aquamarine::SDRMConnector::getCurrentCRTC(const drmModeConnector* connector) {
|
||||
uint32_t crtcID = 0;
|
||||
if (props.crtc_id) {
|
||||
|
|
@ -1488,6 +1494,11 @@ void Aquamarine::SDRMConnector::disconnect() {
|
|||
return;
|
||||
}
|
||||
|
||||
if (output->connector->crtc) {
|
||||
output->connector->crtc->primary->dropFBs();
|
||||
output->connector->crtc->cursor->dropFBs();
|
||||
}
|
||||
|
||||
output->events.destroy.emit();
|
||||
output.reset();
|
||||
|
||||
|
|
@ -1506,21 +1517,27 @@ bool Aquamarine::SDRMConnector::commitState(SDRMConnectorCommitData& data) {
|
|||
}
|
||||
|
||||
void Aquamarine::SDRMConnector::applyCommit(const SDRMConnectorCommitData& data) {
|
||||
crtc->primary->back = data.mainFB;
|
||||
if (crtc->cursor && data.cursorFB)
|
||||
crtc->cursor->back = data.cursorFB;
|
||||
|
||||
if (data.mainFB)
|
||||
data.mainFB->buffer->lockedByBackend = true;
|
||||
if (crtc->cursor && data.cursorFB)
|
||||
data.cursorFB->buffer->lockedByBackend = true;
|
||||
output->enabledState = output->state->state().enabled;
|
||||
|
||||
if (!output->enabledState) {
|
||||
crtc->primary->dropFBs();
|
||||
crtc->cursor->dropFBs();
|
||||
} else {
|
||||
crtc->primary->back = data.mainFB;
|
||||
if (crtc->cursor && data.cursorFB)
|
||||
crtc->cursor->back = data.cursorFB;
|
||||
|
||||
if (data.mainFB)
|
||||
data.mainFB->buffer->lockedByBackend = true;
|
||||
if (crtc->cursor && data.cursorFB)
|
||||
data.cursorFB->buffer->lockedByBackend = true;
|
||||
}
|
||||
|
||||
pendingCursorFB.reset();
|
||||
|
||||
if (output->state->state().committed & COutputState::AQ_OUTPUT_STATE_MODE)
|
||||
refresh = calculateRefresh(data.modeInfo);
|
||||
|
||||
output->enabledState = output->state->state().enabled;
|
||||
}
|
||||
|
||||
void Aquamarine::SDRMConnector::rollbackCommit(const SDRMConnectorCommitData& data) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue