summaryrefslogtreecommitdiff
path: root/src/managers/eventLoop
diff options
context:
space:
mode:
authorTom Englund <tomenglund26@gmail.com>2025-08-24 09:57:37 +0200
committerGitHub <noreply@github.com>2025-08-24 08:57:37 +0100
commitced38b1b0f46f9fbdf9d37644d27bdbd2a29af1d (patch)
tree1518e6ba2d2ad3803ae74be86f6921321cf7e305 /src/managers/eventLoop
parentd9cf1cb78ef3dfd82f03965aab70792bbe25c9e2 (diff)
disable buffer readability checks on intel (#11515)
* dmabuf: disable buffer read check on intel readability checks directly on buffer fds on some intel laptops is broken, see https://gitlab.freedesktop.org/drm/intel/-/issues/9415 * sync: use rvalue ref in addwaiter doonreadable use rvalue reference in addwaiter and doonreadable, because we store the function in the SReadableWaiter a lot of the time, move it into place there when that happends or let it go out of scope after function call.
Diffstat (limited to 'src/managers/eventLoop')
-rw-r--r--src/managers/eventLoop/EventLoopManager.cpp4
-rw-r--r--src/managers/eventLoop/EventLoopManager.hpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/managers/eventLoop/EventLoopManager.cpp b/src/managers/eventLoop/EventLoopManager.cpp
index 3297d31e..1426e424 100644
--- a/src/managers/eventLoop/EventLoopManager.cpp
+++ b/src/managers/eventLoop/EventLoopManager.cpp
@@ -193,13 +193,13 @@ void CEventLoopManager::doLater(const std::function<void()>& fn) {
&m_idle);
}
-void CEventLoopManager::doOnReadable(CFileDescriptor fd, const std::function<void()>& fn) {
+void CEventLoopManager::doOnReadable(CFileDescriptor fd, std::function<void()>&& fn) {
if (!fd.isValid() || fd.isReadable()) {
fn();
return;
}
- auto& waiter = m_readableWaiters.emplace_back(makeUnique<SReadableWaiter>(nullptr, std::move(fd), fn));
+ auto& waiter = m_readableWaiters.emplace_back(makeUnique<SReadableWaiter>(nullptr, std::move(fd), std::move(fn)));
waiter->source = wl_event_loop_add_fd(g_pEventLoopManager->m_wayland.loop, waiter->fd.get(), WL_EVENT_READABLE, ::handleWaiterFD, waiter.get());
}
diff --git a/src/managers/eventLoop/EventLoopManager.hpp b/src/managers/eventLoop/EventLoopManager.hpp
index d3a67ae5..9963d4ae 100644
--- a/src/managers/eventLoop/EventLoopManager.hpp
+++ b/src/managers/eventLoop/EventLoopManager.hpp
@@ -63,7 +63,7 @@ class CEventLoopManager {
// schedule function to when fd is readable (WL_EVENT_READABLE / POLLIN),
// takes ownership of fd
- void doOnReadable(Hyprutils::OS::CFileDescriptor fd, const std::function<void()>& fn);
+ void doOnReadable(Hyprutils::OS::CFileDescriptor fd, std::function<void()>&& fn);
void onFdReadable(SReadableWaiter* waiter);
private: