mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibVirtGPU: Create and initialize device from file descriptor
This commit is contained in:
parent
4b792cb7be
commit
086c7c4c88
Notes:
sideshowbarker
2024-07-17 02:34:13 +09:00
Author: https://github.com/sunverwerth
Commit: 086c7c4c88
Pull-request: https://github.com/SerenityOS/serenity/pull/16590
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/ccapitalK
Reviewed-by: https://github.com/gmta ✅
Reviewed-by: https://github.com/supercomputer7 ✅
2 changed files with 16 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue