Skip to content

Commit

Permalink
buffer: Save render node device id into buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
any1 committed Sep 6, 2024
1 parent a28c896 commit 97de73d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <stdbool.h>
#include <assert.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <libdrm/drm_fourcc.h>
#include <wayland-client.h>
#include <pixman.h>
Expand Down Expand Up @@ -224,6 +225,11 @@ static struct wv_buffer* wv_buffer_create_dmabuf(int width, int height,
self->height = height;
self->format = fourcc;

int device_fd = gbm_device_get_fd(gbm);
struct stat st = {};
fstat(device_fd, &st);
self->node = st.st_rdev;

#ifdef HAVE_LINUX_DMA_HEAP
self->bo = have_linux_cma() ?
create_cma_gbm_bo(width, height, fourcc, gbm) :
Expand Down

0 comments on commit 97de73d

Please sign in to comment.