Kernel: Sandbox each GPU3DDevice file description into own host context

This commit is contained in:
Sahan Fernando 2022-03-10 13:04:48 +11:00 committed by Ali Mohammad Pur
commit 683de841e5
Notes: sideshowbarker 2024-07-17 17:27:38 +09:00
4 changed files with 70 additions and 7 deletions

View file

@ -133,6 +133,8 @@ static void init()
// Open the device
gpu_fd = open("/dev/gpu0", O_RDWR);
VERIFY(gpu_fd >= 0);
// Create a virgl context for this file descriptor
VERIFY(ioctl(gpu_fd, VIRGL_IOCTL_CREATE_CONTEXT) >= 0);
// Create a VertexElements resource
VirGL3DResourceSpec vbo_spec {
.target = to_underlying(Gallium::PipeTextureTarget::BUFFER), // pipe_texture_target