diff options
author | Andreas Kling <kling@serenityos.org> | 2021-08-06 22:25:00 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-06 22:25:00 +0200 |
commit | 2cd8b21974993052fdcb0bddfa62423dbeb6002a (patch) | |
tree | 25a7b2de5cf157d17ae71224cf3ae3ee3574959c /Kernel/Graphics/VirtIOGPU | |
parent | 47bdd7c3a01b7e21e56a5d1dd40b18e9ed43f466 (diff) | |
download | serenity-2cd8b21974993052fdcb0bddfa62423dbeb6002a.zip |
Kernel: Add convenience values to the Memory::Region::Access enum
Instead of `Memory::Region::Access::Read | Memory::Region::AccessWrite`
you can now say `Memory::Region::Access::ReadWrite`.
Diffstat (limited to 'Kernel/Graphics/VirtIOGPU')
-rw-r--r-- | Kernel/Graphics/VirtIOGPU/FrameBufferDevice.cpp | 2 | ||||
-rw-r--r-- | Kernel/Graphics/VirtIOGPU/GPU.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Graphics/VirtIOGPU/FrameBufferDevice.cpp b/Kernel/Graphics/VirtIOGPU/FrameBufferDevice.cpp index 3b360d79d8..b338c6528f 100644 --- a/Kernel/Graphics/VirtIOGPU/FrameBufferDevice.cpp +++ b/Kernel/Graphics/VirtIOGPU/FrameBufferDevice.cpp @@ -32,7 +32,7 @@ void FrameBufferDevice::create_framebuffer() // Allocate frame buffer for both front and back auto& info = display_info(); m_buffer_size = calculate_framebuffer_size(info.rect.width, info.rect.height); - m_framebuffer = MM.allocate_kernel_region(m_buffer_size * 2, String::formatted("VirtGPU FrameBuffer #{}", m_scanout.value()), Memory::Region::Access::Read | Memory::Region::Access::Write, AllocationStrategy::AllocateNow); + m_framebuffer = MM.allocate_kernel_region(m_buffer_size * 2, String::formatted("VirtGPU FrameBuffer #{}", m_scanout.value()), Memory::Region::Access::ReadWrite, AllocationStrategy::AllocateNow); auto write_sink_page = MM.allocate_user_physical_page(Memory::MemoryManager::ShouldZeroFill::No).release_nonnull(); auto num_needed_pages = m_framebuffer->vmobject().page_count(); diff --git a/Kernel/Graphics/VirtIOGPU/GPU.cpp b/Kernel/Graphics/VirtIOGPU/GPU.cpp index 1600d01531..8b0a0591fe 100644 --- a/Kernel/Graphics/VirtIOGPU/GPU.cpp +++ b/Kernel/Graphics/VirtIOGPU/GPU.cpp @@ -17,7 +17,7 @@ namespace Kernel::Graphics::VirtIOGPU { GPU::GPU(PCI::Address address) : VirtIODevice(address, "GPU") - , m_scratch_space(MM.allocate_contiguous_kernel_region(32 * PAGE_SIZE, "VirtGPU Scratch Space", Memory::Region::Access::Read | Memory::Region::Access::Write)) + , m_scratch_space(MM.allocate_contiguous_kernel_region(32 * PAGE_SIZE, "VirtGPU Scratch Space", Memory::Region::Access::ReadWrite)) { VERIFY(!!m_scratch_space); if (auto cfg = get_config(ConfigurationType::Device)) { |