drm: fix fences according to spec (#105)

This commit is contained in:
UjinT34 2024-11-12 00:29:19 +03:00 committed by GitHub
parent ae32a98232
commit 545f506a63
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 6 deletions

View file

@ -68,7 +68,7 @@ namespace Aquamarine {
Hyprutils::Memory::CSharedPointer<SOutputMode> customMode; Hyprutils::Memory::CSharedPointer<SOutputMode> customMode;
uint32_t drmFormat = DRM_FORMAT_INVALID; uint32_t drmFormat = DRM_FORMAT_INVALID;
Hyprutils::Memory::CSharedPointer<IBuffer> buffer; Hyprutils::Memory::CSharedPointer<IBuffer> buffer;
int64_t explicitInFence = -1, explicitOutFence = -1; int32_t explicitInFence = -1, explicitOutFence = -1;
Hyprutils::Math::Mat3x3 ctm; Hyprutils::Math::Mat3x3 ctm;
}; };
@ -84,8 +84,8 @@ namespace Aquamarine {
void setCustomMode(Hyprutils::Memory::CSharedPointer<SOutputMode> mode); void setCustomMode(Hyprutils::Memory::CSharedPointer<SOutputMode> mode);
void setFormat(uint32_t drmFormat); void setFormat(uint32_t drmFormat);
void setBuffer(Hyprutils::Memory::CSharedPointer<IBuffer> buffer); void setBuffer(Hyprutils::Memory::CSharedPointer<IBuffer> buffer);
void setExplicitInFence(int64_t fenceFD); // -1 removes void setExplicitInFence(int32_t fenceFD); // -1 removes
void setExplicitOutFence(int64_t fenceFD); // -1 removes void enableExplicitOutFenceForNextCommit();
void resetExplicitFences(); void resetExplicitFences();
void setCTM(const Hyprutils::Math::Mat3x3& ctm); void setCTM(const Hyprutils::Math::Mat3x3& ctm);

View file

@ -99,13 +99,12 @@ void Aquamarine::COutputState::setBuffer(Hyprutils::Memory::CSharedPointer<IBuff
internalState.committed |= AQ_OUTPUT_STATE_BUFFER; internalState.committed |= AQ_OUTPUT_STATE_BUFFER;
} }
void Aquamarine::COutputState::setExplicitInFence(int64_t fenceFD) { void Aquamarine::COutputState::setExplicitInFence(int32_t fenceFD) {
internalState.explicitInFence = fenceFD; internalState.explicitInFence = fenceFD;
internalState.committed |= AQ_OUTPUT_STATE_EXPLICIT_IN_FENCE; internalState.committed |= AQ_OUTPUT_STATE_EXPLICIT_IN_FENCE;
} }
void Aquamarine::COutputState::setExplicitOutFence(int64_t fenceFD) { void Aquamarine::COutputState::enableExplicitOutFenceForNextCommit() {
// internalState.explicitOutFence = fenceFD;
internalState.committed |= AQ_OUTPUT_STATE_EXPLICIT_OUT_FENCE; internalState.committed |= AQ_OUTPUT_STATE_EXPLICIT_OUT_FENCE;
} }