diff --git a/shared/client-buffer-util.c b/shared/client-buffer-util.c index 166cfbd98..149b11a84 100644 --- a/shared/client-buffer-util.c +++ b/shared/client-buffer-util.c @@ -231,6 +231,7 @@ client_buffer_util_create_shm_buffer(struct wl_shm *shm, buf = xzalloc(sizeof *buf); buf->fmt = fmt; + buf->type = CLIENT_BUFFER_TYPE_SHM; buf->width = width; buf->height = height; @@ -321,6 +322,7 @@ client_buffer_util_create_dmabuf_buffer(struct wl_display *display, buf = xzalloc(sizeof *buf); buf->fmt = fmt; + buf->type = CLIENT_BUFFER_TYPE_DMABUF; buf->width = width; buf->height = height; diff --git a/shared/client-buffer-util.h b/shared/client-buffer-util.h index cfb910e18..21998d719 100644 --- a/shared/client-buffer-util.h +++ b/shared/client-buffer-util.h @@ -37,8 +37,14 @@ struct zwp_linux_dmabuf_v1; #define MAX_DMABUF_PLANES 4 +enum client_buffer_type { + CLIENT_BUFFER_TYPE_SHM = 1, + CLIENT_BUFFER_TYPE_DMABUF, +}; + struct client_buffer { const struct pixel_format_info *fmt; + enum client_buffer_type type; struct wl_buffer *wl_buffer; void *data; size_t bytes;