summaryrefslogtreecommitdiff
path: root/Kernel/Graphics
diff options
context:
space:
mode:
authorSahan Fernando <sahan.h.fernando@gmail.com>2022-02-13 17:14:26 +1100
committerAndreas Kling <kling@serenityos.org>2022-02-13 10:17:40 +0100
commit4587e50b52e01a795f284d3c48a363b5e15d1d97 (patch)
treed34394f8a98e3fbed5e5590232b9886fbf24e484 /Kernel/Graphics
parentf6f277debd25f4d15203a8ae7e0570e8c249d455 (diff)
downloadserenity-4587e50b52e01a795f284d3c48a363b5e15d1d97.zip
Kernel: Fix deadlock when setting VirtIOGPU resolution
Diffstat (limited to 'Kernel/Graphics')
-rw-r--r--Kernel/Graphics/VirtIOGPU/FramebufferDevice.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/Kernel/Graphics/VirtIOGPU/FramebufferDevice.cpp b/Kernel/Graphics/VirtIOGPU/FramebufferDevice.cpp
index f14d1be6ea..9e4d3a9c01 100644
--- a/Kernel/Graphics/VirtIOGPU/FramebufferDevice.cpp
+++ b/Kernel/Graphics/VirtIOGPU/FramebufferDevice.cpp
@@ -84,8 +84,6 @@ ErrorOr<void> FramebufferDevice::set_head_resolution(size_t head, size_t width,
auto& info = display_info();
- SpinlockLocker locker(adapter()->operation_lock());
-
info.rect = {
.x = 0,
.y = 0,
@@ -167,6 +165,7 @@ FramebufferDevice::~FramebufferDevice()
ErrorOr<void> FramebufferDevice::create_framebuffer()
{
+ SpinlockLocker locker(adapter()->operation_lock());
// First delete any existing framebuffers to free the memory first
m_framebuffer = nullptr;
m_framebuffer_sink_vmobject = nullptr;
@@ -185,7 +184,6 @@ ErrorOr<void> FramebufferDevice::create_framebuffer()
}
m_framebuffer_sink_vmobject = TRY(Memory::AnonymousVMObject::try_create_with_physical_pages(pages.span()));
- SpinlockLocker locker(adapter()->operation_lock());
m_current_buffer = &buffer_from_index(m_last_set_buffer_index.load());
create_buffer(m_main_buffer, 0, m_buffer_size);
create_buffer(m_back_buffer, m_buffer_size, m_buffer_size);