diff options
author | Simon Ser <contact@emersion.fr> | 2021-11-16 22:51:06 +0100 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2021-11-17 16:12:59 +0000 |
commit | a04cfca4da42d1cc01047c1cd9e60ef504beae98 (patch) | |
tree | b388fc9f851a7784881cb70509b033bb680f3db8 /backend | |
parent | 9a4e1095cad154b7f8ce41cedbfb1e9a7e137d66 (diff) |
Remove support for DMA-BUF flags
They are never used in practice, which makes all of our flag
handling effectively dead code. Also, APIs such as KMS don't
provide a good way to deal with the flags. Let's just fail the
DMA-BUF import when clients provide flags.
Diffstat (limited to 'backend')
-rw-r--r-- | backend/drm/renderer.c | 6 | ||||
-rw-r--r-- | backend/wayland/output.c | 12 | ||||
-rw-r--r-- | backend/x11/output.c | 4 |
3 files changed, 1 insertions, 21 deletions
diff --git a/backend/drm/renderer.c b/backend/drm/renderer.c index 40e068cd..6c26558f 100644 --- a/backend/drm/renderer.c +++ b/backend/drm/renderer.c @@ -282,12 +282,6 @@ static struct wlr_drm_fb *drm_fb_create(struct wlr_drm_backend *drm, goto error_get_dmabuf; } - if (attribs.flags != 0) { - wlr_log(WLR_DEBUG, "Buffer with DMA-BUF flags 0x%"PRIX32" cannot be " - "scanned out", attribs.flags); - goto error_get_dmabuf; - } - if (formats && !wlr_drm_format_set_has(formats, attribs.format, attribs.modifier)) { // The format isn't supported by the plane. Try stripping the alpha diff --git a/backend/wayland/output.c b/backend/wayland/output.c index 8d8f036c..3fa86a3c 100644 --- a/backend/wayland/output.c +++ b/backend/wayland/output.c @@ -166,18 +166,8 @@ static struct wl_buffer *import_dmabuf(struct wlr_wl_backend *wl, dmabuf->offset[i], dmabuf->stride[i], modifier_hi, modifier_lo); } - uint32_t flags = 0; - if (dmabuf->flags & WLR_DMABUF_ATTRIBUTES_FLAGS_Y_INVERT) { - flags |= ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_Y_INVERT; - } - if (dmabuf->flags & WLR_DMABUF_ATTRIBUTES_FLAGS_INTERLACED) { - flags |= ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_INTERLACED; - } - if (dmabuf->flags & WLR_DMABUF_ATTRIBUTES_FLAGS_BOTTOM_FIRST) { - flags |= ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_BOTTOM_FIRST; - } struct wl_buffer *wl_buffer = zwp_linux_buffer_params_v1_create_immed( - params, dmabuf->width, dmabuf->height, dmabuf->format, flags); + params, dmabuf->width, dmabuf->height, dmabuf->format, 0); // TODO: handle create() errors return wl_buffer; } diff --git a/backend/x11/output.c b/backend/x11/output.c index 3ad7b4a4..76172582 100644 --- a/backend/x11/output.c +++ b/backend/x11/output.c @@ -140,10 +140,6 @@ static xcb_pixmap_t import_dmabuf(struct wlr_x11_output *output, return XCB_PIXMAP_NONE; } - if (dmabuf->flags != 0) { - return XCB_PIXMAP_NONE; - } - // xcb closes the FDs after sending them, so we need to dup them here struct wlr_dmabuf_attributes dup_attrs = {0}; if (!wlr_dmabuf_attributes_copy(&dup_attrs, dmabuf)) { |