Skip to content

Commit 6f4a240

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 514ab07 commit 6f4a240

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
@@ -299,13 +299,13 @@ static void drmdev_on_page_flip(
299299
mutex_unlock(&drmdev->mutex);
300300
}
301301

302-
if (cbs_copy.callbacks[cbs_copy.index].scanout_callback != NULL) {
303-
cbs_copy.callbacks[cbs_copy.index].scanout_callback(vblank_ns, cbs_copy.callbacks[cbs_copy.index].scanout_callback_userdata);
304-
}
305-
306302
if (cbs_copy.callbacks[cbs_copy.index].void_callback != NULL) {
307303
cbs_copy.callbacks[cbs_copy.index].void_callback(cbs_copy.callbacks[cbs_copy.index].void_callback_userdata);
308304
}
305+
306+
if (cbs_copy.callbacks[cbs_copy.index].scanout_callback != NULL) {
307+
cbs_copy.callbacks[cbs_copy.index].scanout_callback(vblank_ns, cbs_copy.callbacks[cbs_copy.index].scanout_callback_userdata);
308+
}
309309
}
310310

311311
static void on_page_flip(

0 commit comments

Comments
 (0)