config: make naming consistent

*_VBLANK_SCHEDULER -> VBLANK_SCHEDULER_*

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2023-12-18 22:02:05 +00:00
parent 0b45b3415b
commit fc62f6a4ed
3 changed files with 11 additions and 11 deletions

View File

@@ -21,9 +21,9 @@ void apply_driver_workarounds(struct session *ps, enum driver driver) {
enum vblank_scheduler_type choose_vblank_scheduler(enum driver driver) {
if (driver & DRIVER_INTEL) {
return SGI_VIDEO_SYNC_VBLANK_SCHEDULER;
return VBLANK_SCHEDULER_SGI_VIDEO_SYNC;
}
return PRESENT_VBLANK_SCHEDULER;
return VBLANK_SCHEDULER_PRESENT;
}
enum driver detect_driver(xcb_connection_t *c, backend_t *backend_data, xcb_window_t window) {

View File

@@ -75,9 +75,9 @@ typedef struct _c2_lptr c2_lptr_t;
enum vblank_scheduler_type {
/// X Present extension based vblank events
PRESENT_VBLANK_SCHEDULER,
VBLANK_SCHEDULER_PRESENT,
/// GLX_SGI_video_sync based vblank events
SGI_VIDEO_SYNC_VBLANK_SCHEDULER,
VBLANK_SCHEDULER_SGI_VIDEO_SYNC,
/// An invalid scheduler, served as a scheduler count, and
/// as a sentinel value.
LAST_VBLANK_SCHEDULER,
@@ -85,8 +85,8 @@ enum vblank_scheduler_type {
static inline const char *vblank_scheduler_type_str(enum vblank_scheduler_type type) {
switch (type) {
case PRESENT_VBLANK_SCHEDULER: return "present";
case SGI_VIDEO_SYNC_VBLANK_SCHEDULER: return "sgi_video_sync";
case VBLANK_SCHEDULER_PRESENT: return "present";
case VBLANK_SCHEDULER_SGI_VIDEO_SYNC: return "sgi_video_sync";
default: return "invalid";
}
}

View File

@@ -269,7 +269,7 @@ static void sgi_video_sync_scheduler_init(struct vblank_scheduler *base) {
pthread_mutex_init(&args.start_mtx, NULL);
pthread_cond_init(&args.start_cnd, NULL);
base->type = SGI_VIDEO_SYNC_VBLANK_SCHEDULER;
base->type = VBLANK_SCHEDULER_SGI_VIDEO_SYNC;
ev_async_init(&self->notify, sgi_video_sync_scheduler_callback);
ev_async_start(base->loop, &self->notify);
pthread_mutex_init(&self->vblank_requested_mtx, NULL);
@@ -328,7 +328,7 @@ static void present_vblank_callback(EV_P attr_unused, ev_timer *w, int attr_unus
static void present_vblank_scheduler_init(struct vblank_scheduler *base) {
auto self = (struct present_vblank_scheduler *)base;
base->type = PRESENT_VBLANK_SCHEDULER;
base->type = VBLANK_SCHEDULER_PRESENT;
ev_timer_init(&self->callback_timer, present_vblank_callback, 0, 0);
self->event_id = x_new_id(base->c);
@@ -354,7 +354,7 @@ static void present_vblank_scheduler_deinit(struct vblank_scheduler *base) {
/// Schedule the registered callback to be called when the current vblank ends.
static void handle_present_complete_notify(struct present_vblank_scheduler *self,
xcb_present_complete_notify_event_t *cne) {
assert(self->base.type == PRESENT_VBLANK_SCHEDULER);
assert(self->base.type == VBLANK_SCHEDULER_PRESENT);
if (cne->kind != XCB_PRESENT_COMPLETE_KIND_NOTIFY_MSC) {
return;
@@ -418,7 +418,7 @@ static bool handle_present_events(struct vblank_scheduler *base) {
}
static const struct vblank_scheduler_ops vblank_scheduler_ops[LAST_VBLANK_SCHEDULER] = {
[PRESENT_VBLANK_SCHEDULER] =
[VBLANK_SCHEDULER_PRESENT] =
{
.size = sizeof(struct present_vblank_scheduler),
.init = present_vblank_scheduler_init,
@@ -427,7 +427,7 @@ static const struct vblank_scheduler_ops vblank_scheduler_ops[LAST_VBLANK_SCHEDU
.handle_x_events = handle_present_events,
},
#ifdef CONFIG_OPENGL
[SGI_VIDEO_SYNC_VBLANK_SCHEDULER] =
[VBLANK_SCHEDULER_SGI_VIDEO_SYNC] =
{
.size = sizeof(struct sgi_video_sync_vblank_scheduler),
.init = sgi_video_sync_scheduler_init,