1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 00:27:43 +00:00

LibVirtGPU: Create and initialize device from file descriptor

This commit is contained in:
Stephan Unverwerth 2022-12-22 15:08:40 +01:00 committed by Andreas Kling
parent 4b792cb7be
commit 086c7c4c88
2 changed files with 16 additions and 1 deletions

View file

@ -11,9 +11,16 @@
namespace VirtGPU {
Device::Device(NonnullRefPtr<Core::File> gpu_file)
: m_gpu_file { gpu_file }
{
}
ErrorOr<NonnullOwnPtr<Device>> Device::create(Gfx::IntSize)
{
return make<Device>();
auto file = TRY(Core::File::open("/dev/gpu/render0", Core::OpenMode::ReadWrite));
auto device = make<Device>(file);
return device;
}
GPU::DeviceInfo Device::info() const