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.
This commit is contained in:
Tom Englund 2025-08-24 09:57:37 +02:00 committed by GitHub
parent d9cf1cb78e
commit ced38b1b0f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 27 additions and 13 deletions

View file

@ -27,9 +27,9 @@ UP<CSyncReleaser> CDRMSyncPointState::createSyncRelease() {
return makeUnique<CSyncReleaser>(m_timeline, m_point);
}
bool CDRMSyncPointState::addWaiter(const std::function<void()>& waiter) {
bool CDRMSyncPointState::addWaiter(std::function<void()>&& waiter) {
m_acquireCommitted = true;
return m_timeline->addWaiter(waiter, m_point, 0u);
return m_timeline->addWaiter(std::move(waiter), m_point, 0u);
}
bool CDRMSyncPointState::committed() {

View file

@ -20,7 +20,7 @@ class CDRMSyncPointState {
const uint64_t& point();
WP<CSyncTimeline> timeline();
Hyprutils::Memory::CUniquePointer<CSyncReleaser> createSyncRelease();
bool addWaiter(const std::function<void()>& waiter);
bool addWaiter(std::function<void()>&& waiter);
bool committed();
Hyprutils::OS::CFileDescriptor exportAsFD();
void signal();

View file

@ -161,7 +161,7 @@ CWLSurfaceResource::CWLSurfaceResource(SP<CWlSurface> resource_) : m_resource(re
if (state->updated.bits.acquire) {
// wait on acquire point for this surface, from explicit sync protocol
state->acquire.addWaiter(whenReadable);
state->acquire.addWaiter(std::move(whenReadable));
} else if (state->buffer->isSynchronous()) {
// synchronous (shm) buffers can be read immediately
whenReadable();
@ -170,7 +170,7 @@ CWLSurfaceResource::CWLSurfaceResource(SP<CWlSurface> resource_) : m_resource(re
auto syncFd = dc<CDMABuffer*>(state->buffer.m_buffer.get())->exportSyncFile();
if (syncFd.isValid())
g_pEventLoopManager->doOnReadable(std::move(syncFd), whenReadable);
g_pEventLoopManager->doOnReadable(std::move(syncFd), std::move(whenReadable));
else
whenReadable();
} else {

View file

@ -118,8 +118,12 @@ CFileDescriptor CDMABuffer::exportSyncFile() {
if (fd == -1)
continue;
if (CFileDescriptor::isReadable(fd))
continue;
// buffer readability checks are rather slow on some Intel laptops
// see https://gitlab.freedesktop.org/drm/intel/-/issues/9415
if (g_pHyprRenderer && !g_pHyprRenderer->isIntel()) {
if (CFileDescriptor::isReadable(fd))
continue;
}
dma_buf_export_sync_file request{
.flags = DMA_BUF_SYNC_READ,