From c2815fd44de5d74e379c118b4ccded5a9419e32c Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 23 Feb 2021 17:32:26 +0100 Subject: [PATCH] buffer: add missing convert_wl_shm_format_to_drm call Fixes: 27fba3df4347 ("render: use DRM formats in wlr_texture_from_pixels") Closes: https://github.com/swaywm/wlroots/issues/2757 --- types/wlr_buffer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/types/wlr_buffer.c b/types/wlr_buffer.c index 0ead9e09..b631fa99 100644 --- a/types/wlr_buffer.c +++ b/types/wlr_buffer.c @@ -4,6 +4,7 @@ #include #include #include +#include "render/shm_format.h" #include "util/signal.h" void wlr_buffer_init(struct wlr_buffer *buffer, @@ -182,14 +183,15 @@ struct wlr_client_buffer *wlr_client_buffer_import( struct wl_shm_buffer *shm_buf = wl_shm_buffer_get(resource); if (shm_buf != NULL) { - enum wl_shm_format fmt = wl_shm_buffer_get_format(shm_buf); + enum wl_shm_format wl_shm_format = wl_shm_buffer_get_format(shm_buf); + uint32_t drm_format = convert_wl_shm_format_to_drm(wl_shm_format); int32_t stride = wl_shm_buffer_get_stride(shm_buf); int32_t width = wl_shm_buffer_get_width(shm_buf); int32_t height = wl_shm_buffer_get_height(shm_buf); wl_shm_buffer_begin_access(shm_buf); void *data = wl_shm_buffer_get_data(shm_buf); - texture = wlr_texture_from_pixels(renderer, fmt, stride, + texture = wlr_texture_from_pixels(renderer, drm_format, stride, width, height, data); wl_shm_buffer_end_access(shm_buf);