mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-26 06:35:58 +01:00
Check for DRM prime
This will indicate the user properly when multi-GPU is not supported by their GPU driver.
This commit is contained in:
parent
e8fa25e027
commit
2d8f53affd
1 changed files with 17 additions and 0 deletions
|
@ -27,6 +27,23 @@
|
|||
#include "util/signal.h"
|
||||
|
||||
bool check_drm_features(struct wlr_drm_backend *drm) {
|
||||
if (drm->parent) {
|
||||
uint64_t cap;
|
||||
if (drmGetCap(drm->fd, DRM_CAP_PRIME, &cap) ||
|
||||
!(cap & DRM_PRIME_CAP_IMPORT)) {
|
||||
wlr_log(WLR_ERROR,
|
||||
"PRIME import not supported on secondary GPU");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (drmGetCap(drm->parent->fd, DRM_CAP_PRIME, &cap) ||
|
||||
!(cap & DRM_PRIME_CAP_EXPORT)) {
|
||||
wlr_log(WLR_ERROR,
|
||||
"PRIME export not supported on primary GPU");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (drmSetClientCap(drm->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1)) {
|
||||
wlr_log(WLR_ERROR, "DRM universal planes unsupported");
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue