onscreen/native: Handle unexpected scanout failures async
We test direct client buffer scanout using a TEST_ONLY commit on atomic, and with various conditions in non-atomic, but if we end up failing to actually commit despite this, handle the fallout asynchronously. What this means is that we'll reschedule a new frame immediately. For this to work, the same scanout buffer needs to be avoided for the same CRTC. This is done by using the newly added signal on the CoglScanout object to let the MetaWaylandBuffer object mark the current buffer as non-working for the onsrceen that it failed on. This allows to re-try buffers on the same onscreen when new ones are attached. This queues a full damage, since we consumed the qeued redraw rect. The redraw rect wasn't lost - it was accumulated to make sure the whole primary plane was redrawed according to the damage region, whenever we would end up no longer doing direct scanout, but this accumulation only works when we're not intentionally stopping to scanout. For now, lets just damage the whole view, it's just an graceful fallback in response to an unexpected error anyway. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2854>
This commit is contained in:
@ -1046,17 +1046,14 @@ meta_kms_impl_device_atomic_process_update (MetaKmsImplDevice *impl_device,
|
||||
err:
|
||||
meta_topic (META_DEBUG_KMS, "[atomic] KMS update failed: %s", error->message);
|
||||
|
||||
if (!(flags & META_KMS_UPDATE_FLAG_PRESERVE_ON_ERROR))
|
||||
{
|
||||
process_entries (impl_device,
|
||||
update,
|
||||
req,
|
||||
blob_ids,
|
||||
meta_kms_update_get_page_flip_listeners (update),
|
||||
error,
|
||||
discard_page_flip_listener,
|
||||
NULL);
|
||||
}
|
||||
process_entries (impl_device,
|
||||
update,
|
||||
req,
|
||||
blob_ids,
|
||||
meta_kms_update_get_page_flip_listeners (update),
|
||||
error,
|
||||
discard_page_flip_listener,
|
||||
NULL);
|
||||
|
||||
if (req)
|
||||
drmModeAtomicFree (req);
|
||||
|
Reference in New Issue
Block a user