Revert "Require INVALID for implicit format modifiers"

This reverts commit ea7357b703.
This commit is contained in:
Simon Ser 2021-10-01 17:22:04 +02:00 committed by Simon Zeni
parent 61b83441a1
commit 1d7e438d8a
6 changed files with 45 additions and 39 deletions

View file

@ -9,7 +9,6 @@
#include <wlr/types/wlr_linux_dmabuf_v1.h>
#include <wlr/util/log.h>
#include "linux-dmabuf-unstable-v1-protocol.h"
#include "render/drm_format_set.h"
#include "util/signal.h"
#define LINUX_DMABUF_VERSION 3
@ -414,9 +413,7 @@ static const struct zwp_linux_dmabuf_v1_interface linux_dmabuf_impl = {
static void linux_dmabuf_send_modifiers(struct wl_resource *resource,
const struct wlr_drm_format *fmt) {
if (wl_resource_get_version(resource) < ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION) {
if (wlr_drm_format_has(fmt, DRM_FORMAT_MOD_INVALID)) {
zwp_linux_dmabuf_v1_send_format(resource, fmt->format);
}
zwp_linux_dmabuf_v1_send_format(resource, fmt->format);
return;
}
@ -425,6 +422,10 @@ static void linux_dmabuf_send_modifiers(struct wl_resource *resource,
zwp_linux_dmabuf_v1_send_modifier(resource, fmt->format,
mod >> 32, mod & 0xFFFFFFFF);
}
// We always support buffers with an implicit modifier
zwp_linux_dmabuf_v1_send_modifier(resource, fmt->format,
DRM_FORMAT_MOD_INVALID >> 32, DRM_FORMAT_MOD_INVALID & 0xFFFFFFFF);
}
static void linux_dmabuf_send_formats(struct wlr_linux_dmabuf_v1 *linux_dmabuf,