aboutsummaryrefslogtreecommitdiff
path: root/render/allocator
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-10-01 17:22:04 +0200
committerSimon Zeni <simon@bl4ckb0ne.ca>2021-10-01 09:26:05 -0600
commit1d7e438d8ac636a2c90d58875e73a67e5440e4ae (patch)
tree1e42c9eeb72a7e2af478c8db73824968b2b0c109 /render/allocator
parent61b83441a195d9500a3c96bd640a756be16b658e (diff)
downloadwlroots-1d7e438d8ac636a2c90d58875e73a67e5440e4ae.tar.xz
Revert "Require INVALID for implicit format modifiers"
This reverts commit ea7357b70366588069c83f158e6a4eb2d3a702b3.
Diffstat (limited to 'render/allocator')
-rw-r--r--render/allocator/gbm.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/render/allocator/gbm.c b/render/allocator/gbm.c
index 787939f4..86e4749b 100644
--- a/render/allocator/gbm.c
+++ b/render/allocator/gbm.c
@@ -7,7 +7,6 @@
#include <wlr/util/log.h>
#include <xf86drm.h>
#include "render/allocator/gbm.h"
-#include "render/drm_format_set.h"
static const struct wlr_buffer_impl buffer_impl;
@@ -87,20 +86,17 @@ static struct wlr_gbm_buffer *create_buffer(struct wlr_gbm_allocator *alloc,
int width, int height, const struct wlr_drm_format *format) {
struct gbm_device *gbm_device = alloc->gbm_device;
- assert(format->len > 0);
-
+ struct gbm_bo *bo = NULL;
bool has_modifier = true;
- struct gbm_bo *bo = gbm_bo_create_with_modifiers(gbm_device, width, height,
- format->format, format->modifiers, format->len);
+ if (format->len > 0) {
+ bo = gbm_bo_create_with_modifiers(gbm_device, width, height,
+ format->format, format->modifiers, format->len);
+ }
if (bo == NULL) {
uint32_t usage = GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING;
if (format->len == 1 &&
format->modifiers[0] == DRM_FORMAT_MOD_LINEAR) {
usage |= GBM_BO_USE_LINEAR;
- } else if (!wlr_drm_format_has(format, DRM_FORMAT_MOD_INVALID)) {
- // If the format doesn't accept an implicit modifier, bail out.
- wlr_log(WLR_ERROR, "gbm_bo_create_with_modifiers failed");
- return NULL;
}
bo = gbm_bo_create(gbm_device, width, height, format->format, usage);
has_modifier = false;