mirror of
https://github.com/hyprwm/aquamarine.git
synced 2024-11-17 06:06:00 +01:00
fixes but kernel dies again :(
This commit is contained in:
parent
cac883a39c
commit
1cdd74c967
2 changed files with 8 additions and 5 deletions
|
@ -64,15 +64,19 @@ Aquamarine::CDRMDumbBuffer::CDRMDumbBuffer(const SAllocatorBufferParams& params,
|
|||
return;
|
||||
}
|
||||
|
||||
// null the entire buffer so we dont get garbage
|
||||
memset(data, 0x00, size);
|
||||
// set the entire buffer so we dont get garbage
|
||||
memset(data, 0xFF, size);
|
||||
|
||||
attrs.success = true;
|
||||
|
||||
allocator->backend->log(AQ_LOG_DEBUG, std::format("DRM Dumb: Allocated a new buffer with drm id {}, size {} and format {}", idrmID, attrs.size, fourccToName(attrs.format)));
|
||||
}
|
||||
|
||||
Aquamarine::CDRMDumbBuffer::~CDRMDumbBuffer() {
|
||||
events.destroy.emit();
|
||||
|
||||
TRACE(allocator->backend->log(AQ_LOG_TRACE, std::format("DRM Dumb: dropping buffer {}", idrmID)));
|
||||
|
||||
if (handle == 0)
|
||||
return;
|
||||
|
||||
|
@ -121,7 +125,7 @@ void Aquamarine::CDRMDumbBuffer::endDataPtr() {
|
|||
}
|
||||
|
||||
uint32_t Aquamarine::CDRMDumbBuffer::drmID() {
|
||||
return handle;
|
||||
return idrmID;
|
||||
}
|
||||
|
||||
Aquamarine::CDRMDumbAllocator::~CDRMDumbAllocator() {
|
||||
|
|
|
@ -1863,7 +1863,6 @@ void Aquamarine::CDRMFB::import() {
|
|||
|
||||
TRACE(backend->backend->log(AQ_LOG_TRACE, std::format("drm: new buffer {}", id)));
|
||||
|
||||
// FIXME: why does this implode when it doesnt on wlroots or kwin?
|
||||
closeHandles();
|
||||
|
||||
listeners.destroyBuffer = buffer->events.destroy.registerListener([this](std::any d) {
|
||||
|
@ -1922,7 +1921,7 @@ void Aquamarine::CDRMFB::drop() {
|
|||
|
||||
dropped = true;
|
||||
|
||||
if (!id)
|
||||
if (!id || buffer->drmID() /* drmID means the buffer manages itself */)
|
||||
return;
|
||||
|
||||
closeHandles();
|
||||
|
|
Loading…
Reference in a new issue