mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:47:35 +00:00
Kernel: Remove bogus VMObject resizing in VirtIOGPU
It is not legal to resize a VMObject after it has been created. As far as I can tell, this code would never actually run since the object was already populated with physical pages due to using AllocationStrategy::AllocateNow.
This commit is contained in:
parent
055726ecf5
commit
846685fca2
2 changed files with 2 additions and 13 deletions
|
@ -127,20 +127,9 @@ VirtIOGPUResourceID VirtIOGPU::create_2d_resource(VirtIOGPURect rect)
|
|||
return resource_id;
|
||||
}
|
||||
|
||||
void VirtIOGPU::ensure_backing_storage(Region& region, size_t buffer_offset, size_t buffer_length, VirtIOGPUResourceID resource_id)
|
||||
void VirtIOGPU::ensure_backing_storage(Region const& region, size_t buffer_offset, size_t buffer_length, VirtIOGPUResourceID resource_id)
|
||||
{
|
||||
VERIFY(m_operation_lock.is_locked());
|
||||
// Allocate backing region
|
||||
auto& vm_object = region.vmobject();
|
||||
size_t desired_num_pages = page_round_up(buffer_offset + buffer_length);
|
||||
auto& pages = vm_object.physical_pages();
|
||||
for (size_t i = pages.size(); i < desired_num_pages / PAGE_SIZE; ++i) {
|
||||
auto page = MM.allocate_user_physical_page();
|
||||
// FIXME: Instead of verifying, fail the framebuffer resize operation
|
||||
VERIFY(!page.is_null());
|
||||
pages.append(move(page));
|
||||
}
|
||||
region.remap();
|
||||
|
||||
VERIFY(buffer_offset % PAGE_SIZE == 0);
|
||||
VERIFY(buffer_length % PAGE_SIZE == 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue