1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 20:15:07 +00:00

Kernel: Implement buffer flipping for VirtIOGPU framebuffers

This solves tearing issues and improves performance when updating the
VirtIOGPU framebuffers.
This commit is contained in:
Tom 2021-07-03 20:42:38 -06:00 committed by Andreas Kling
parent 6e792553f2
commit 7fdf902e4a
7 changed files with 148 additions and 65 deletions

View file

@ -215,6 +215,17 @@ int FramebufferDevice::ioctl(FileDescription&, unsigned request, FlatPtr arg)
return -EFAULT;
return 0;
}
case FB_IOCTL_GET_BUFFER_OFFSET: {
FBBufferOffset buffer_offset;
if (!copy_from_user(&buffer_offset, (FBBufferOffset*)arg))
return -EFAULT;
if (buffer_offset.buffer_index != 0 && buffer_offset.buffer_index != 1)
return -EINVAL;
buffer_offset.offset = (size_t)buffer_offset.buffer_index * m_framebuffer_pitch * m_framebuffer_height;
if (!copy_to_user((FBBufferOffset*)arg, &buffer_offset))
return -EFAULT;
return 0;
}
case FB_IOCTL_FLUSH_BUFFERS:
return -ENOTSUP;
default: