Explorar el Código

Kernel: Use KString::formatted in FramebufferDevice::create_framebuffer

This allows us to avoid the infallible String::formatted.
Idan Horowitz hace 3 años
padre
commit
ec1f3abd34
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      Kernel/Graphics/VirtIOGPU/FramebufferDevice.cpp

+ 2 - 1
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();