summaryrefslogtreecommitdiff
path: root/src/protocols/core/Shm.cpp
diff options
context:
space:
mode:
authorLee Bousfield <ljbousfield@gmail.com>2025-03-22 11:13:44 -0500
committerGitHub <noreply@github.com>2025-03-22 17:13:44 +0100
commit6384f4acf4e2988bcb35d3dfc5821f07867a34d0 (patch)
tree2da8d2275cc4acc435906c7fa84956ae2b17ade6 /src/protocols/core/Shm.cpp
parent4600043a498b015360a0f2b6f682ae82aff1b198 (diff)
core/compositor: Correctly track SHM buffer damage (#9678)
Diffstat (limited to 'src/protocols/core/Shm.cpp')
-rw-r--r--src/protocols/core/Shm.cpp11
1 files changed, 2 insertions, 9 deletions
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<CWLSHMPoolResource> pool_, uint32_t id, int32_t of
offset = offset_;
opaque = NFormatUtils::isFormatOpaque(NFormatUtils::shmToDRM(fmt_));
- texture = makeShared<CTexture>(NFormatUtils::shmToDRM(fmt), (uint8_t*)pool->data + offset, stride, size_);
-
resource = CWLBufferResource::create(makeShared<CWlBuffer>(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)) {