Commit7e175800Recorded28 Oct 2026Repositorysigil-wm

Expose the first presented output timestamp for startup timing

Changed
 src/c/host.c | 3 ++-
 src/c/lock.h | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)
Diff
src/c/host.cmodified
@@ -124,7 +124,7 @@ static struct {
124
bool terminal_delivered;
125
atomic_int state;
126
atomic_uint_fast64_t frames, objects, overflow, rejected, bytes, pixel_nodes, pixel_drops, saved_trees, snapshots;
−127
atomic_uint_fast64_t input_expired,motion_coalesced,timer_wakes;
+127
atomic_uint_fast64_t input_expired,motion_coalesced,timer_wakes,first_present_ms;
128
atomic_bool input_resync;
129
char socket[64],requested_socket[64];
130
int64_t protocols,request_deadline;
@@ -2564,6 +2564,7 @@ uint64_t wm_stat(int which) {
2564
case 10: return atomic_load(&bridge.input_expired);
2565
case 11: return atomic_load(&bridge.motion_coalesced);
2566
case 12: return atomic_load(&bridge.timer_wakes);
+2567
case 13: return atomic_load(&bridge.first_present_ms);
2568
default: return UINT64_MAX;
2569
}
2570
}
src/c/lock.hmodified
@@ -44,6 +44,8 @@ static void lock_ack(struct server *s) {
44
static void lock_present(struct wl_listener *listener,void *data) {
45
struct output *o=wl_container_of(listener,o,lock_present);
46
struct wlr_output_event_present *e=data;
+47
uint64_t unset=0;
+48
if(e->presented) atomic_compare_exchange_strong(&bridge.first_present_ms,&unset,now_ms());
49
if(trace_output_present(&o->trace,e->commit_seq,o->id,e->presented,&e->when)) wake(bridge.event_fd);
50
layer_output_present(o, e);
51
if(!o->server->lock_state || !e->presented || !o->lock_armed ||