mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-01 22:58:38 -04:00
render: introduce wlr_renderer_get_dmabuf_render_formats
It describes which DMA-BUF formats can be used to render.
This commit is contained in:
parent
61612ecb36
commit
5d008d9030
6 changed files with 41 additions and 0 deletions
12
render/egl.c
12
render/egl.c
|
|
@ -158,10 +158,16 @@ static void init_dmabuf_formats(struct wlr_egl *egl) {
|
|||
|
||||
if (modifiers_len == 0) {
|
||||
wlr_drm_format_set_add(&egl->dmabuf_formats, fmt, DRM_FORMAT_MOD_INVALID);
|
||||
wlr_drm_format_set_add(&egl->dmabuf_render_formats, fmt,
|
||||
DRM_FORMAT_MOD_INVALID);
|
||||
}
|
||||
|
||||
for (int j = 0; j < modifiers_len; j++) {
|
||||
wlr_drm_format_set_add(&egl->dmabuf_formats, fmt, modifiers[j]);
|
||||
if (!external_only[j]) {
|
||||
wlr_drm_format_set_add(&egl->dmabuf_render_formats, fmt,
|
||||
modifiers[j]);
|
||||
}
|
||||
}
|
||||
|
||||
free(modifiers);
|
||||
|
|
@ -397,6 +403,7 @@ void wlr_egl_finish(struct wlr_egl *egl) {
|
|||
}
|
||||
free(egl->external_only_dmabuf_formats);
|
||||
|
||||
wlr_drm_format_set_finish(&egl->dmabuf_render_formats);
|
||||
wlr_drm_format_set_finish(&egl->dmabuf_formats);
|
||||
|
||||
eglMakeCurrent(egl->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||
|
|
@ -809,6 +816,11 @@ const struct wlr_drm_format_set *wlr_egl_get_dmabuf_formats(struct wlr_egl *egl)
|
|||
return &egl->dmabuf_formats;
|
||||
}
|
||||
|
||||
const struct wlr_drm_format_set *wlr_egl_get_dmabuf_render_formats(
|
||||
struct wlr_egl *egl) {
|
||||
return &egl->dmabuf_render_formats;
|
||||
}
|
||||
|
||||
bool wlr_egl_export_image_to_dmabuf(struct wlr_egl *egl, EGLImageKHR image,
|
||||
int32_t width, int32_t height, uint32_t flags,
|
||||
struct wlr_dmabuf_attributes *attribs) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue