Louvre  v2.12.0-1
C++ library for Wayland compositors
Public Member Functions | List of all members
LGPU Class Referencefinal

GPU Information. More...

+ Inheritance diagram for LGPU:

Public Member Functions

const std::string & name () const noexcept
 Gets the GPU name. More...
 
dev_t dev () const noexcept
 Gets the Unix device identifier. More...
 
int id () const noexcept
 Gets the Libseat device ID. More...
 
int fd () const noexcept
 Gets the read-write file descriptor. More...
 
int roFd () const noexcept
 Gets the read-only file descriptor. More...
 

Detailed Description

GPU Information.

This class typically contains information about a DRM node, however, its properties could have different meanings when using virtualized backends.

To see all available devices, use LSeat::gpus(). For a particular output, use LOutput::gpu().

Member Function Documentation

◆ name()

const std::string& name ( ) const
inlinenoexcept

Gets the GPU name.

When using the DRM backend, this can be, e.g., /dev/dri/card0.

◆ dev()

dev_t dev ( ) const
inlinenoexcept

Gets the Unix device identifier.

◆ id()

int id ( ) const
inlinenoexcept

Gets the Libseat device ID.

Returns
A Libseat device ID, or -1 if the device was not opened with Libseat.

◆ fd()

int fd ( ) const
inlinenoexcept

Gets the read-write file descriptor.

Warning
Do not attempt to close it or use it unless you know what you're doing.
Returns
A read-write file descriptor, or -1 if the backend doesn't provide it.

◆ roFd()

int roFd ( ) const
inlinenoexcept

Gets the read-only file descriptor.

Returns
A read-only file descriptor, or -1 if the backend doesn't provide it.