|
Hermes 0.7.0
Linux game streaming host
|
Ask the privileged broker for a Hermes-KMS card. More...
#include <optional>#include <string>#include <sys/types.h>Go to the source code of this file.
Classes | |
| struct | VDISPLAY::card_broker::card_t |
| A card the broker created, and the device nodes it was given. More... | |
Functions | |
| bool | VDISPLAY::card_broker::available () |
| Whether a broker socket is there to talk to. | |
| std::optional< card_t > | VDISPLAY::card_broker::create (std::optional< uid_t > session_account_uid=std::nullopt) |
| Ask for a new card on a private DRM seat. | |
| bool | VDISPLAY::card_broker::remove (const std::string &name) |
| Remove a card this user created. Removal is a hot-unplug, so a compositor still holding the card sees ENODEV rather than a device disappearing under it. | |
| int | VDISPLAY::card_broker::sweep () |
| Remove every card this user still holds, and report how many went. | |
Ask the privileged broker for a Hermes-KMS card.
Definition in file card_broker.h.
| bool VDISPLAY::card_broker::available | ( | ) |
Whether a broker socket is there to talk to.
False on every host that has not installed and enabled the broker, which is the normal case; callers fall back to the statically configured pool.
Definition at line 225 of file card_broker.cpp.
| std::optional< card_t > VDISPLAY::card_broker::create | ( | std::optional< uid_t > | session_account_uid = std::nullopt | ) |
Ask for a new card on a private DRM seat.
The broker picks the session index, because that index is what the driver's udev rules turn into a seat and its seatd instance: two cards sharing one would share a seat. Fails when the caller's uid is not in the broker's allow file, when it already holds as many cards as it may, or when every private seat is in use.
| session_account_uid | When set, the card belongs to that uid - a Hermes session account, which the broker verifies - instead of to the caller. An isolated session's compositor runs as hermes-sNN, and the driver's udev rules hand the card's device nodes to its access_uid, so a card made for the host user is one the session could never open. |
Definition at line 230 of file card_broker.cpp.
| bool VDISPLAY::card_broker::remove | ( | const std::string & | name | ) |
Remove a card this user created. Removal is a hot-unplug, so a compositor still holding the card sees ENODEV rather than a device disappearing under it.
Definition at line 249 of file card_broker.cpp.
| int VDISPLAY::card_broker::sweep | ( | ) |
Remove every card this user still holds, and report how many went.
Cards outlive the process that asked for one, so a Hermes that died without removing its own would strand a card and its private seat. Sweeping at startup - when this Hermes owns none by definition - is what collects them.
Definition at line 256 of file card_broker.cpp.