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

View File

@ -4,6 +4,7 @@
#include <unistd.h>
#include <wayland-server-core.h>
#include <wlr/render/drm_syncobj.h>
#include <wlr/util/addon.h>
#include <wlr/util/log.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->handle = handle;
wlr_addon_set_init(&timeline->addons);
return timeline;
}
@ -72,6 +75,7 @@ void wlr_drm_syncobj_timeline_unref(struct wlr_drm_syncobj_timeline *timeline) {
return;
}
wlr_addon_set_finish(&timeline->addons);
drmSyncobjDestroy(timeline->drm_fd, timeline->handle);
free(timeline);
}