I don't think I've used the combination of drmModePageFlip and page_flip_handler2 in any of my various implementation I've written over the years, but maybe using version 4 of the drmHandleEvent fills in the crtc_id? At least it did for me when I was using it together with drmModeAtomicCommit. One more reason maybe to use those:Using DRM_MODE_PAGE_FLIP_EVENT should trigger a page flip event. I seem to recall a recent thread where the main DRM devs acknowledged that vsync and flip events miss out saying which crtc they belong to.
Code:
static void drm_page_flip_event( int fd, unsigned int frame, unsigned int sec, unsigned int usec, unsigned int crtc_id, void *data) { ... }static const drmEventContext evctx = { .version = 4, .page_flip_handler2 = drm_page_flip_event,};Unless the intent is to drive two displays with different refresh rates, It might be easier to do one atomic commit across all resources. At least that's what I've been doing for a while now and I don't notice any downsides so far. Although I'm using fences instead of drmHandleEvent now. Whether or not that all works well on such an old kernel is the question though.
Statistics: Posted by dividuum — Tue Jun 03, 2025 10:46 pm