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:
parent
6e792553f2
commit
7fdf902e4a
7 changed files with 148 additions and 65 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue