mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-01 22:58:38 -04:00
drm: check for PRIME support
PRIME support for buffer sharing has become mandatory since the renderer rewrite. Make sure we check for the appropriate capabilities in backend, allocator and renderer. See also #2819.
This commit is contained in:
parent
d5105c42e3
commit
9f012cac2f
3 changed files with 18 additions and 7 deletions
|
|
@ -160,6 +160,13 @@ static struct wlr_gbm_allocator *get_gbm_alloc_from_alloc(
|
|||
}
|
||||
|
||||
struct wlr_gbm_allocator *wlr_gbm_allocator_create(int fd) {
|
||||
uint64_t cap;
|
||||
if (drmGetCap(fd, DRM_CAP_PRIME, &cap) ||
|
||||
!(cap & DRM_PRIME_CAP_EXPORT)) {
|
||||
wlr_log(WLR_ERROR, "PRIME export not supported");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct wlr_gbm_allocator *alloc = calloc(1, sizeof(*alloc));
|
||||
if (alloc == NULL) {
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue