core: fix hyplock on proprietary nvidia drivers#654
core: fix hyplock on proprietary nvidia drivers#654PointerDilemma wants to merge 3 commits intohyprwm:mainfrom
Conversation
9c5a667 to
da72e51
Compare
|
Initially i though our problem was described by this comment: NVIDIA/egl-wayland#98 (comment) So i made sure we always prepare_read to sync our reads, Not blocking in It seems like sometimes we are not getting a POLLIN wl event for a |
|
I also tried using the presentation_time protocol instead of frame callbacks, but that has the exact same problems. |
To me it seems like this is either a problem that we can't fix when we want to use poll for the purpose of waking on wayland events, or there is some weird interaction with some egl stuff that we do. Maybe we can set the poll timeout to 0 for as long as we expect a frame callback to arrive. |
|
Yeah actually something like that seems to work bool expectingFrameCallback = std::find_if(m_vOutputs.begin(), m_vOutputs.end(),
[](const auto& o) { return o->sessionLockSurface && o->sessionLockSurface->expectingFrameCallback(); }) != m_vOutputs.end();
int ret = poll(pollfds, fdcount, (expectingFrameCallback) ? 0 : timeout);
|
9cf9c79 to
f576bbd
Compare
|
Yeah i mean... stutters are gone and still idles properly. |
|
@vaxerski anything against removing |
src/core/hyprlock.cpp
Outdated
| //TODO: if we call this from the same thread that we handle timers, everything is fine, | ||
| // but if we are currently in poll, and call this from another thread, we need a way to wake up the poll |
There was a problem hiding this comment.
Idk how to handle that though.
Maybe an extra pollFd for waking internally??
|
Also works smoothly on my old laptop with 3rd gen intel integrated graphics |
3031f61 to
fdd75c0
Compare
|
this is a bad try to work around the problem. cpu is busy when are not idle. |
This was done, so that we can wl_display_prepare_read -> poll -> wl_display_read_events Fixes synchronization issues, that happen on nvidia proprietary drivers.
|
Ok so i found that doing To allow for that I moved all of the wayland event reading to the poll thread. Dispatch obviously still only in the event loop thread. Seems to work nicely. |
|
Happy with it now. Gonna close this in favour of 2 seperate patches. |
Goal: Make it work with proprietary nvidia drivers
TODO:
background:path=screenshot