From 5d758194621ae40ef2b2613fd86101652114cbd3 Mon Sep 17 00:00:00 2001
From: Oleg Solovyov <mcpain@altlinux.org>
Date: Wed, 8 Dec 2021 19:15:47 +0300
Subject: [PATCH] drm: Retry setting scanout buffer on failure
 
Plymouth currently assumes that setting the scanout buffer will succeed.
if it fails because of a driver bug or transient failure it should try
again next frame.
 
This commit adds that error handling code.
---
 src/plugins/renderers/drm/plugin.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
 
diff --git a/src/plugins/renderers/drm/plugin.c b/src/plugins/renderers/drm/plugin.c
index 02e9413..10711c6 100644
--- a/src/plugins/renderers/drm/plugin.c
+++ b/src/plugins/renderers/drm/plugin.c
@@ -1628,9 +1628,9 @@ reset_scan_out_buffer_if_needed (ply_renderer_backend_t *backend,
                         return false;
 
         if (head->scan_out_buffer_needs_reset) {
-                ply_renderer_head_set_scan_out_buffer (backend, head,
-                                                       head->scan_out_buffer_id);
-                head->scan_out_buffer_needs_reset = false;
+                did_reset = ply_renderer_head_set_scan_out_buffer (backend, head,
+                                                                   head->scan_out_buffer_id);
+                head->scan_out_buffer_needs_reset = !did_reset;
                 return true;
         }
 
-- 
2.35.1
