render/drm_syncobj: add addon set

This commit is contained in:
Simon Ser 2024-10-26 19:19:06 +02:00 committed by Simon Zeni
parent 8e36040e88
commit ca29f43a54
2 changed files with 7 additions and 0 deletions

View file

@ -4,6 +4,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include <wayland-server-core.h> #include <wayland-server-core.h>
#include <wlr/util/addon.h>
/** /**
* A synchronization timeline. * A synchronization timeline.
@ -29,6 +30,8 @@ struct wlr_drm_syncobj_timeline {
int drm_fd; int drm_fd;
uint32_t handle; uint32_t handle;
struct wlr_addon_set addons;
struct { struct {
size_t n_refs; size_t n_refs;
} WLR_PRIVATE; } WLR_PRIVATE;

View file

@ -4,6 +4,7 @@
#include <unistd.h> #include <unistd.h>
#include <wayland-server-core.h> #include <wayland-server-core.h>
#include <wlr/render/drm_syncobj.h> #include <wlr/render/drm_syncobj.h>
#include <wlr/util/addon.h>
#include <wlr/util/log.h> #include <wlr/util/log.h>
#include "config.h" #include "config.h"
@ -22,6 +23,8 @@ static struct wlr_drm_syncobj_timeline *timeline_create(int drm_fd, uint32_t han
timeline->n_refs = 1; timeline->n_refs = 1;
timeline->handle = handle; timeline->handle = handle;
wlr_addon_set_init(&timeline->addons);
return timeline; return timeline;
} }
@ -72,6 +75,7 @@ void wlr_drm_syncobj_timeline_unref(struct wlr_drm_syncobj_timeline *timeline) {
return; return;
} }
wlr_addon_set_finish(&timeline->addons);
drmSyncobjDestroy(timeline->drm_fd, timeline->handle); drmSyncobjDestroy(timeline->drm_fd, timeline->handle);
free(timeline); free(timeline);
} }