mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-23 23:30:02 +00:00
modesetting: Don't recursively force present to unflip
Present calls drmmode_set_mode_major() as part of ms_present_unflip(),
which leads to a crash due to the recursive attempt to force present to
unflip when it already is.
Fix it by simply skipping the forced present unflip when present itself is
unflipping. This also speeds up drmmmode_prepare_modeset() when present
isn't even flipping to begin with.
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1791
Fixes: 899c87af1f ("modesetting: unflip before any setcrtc() calls")
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1793>
This commit is contained in:
committed by
Enrico Weigelt
parent
9edc105abd
commit
7f7753dd87
@@ -1515,7 +1515,7 @@ static void drmmmode_prepare_modeset(ScrnInfoPtr scrn)
|
||||
ScreenPtr pScreen = scrn->pScreen;
|
||||
modesettingPtr ms = modesettingPTR(scrn);
|
||||
|
||||
if (ms->drmmode.pending_modeset)
|
||||
if (!ms->drmmode.present_flipping || ms->drmmode.pending_modeset)
|
||||
return;
|
||||
|
||||
/*
|
||||
|
||||
@@ -481,6 +481,8 @@ ms_present_unflip(ScreenPtr screen, uint64_t event_id)
|
||||
}
|
||||
}
|
||||
|
||||
ms->drmmode.present_flipping = FALSE;
|
||||
|
||||
for (i = 0; i < config->num_crtc; i++) {
|
||||
xf86CrtcPtr crtc = config->crtc[i];
|
||||
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
|
||||
@@ -504,7 +506,6 @@ ms_present_unflip(ScreenPtr screen, uint64_t event_id)
|
||||
}
|
||||
|
||||
present_event_notify(event_id, 0, 0);
|
||||
ms->drmmode.present_flipping = FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user