buffers: revert state merging (#12461)
8e8bfbb0b1 added fifo and merged non
buffer states before comitting them, something about certain xwl non
buffer commits expects a commit to happend and causes regressions as in
low fps.
This commit is contained in:
parent
40d8fa8491
commit
210930bef9
4 changed files with 14 additions and 36 deletions
|
|
@ -550,13 +550,6 @@ void CWLSurfaceResource::commitState(SSurfaceState& state) {
|
||||||
nullptr);
|
nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_current.updated.bits.damage) {
|
|
||||||
// damage is always relative to the current commit
|
|
||||||
m_current.updated.bits.damage = false;
|
|
||||||
m_current.damage.clear();
|
|
||||||
m_current.bufferDamage.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
// release the buffer if it's synchronous (SHM) as updateSynchronousTexture() has copied the buffer data to a GPU tex
|
// release the buffer if it's synchronous (SHM) as updateSynchronousTexture() has copied the buffer data to a GPU tex
|
||||||
// if it doesn't have a role, we can't release it yet, in case it gets turned into a cursor.
|
// if it doesn't have a role, we can't release it yet, in case it gets turned into a cursor.
|
||||||
if (m_current.buffer && m_current.buffer->isSynchronous() && m_role->role() != SURFACE_ROLE_UNASSIGNED)
|
if (m_current.buffer && m_current.buffer->isSynchronous() && m_role->role() != SURFACE_ROLE_UNASSIGNED)
|
||||||
|
|
|
||||||
|
|
@ -65,11 +65,8 @@ void SSurfaceState::reset() {
|
||||||
lockMask = LOCK_REASON_NONE;
|
lockMask = LOCK_REASON_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SSurfaceState::updateFrom(SSurfaceState& ref, bool merge) {
|
void SSurfaceState::updateFrom(SSurfaceState& ref) {
|
||||||
if (merge)
|
updated = ref.updated;
|
||||||
updated.all |= ref.updated.all;
|
|
||||||
else
|
|
||||||
updated = ref.updated;
|
|
||||||
|
|
||||||
if (ref.updated.bits.buffer) {
|
if (ref.updated.bits.buffer) {
|
||||||
buffer = ref.buffer;
|
buffer = ref.buffer;
|
||||||
|
|
@ -81,6 +78,10 @@ void SSurfaceState::updateFrom(SSurfaceState& ref, bool merge) {
|
||||||
if (ref.updated.bits.damage) {
|
if (ref.updated.bits.damage) {
|
||||||
damage = ref.damage;
|
damage = ref.damage;
|
||||||
bufferDamage = ref.bufferDamage;
|
bufferDamage = ref.bufferDamage;
|
||||||
|
} else {
|
||||||
|
// damage is always relative to the current commit
|
||||||
|
damage.clear();
|
||||||
|
bufferDamage.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ref.updated.bits.input)
|
if (ref.updated.bits.input)
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ struct SSurfaceState {
|
||||||
void updateSynchronousTexture(SP<CTexture> lastTexture);
|
void updateSynchronousTexture(SP<CTexture> lastTexture);
|
||||||
|
|
||||||
// helpers
|
// helpers
|
||||||
CRegion accumulateBufferDamage(); // transforms state.damage and merges it into state.bufferDamage
|
CRegion accumulateBufferDamage(); // transforms state.damage and merges it into state.bufferDamage
|
||||||
void updateFrom(SSurfaceState& ref, bool merge = false); // updates this state based on a reference state.
|
void updateFrom(SSurfaceState& ref); // updates this state based on a reference state.
|
||||||
void reset(); // resets pending state after commit
|
void reset(); // resets pending state after commit
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -63,28 +63,12 @@ auto CSurfaceStateQueue::find(const WP<SSurfaceState>& state) -> std::deque<UP<S
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSurfaceStateQueue::tryProcess() {
|
void CSurfaceStateQueue::tryProcess() {
|
||||||
if (m_queue.empty())
|
while (!m_queue.empty()) {
|
||||||
return;
|
auto& front = m_queue.front();
|
||||||
|
if (front->lockMask != LOCK_REASON_NONE)
|
||||||
|
return;
|
||||||
|
|
||||||
auto front = m_queue.begin();
|
m_surface->commitState(*front);
|
||||||
if (front->get()->lockMask != LOCK_REASON_NONE)
|
|
||||||
return;
|
|
||||||
|
|
||||||
auto next = std::next(front);
|
|
||||||
if (next == m_queue.end()) {
|
|
||||||
m_surface->commitState(**front);
|
|
||||||
m_queue.pop_front();
|
m_queue.pop_front();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!m_queue.empty() && next != m_queue.end() && next->get()->lockMask == LOCK_REASON_NONE && !next->get()->updated.bits.buffer) {
|
|
||||||
next->get()->updateFrom(**front, true);
|
|
||||||
m_queue.pop_front();
|
|
||||||
|
|
||||||
front = m_queue.begin();
|
|
||||||
next = std::next(front);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_surface->commitState(**front);
|
|
||||||
m_queue.pop_front();
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue