drm: pass explicitOutFence pointer and do not touch the value (#10)

* pass explicitOutFence pointer and do not touch the value

* add resetExplicitFences
This commit is contained in:
UjinT34 2024-07-11 17:13:44 +03:00 committed by GitHub
parent d92d55d454
commit 1ae9ead82c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 7 deletions

View file

@ -82,6 +82,7 @@ namespace Aquamarine {
void setBuffer(Hyprutils::Memory::CSharedPointer<IBuffer> buffer); void setBuffer(Hyprutils::Memory::CSharedPointer<IBuffer> buffer);
void setExplicitInFence(int64_t fenceFD); // -1 removes void setExplicitInFence(int64_t fenceFD); // -1 removes
void setExplicitOutFence(int64_t fenceFD); // -1 removes void setExplicitOutFence(int64_t fenceFD); // -1 removes
void resetExplicitFences();
private: private:
SInternalState internalState; SInternalState internalState;

View file

@ -101,8 +101,8 @@ void Aquamarine::CDRMAtomicRequest::addConnector(Hyprutils::Memory::CSharedPoint
add(connector->crtc->id, connector->crtc->props.active, enable); add(connector->crtc->id, connector->crtc->props.active, enable);
if (enable) { if (enable) {
if (connector->output->supportsExplicit && STATE.explicitOutFence >= 0) if (connector->output->supportsExplicit && STATE.committed & COutputState::AQ_OUTPUT_STATE_EXPLICIT_OUT_FENCE)
add(connector->crtc->id, connector->crtc->props.out_fence_ptr, STATE.explicitOutFence); add(connector->crtc->id, connector->crtc->props.out_fence_ptr, (uintptr_t)&STATE.explicitOutFence);
if (connector->crtc->props.gamma_lut && data.atomic.gammad) if (connector->crtc->props.gamma_lut && data.atomic.gammad)
add(connector->crtc->id, connector->crtc->props.gamma_lut, data.atomic.gammaLut); add(connector->crtc->id, connector->crtc->props.gamma_lut, data.atomic.gammaLut);

View file

@ -101,15 +101,17 @@ void Aquamarine::COutputState::setExplicitInFence(int64_t fenceFD) {
} }
void Aquamarine::COutputState::setExplicitOutFence(int64_t fenceFD) { void Aquamarine::COutputState::setExplicitOutFence(int64_t fenceFD) {
internalState.explicitOutFence = fenceFD; // internalState.explicitOutFence = fenceFD;
internalState.committed |= AQ_OUTPUT_STATE_EXPLICIT_OUT_FENCE; internalState.committed |= AQ_OUTPUT_STATE_EXPLICIT_OUT_FENCE;
} }
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() { void Aquamarine::COutputState::onCommit() {
internalState.committed = 0; internalState.committed = 0;
internalState.damage.clear(); internalState.damage.clear();
// fences are now used, let's reset them to not confuse ourselves later.
internalState.explicitInFence = -1;
internalState.explicitOutFence = -1;
} }