diff options
author | Simon Ser <contact@emersion.fr> | 2020-12-04 16:47:42 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-01-16 08:57:42 +0100 |
commit | b7c95d483ad9245e1280b77041f6f390d18ed03e (patch) | |
tree | e705ae0b16d426a35a483f096dc74479c1b57d83 /backend/drm | |
parent | 400f4e7f27811c9193025185504020e431a0b375 (diff) |
backend/drm: implement get_drm_fd
Diffstat (limited to 'backend/drm')
-rw-r--r-- | backend/drm/backend.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/backend/drm/backend.c b/backend/drm/backend.c index bd68c3e2..0acd4796 100644 --- a/backend/drm/backend.c +++ b/backend/drm/backend.c @@ -77,11 +77,22 @@ static clockid_t backend_get_presentation_clock(struct wlr_backend *backend) { return drm->clock; } +static int backend_get_drm_fd(struct wlr_backend *backend) { + struct wlr_drm_backend *drm = get_drm_backend_from_backend(backend); + + if (drm->parent) { + return drm->parent->fd; + } else { + return drm->fd; + } +} + static struct wlr_backend_impl backend_impl = { .start = backend_start, .destroy = backend_destroy, .get_renderer = backend_get_renderer, .get_presentation_clock = backend_get_presentation_clock, + .get_drm_fd = backend_get_drm_fd, }; bool wlr_backend_is_drm(struct wlr_backend *b) { |