1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:47:34 +00:00

Userland: Re-organize /dev GPU nodes

This commit is contained in:
Liav A 2022-04-29 14:21:16 +03:00 committed by Andreas Kling
parent 912b8ab965
commit b401f278ad
2 changed files with 8 additions and 2 deletions

View file

@ -134,7 +134,7 @@ static Vector<VertexData> gen_vertex_data()
static void init() static void init()
{ {
// Open the device // Open the device
gpu_fd = open("/dev/gpu0", O_RDWR); gpu_fd = open("/dev/gpu/render0", O_RDWR);
VERIFY(gpu_fd >= 0); VERIFY(gpu_fd >= 0);
// Create a virgl context for this file descriptor // Create a virgl context for this file descriptor
VERIFY(ioctl(gpu_fd, VIRGL_IOCTL_CREATE_CONTEXT) >= 0); VERIFY(ioctl(gpu_fd, VIRGL_IOCTL_CREATE_CONTEXT) >= 0);

View file

@ -209,7 +209,11 @@ static void populate_devtmpfs_devices_based_on_devctl()
break; break;
} }
case 28: { case 28: {
create_devtmpfs_block_device(String::formatted("/dev/gpu{}", minor_number), 0666, 28, minor_number); create_devtmpfs_block_device(String::formatted("/dev/gpu/render{}", minor_number), 0666, 28, minor_number);
break;
}
case 226: {
create_devtmpfs_char_device(String::formatted("/dev/gpu/connector{}", minor_number), 0666, 226, minor_number);
break; break;
} }
case 29: { case 29: {
@ -396,6 +400,8 @@ static ErrorOr<void> prepare_synthetic_filesystems()
TRY(Core::System::symlink("/proc/self/fd/1", "/dev/stdout")); TRY(Core::System::symlink("/proc/self/fd/1", "/dev/stdout"));
TRY(Core::System::symlink("/proc/self/fd/2", "/dev/stderr")); TRY(Core::System::symlink("/proc/self/fd/2", "/dev/stderr"));
TRY(Core::System::mkdir("/dev/gpu", 0755));
populate_devtmpfs(); populate_devtmpfs();
TRY(Core::System::mkdir("/dev/pts", 0755)); TRY(Core::System::mkdir("/dev/pts", 0755));