From 6384f4acf4e2988bcb35d3dfc5821f07867a34d0 Mon Sep 17 00:00:00 2001 From: Lee Bousfield Date: Sat, 22 Mar 2025 11:13:44 -0500 Subject: core/compositor: Correctly track SHM buffer damage (#9678) --- src/protocols/core/Shm.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/protocols/core/Shm.cpp') diff --git a/src/protocols/core/Shm.cpp b/src/protocols/core/Shm.cpp index 37a48fd3..420b4a3f 100644 --- a/src/protocols/core/Shm.cpp +++ b/src/protocols/core/Shm.cpp @@ -22,19 +22,12 @@ CWLSHMBuffer::CWLSHMBuffer(SP pool_, uint32_t id, int32_t of offset = offset_; opaque = NFormatUtils::isFormatOpaque(NFormatUtils::shmToDRM(fmt_)); - texture = makeShared(NFormatUtils::shmToDRM(fmt), (uint8_t*)pool->data + offset, stride, size_); - resource = CWLBufferResource::create(makeShared(pool_->resource->client(), 1, id)); listeners.bufferResourceDestroy = events.destroy.registerListener([this](std::any d) { listeners.bufferResourceDestroy.reset(); PROTO::shm->destroyResource(this); }); - - success = texture->m_iTexID; - - if UNLIKELY (!success) - Debug::log(ERR, "Failed creating a shm texture: null texture id"); } CWLSHMBuffer::~CWLSHMBuffer() { @@ -74,11 +67,11 @@ void CWLSHMBuffer::endDataPtr() { } bool CWLSHMBuffer::good() { - return success; + return true; } void CWLSHMBuffer::update(const CRegion& damage) { - texture->update(NFormatUtils::shmToDRM(fmt), (uint8_t*)pool->data + offset, stride, damage); + ; } CSHMPool::CSHMPool(CFileDescriptor fd_, size_t size_) : fd(std::move(fd_)), size(size_), data(mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd.get(), 0)) { -- cgit v1.2.3