1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:38:12 +00:00

Kernel: Turn VirtIOGPU operation lock from mutex into spinlock

This commit is contained in:
Andreas Kling 2022-02-03 15:43:54 +01:00
parent ca42621be1
commit 200589ba27
3 changed files with 7 additions and 7 deletions

View file

@ -83,7 +83,7 @@ ErrorOr<void> FramebufferDevice::set_head_resolution(size_t head, size_t width,
auto& info = display_info();
MutexLocker locker(adapter()->operation_lock());
SpinlockLocker locker(adapter()->operation_lock());
info.rect = {
.x = 0,
@ -109,7 +109,7 @@ ErrorOr<void> FramebufferDevice::flush_head_buffer(size_t)
}
ErrorOr<void> FramebufferDevice::flush_rectangle(size_t buffer_index, FBRect const& rect)
{
MutexLocker locker(adapter()->operation_lock());
SpinlockLocker locker(adapter()->operation_lock());
Protocol::Rect dirty_rect {
.x = rect.x,
.y = rect.y,
@ -184,7 +184,7 @@ ErrorOr<void> FramebufferDevice::create_framebuffer()
}
m_framebuffer_sink_vmobject = TRY(Memory::AnonymousVMObject::try_create_with_physical_pages(pages.span()));
MutexLocker locker(adapter()->operation_lock());
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);
@ -256,7 +256,7 @@ void FramebufferDevice::flush_displayed_image(Protocol::Rect const& dirty_rect,
void FramebufferDevice::set_buffer(int buffer_index)
{
auto& buffer = buffer_index == 0 ? m_main_buffer : m_back_buffer;
MutexLocker locker(adapter()->operation_lock());
SpinlockLocker locker(adapter()->operation_lock());
if (&buffer == m_current_buffer)
return;
m_current_buffer = &buffer;