mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 21:05:58 +01:00
render/drm_dumb_allocator: check for DRM master
If we aren't the DRM master, allocating dumb buffers will fail with EPERM.
This commit is contained in:
parent
6605d7c390
commit
5c30cf3d94
1 changed files with 5 additions and 0 deletions
|
@ -195,6 +195,11 @@ static const struct wlr_allocator_interface allocator_impl = {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct wlr_allocator *wlr_drm_dumb_allocator_create(int fd) {
|
struct wlr_allocator *wlr_drm_dumb_allocator_create(int fd) {
|
||||||
|
if (!drmIsMaster(fd)) {
|
||||||
|
wlr_log(WLR_ERROR, "Cannot use DRM dumb buffers with non-master DRM FD");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Re-open the DRM node to avoid GEM handle ref'counting issues. See:
|
/* Re-open the DRM node to avoid GEM handle ref'counting issues. See:
|
||||||
* https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/110
|
* https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/110
|
||||||
* TODO: don't assume we have the permission to just open the DRM node,
|
* TODO: don't assume we have the permission to just open the DRM node,
|
||||||
|
|
Loading…
Reference in a new issue