This is an automated email from the git hooks/post-receive script.

git pushed a commit to reference refs/pull/299/head
in repository efl.

View the commit online.

commit 42ae7d1a5f1435eec43c2d396114e0518a1866ec
Author: Cedric BAIL <[email protected]>
AuthorDate: Wed Dec 2 16:11:48 2026 -0600

    evas/gl_drm: keep the old outbuf when a new one cannot be made
    
    eng_output_update() freed the old outbuf first when the depth or the
    destination alpha changed, and if evas_outbuf_new() then failed it
    freed the whole render engine and returned 0. The caller,
    efl_canvas_output_engine_info_set(), ignores that return value, so
    the canvas kept a pointer to the freed output and the next damage or
    render used it after free.
    
    Create the new outbuf first, as gl_x11 and wayland_egl do: on failure
    return 0 with the output untouched, otherwise let
    evas_render_engine_software_generic_update() free the old one once the
    new one exists. The gl_wins count is unchanged by replacing one window
    with one window, so it is no longer touched.
    
    The old order also let the last reference to the EGL context drop to
    zero, which terminated EGL and made the new outbuf start it again. Now
    the new outbuf shares the context while the old one is alive, so the
    reference never reaches zero. Two gbm and EGL window surfaces exist for
    the duration of the call, as they do for gl_x11 windows.
    
    No test: this needs a gbm device and EGL on a KMS node, and nothing the
    suites can run reaches gl_drm.
    
    Co-Authored-By: Claude Fable 5.2 <[email protected]>
---
 src/modules/evas/engines/gl_drm/evas_engine.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/src/modules/evas/engines/gl_drm/evas_engine.c b/src/modules/evas/engines/gl_drm/evas_engine.c
index fac0a1c547..3cf538baa1 100644
--- a/src/modules/evas/engines/gl_drm/evas_engine.c
+++ b/src/modules/evas/engines/gl_drm/evas_engine.c
@@ -904,29 +904,17 @@ eng_output_update(void *engine EINA_UNUSED, void *data, void *in, unsigned int w
         if ((info->info.depth != eng_get_ob(re)->depth) ||
             (info->info.destination_alpha != eng_get_ob(re)->destination_alpha))
           {
-             Outbuf *ob, *ob_old;
-             Render_Output_Swap_Mode swap_mode = MODE_AUTO;
-
-             ob_old = re->generic.software.ob;
-             re->generic.software.ob = NULL;
-             gl_wins--;
-
-             if (ob_old) evas_outbuf_free(ob_old);
+             Outbuf *ob;
+             Render_Output_Swap_Mode swap_mode;
 
              swap_mode = evas_render_engine_gl_swap_mode_get(info->info.swap_mode);
              ob = evas_outbuf_new(info, w, h, swap_mode);
-             if (!ob)
-               {
-                  free(re);
-                  return 0;
-               }
+             if (!ob) return 0;
 
              evas_outbuf_use(ob);
 
              evas_render_engine_software_generic_update(&re->generic.software,
                                                         ob, w, h);
-
-             gl_wins++;
           }
         else if ((eng_get_ob(re)->w != (int)w) ||
                  (eng_get_ob(re)->h != (int)h) ||

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to