mirror of
https://github.com/brl/mutter.git
synced 2024-12-26 12:52:14 +00:00
kms/impl-device: Don't skip set_needs_flush during a page flip
If the deadline timer is disabled (like on nvidia-drm or when `MUTTER_DEBUG_KMS_THREAD_TYPE=user`), then we need to call `meta_kms_device_set_needs_flush` on every cursor movement. But some were getting skipped if they coincided with page flips, which resulted in some cursor movements failing to schedule the frame clock. This resulted in unnecessary levels of frame skips when using lower frequency input devices which are less likely to provide another event within the same frame period. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3002 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3210>
This commit is contained in:
parent
fac0d05762
commit
444e241ab4
@ -1547,19 +1547,19 @@ meta_kms_impl_device_schedule_process (MetaKmsImplDevice *impl_device,
|
||||
MetaKmsCrtc *crtc)
|
||||
{
|
||||
CrtcFrame *crtc_frame;
|
||||
g_autoptr (GError) error = NULL;
|
||||
MetaKmsImplDevicePrivate *priv;
|
||||
|
||||
crtc_frame = ensure_crtc_frame (impl_device, crtc);
|
||||
if (crtc_frame->pending_page_flip)
|
||||
return;
|
||||
|
||||
if (crtc_frame->await_flush)
|
||||
return;
|
||||
|
||||
if (is_using_deadline_timer (impl_device))
|
||||
{
|
||||
g_autoptr (GError) error = NULL;
|
||||
MetaKmsImplDevicePrivate *priv =
|
||||
meta_kms_impl_device_get_instance_private (impl_device);
|
||||
if (!is_using_deadline_timer (impl_device))
|
||||
goto needs_flush;
|
||||
|
||||
if (crtc_frame->pending_page_flip)
|
||||
return;
|
||||
|
||||
if (ensure_deadline_timer_armed (impl_device, crtc_frame, &error))
|
||||
return;
|
||||
@ -1567,9 +1567,10 @@ meta_kms_impl_device_schedule_process (MetaKmsImplDevice *impl_device,
|
||||
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
|
||||
g_warning ("Failed to determine deadline: %s", error->message);
|
||||
|
||||
priv = meta_kms_impl_device_get_instance_private (impl_device);
|
||||
priv->deadline_timer_failed = TRUE;
|
||||
}
|
||||
|
||||
needs_flush:
|
||||
meta_kms_device_set_needs_flush (meta_kms_crtc_get_device (crtc), crtc);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user