mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-20 06:47:19 -04:00
render: replace wlr_renderer_get_drm_fd() with drm_dev_id
wlr_renderer_get_drm_fd() forces the renderer to open the DRM node and keep the FD around for no good reason. Instead, use dev_t to refer to a DRM device. This also removes footguns related to FD ownership.
This commit is contained in:
parent
ebef710746
commit
986a2d9f66
13 changed files with 91 additions and 146 deletions
|
|
@ -83,7 +83,7 @@ bool wlr_renderer_init_wl_display(struct wlr_renderer *r,
|
|||
}
|
||||
|
||||
if (wlr_renderer_get_texture_formats(r, WLR_BUFFER_CAP_DMABUF) != NULL &&
|
||||
wlr_renderer_get_drm_fd(r) >= 0 &&
|
||||
r->drm_dev_id != NULL &&
|
||||
wlr_linux_dmabuf_v1_create_with_renderer(wl_display, 4, r) == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -287,13 +287,6 @@ struct wlr_renderer *wlr_renderer_autocreate(struct wlr_backend *backend) {
|
|||
return renderer_autocreate(backend, -1);
|
||||
}
|
||||
|
||||
int wlr_renderer_get_drm_fd(struct wlr_renderer *r) {
|
||||
if (!r->impl->get_drm_fd) {
|
||||
return -1;
|
||||
}
|
||||
return r->impl->get_drm_fd(r);
|
||||
}
|
||||
|
||||
struct wlr_render_pass *wlr_renderer_begin_buffer_pass(struct wlr_renderer *renderer,
|
||||
struct wlr_buffer *buffer, const struct wlr_buffer_pass_options *options) {
|
||||
struct wlr_buffer_pass_options default_options = {0};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue