mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-26 08:56:29 -05:00
render/allocator: re-open GBM FD
Using the same DRM file description for the DRM backend and for the GBM allocator will result in GEM handle ref'counting issues [1]. Re-open the DRM FD to fix these issues. [1]: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/110
This commit is contained in:
parent
c8d97e2791
commit
d9d8fc1ab9
3 changed files with 42 additions and 32 deletions
|
|
@ -163,13 +163,7 @@ static struct wlr_gbm_allocator *get_gbm_alloc_from_alloc(
|
|||
return (struct wlr_gbm_allocator *)alloc;
|
||||
}
|
||||
|
||||
struct wlr_allocator *wlr_gbm_allocator_create(int drm_fd) {
|
||||
int fd = fcntl(drm_fd, F_DUPFD_CLOEXEC, 0);
|
||||
if (fd < 0) {
|
||||
wlr_log(WLR_ERROR, "fcntl(F_DUPFD_CLOEXEC) failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct wlr_allocator *wlr_gbm_allocator_create(int fd) {
|
||||
uint64_t cap;
|
||||
if (drmGetCap(fd, DRM_CAP_PRIME, &cap) ||
|
||||
!(cap & DRM_PRIME_CAP_EXPORT)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue