summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2022-01-13 00:15:26 +0200
committerBrian Gianforcaro <b.gianfo@gmail.com>2022-01-13 00:20:08 -0800
commitec1f3abd34e5dc2bca2548777267bc094a74dc1f (patch)
treee1e45550f087e5eeb387fd60f8ff050113522d92 /Kernel
parent618f1234636bb668b0eab39b9ec7d88660c1cca1 (diff)
downloadserenity-ec1f3abd34e5dc2bca2548777267bc094a74dc1f.zip
Kernel: Use KString::formatted in FramebufferDevice::create_framebuffer
This allows us to avoid the infallible String::formatted.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Graphics/VirtIOGPU/FramebufferDevice.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Kernel/Graphics/VirtIOGPU/FramebufferDevice.cpp b/Kernel/Graphics/VirtIOGPU/FramebufferDevice.cpp
index cf2bdff614..888facb22f 100644
--- a/Kernel/Graphics/VirtIOGPU/FramebufferDevice.cpp
+++ b/Kernel/Graphics/VirtIOGPU/FramebufferDevice.cpp
@@ -164,7 +164,8 @@ ErrorOr<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 = TRY(MM.allocate_kernel_region(m_buffer_size * 2, String::formatted("VirtGPU FrameBuffer #{}", m_scanout.value()), Memory::Region::Access::ReadWrite, AllocationStrategy::AllocateNow));
+ auto region_name = TRY(KString::formatted("VirtGPU FrameBuffer #{}", m_scanout.value()));
+ m_framebuffer = TRY(MM.allocate_kernel_region(m_buffer_size * 2, region_name->view(), 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();