Skip to content

Commit

Permalink
drm: pass explicitOutFence pointer and do not touch the value (#10)
Browse files Browse the repository at this point in the history
* pass explicitOutFence pointer and do not touch the value

* add resetExplicitFences
  • Loading branch information
UjinT34 authored Jul 11, 2024
1 parent d92d55d commit 1ae9ead
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions include/aquamarine/output/Output.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ namespace Aquamarine {
void setBuffer(Hyprutils::Memory::CSharedPointer<IBuffer> buffer);
void setExplicitInFence(int64_t fenceFD); // -1 removes
void setExplicitOutFence(int64_t fenceFD); // -1 removes
void resetExplicitFences();

private:
SInternalState internalState;
Expand Down
4 changes: 2 additions & 2 deletions src/backend/drm/impl/Atomic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ void Aquamarine::CDRMAtomicRequest::addConnector(Hyprutils::Memory::CSharedPoint
add(connector->crtc->id, connector->crtc->props.active, enable);

if (enable) {
if (connector->output->supportsExplicit && STATE.explicitOutFence >= 0)
add(connector->crtc->id, connector->crtc->props.out_fence_ptr, STATE.explicitOutFence);
if (connector->output->supportsExplicit && STATE.committed & COutputState::AQ_OUTPUT_STATE_EXPLICIT_OUT_FENCE)
add(connector->crtc->id, connector->crtc->props.out_fence_ptr, (uintptr_t)&STATE.explicitOutFence);

if (connector->crtc->props.gamma_lut && data.atomic.gammad)
add(connector->crtc->id, connector->crtc->props.gamma_lut, data.atomic.gammaLut);
Expand Down
12 changes: 7 additions & 5 deletions src/output/Output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,17 @@ void Aquamarine::COutputState::setExplicitInFence(int64_t fenceFD) {
}

void Aquamarine::COutputState::setExplicitOutFence(int64_t fenceFD) {
internalState.explicitOutFence = fenceFD;
// internalState.explicitOutFence = fenceFD;
internalState.committed |= AQ_OUTPUT_STATE_EXPLICIT_OUT_FENCE;
}

void Aquamarine::COutputState::onCommit() {
internalState.committed = 0;
internalState.damage.clear();

void Aquamarine::COutputState::resetExplicitFences() {
// fences are now used, let's reset them to not confuse ourselves later.
internalState.explicitInFence = -1;
internalState.explicitOutFence = -1;
}

void Aquamarine::COutputState::onCommit() {
internalState.committed = 0;
internalState.damage.clear();
}

0 comments on commit 1ae9ead

Please sign in to comment.