Skip to content

Commit 1204324

Browse files
committed
drmdev: call release callback before scanout callback
Call the release callback for the commit that is no longer visible on screen before calling the scanout callback. The scanout callback might already start a new frame, and the release callback releases some resources that could be useful for building the new frame, so this helps avoid resource exhaustion.
1 parent 403ec81 commit 1204324

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/kms/drmdev.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,13 @@ static void drmdev_on_page_flip(
306306
ASSERT_ZERO(ok);
307307
}
308308

309-
if (cbs_copy.callbacks[cbs_copy.index].scanout_callback != NULL) {
310-
cbs_copy.callbacks[cbs_copy.index].scanout_callback(vblank_ns, cbs_copy.callbacks[cbs_copy.index].scanout_callback_userdata);
311-
}
312-
313309
if (cbs_copy.callbacks[cbs_copy.index].void_callback != NULL) {
314310
cbs_copy.callbacks[cbs_copy.index].void_callback(cbs_copy.callbacks[cbs_copy.index].void_callback_userdata);
315311
}
312+
313+
if (cbs_copy.callbacks[cbs_copy.index].scanout_callback != NULL) {
314+
cbs_copy.callbacks[cbs_copy.index].scanout_callback(vblank_ns, cbs_copy.callbacks[cbs_copy.index].scanout_callback_userdata);
315+
}
316316
}
317317

318318
static void on_page_flip(

0 commit comments

Comments
 (0)