This is an automated email from the git hooks/post-receive script.
git pushed a commit to reference refs/pull/302/head
in repository efl.
View the commit online.
commit 3623e4eee0c903ccff0e11caf47e33be9ba5ecc2
Author: Cedric BAIL <[email protected]>
AuthorDate: Wed Dec 2 10:55:30 2026 -0600
evas:gl_drm: give each frame its size
A frame whose buffer is gone, because the canvas was resized or freed
while the consumer still held it, has bo == NULL and nothing left to
read its size from. A consumer that wraps the frame, or that queues it
for an encoder, still wants to know what it was drawn for when it gives
it back.
Record the size of the output when the frame is made. It is the size
of the buffer: a canvas with no device is never rotated.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
---
src/modules/evas/engines/gl_drm/Evas_Engine_GL_Drm.h | 4 +++-
src/modules/evas/engines/gl_drm/evas_outbuf.c | 2 ++
src/tests/evas/evas_test_gl_drm.c | 6 ++++++
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/modules/evas/engines/gl_drm/Evas_Engine_GL_Drm.h b/src/modules/evas/engines/gl_drm/Evas_Engine_GL_Drm.h
index 474666e3e8..40776e3acb 100644
--- a/src/modules/evas/engines/gl_drm/Evas_Engine_GL_Drm.h
+++ b/src/modules/evas/engines/gl_drm/Evas_Engine_GL_Drm.h
@@ -11,7 +11,7 @@ typedef struct _Evas_Engine_Info_GL_Drm Evas_Engine_Info_GL_Drm;
/* A finished frame, handed to Evas_Engine_Info_GL_Drm.frame.func.
*
- * Only these two fields may be read. The frame belongs to the engine and
+ * Only these fields may be read. The frame belongs to the engine and
* is given back, exactly once, with
* Evas_Engine_Info_GL_Drm.func.frame_release(). */
typedef struct _Evas_Engine_GL_Drm_Frame Evas_Engine_GL_Drm_Frame;
@@ -31,6 +31,8 @@ struct _Evas_Engine_GL_Drm_Frame
* buffers and the same buffer always comes back with the same id, so a
* consumer can cache what it derived from it. Never reused. */
uint64_t id;
+ /* The size of the buffer in pixels. Still valid when bo is NULL. */
+ int w, h;
};
struct _Evas_Engine_Info_GL_Drm
diff --git a/src/modules/evas/engines/gl_drm/evas_outbuf.c b/src/modules/evas/engines/gl_drm/evas_outbuf.c
index 6623d6e674..08d0365346 100644
--- a/src/modules/evas/engines/gl_drm/evas_outbuf.c
+++ b/src/modules/evas/engines/gl_drm/evas_outbuf.c
@@ -129,6 +129,8 @@ _evas_outbuf_frame_get(Outbuf *ob, struct gbm_bo *bo)
frame->frame.bo = bo;
frame->frame.id = ++frame_count;
+ frame->frame.w = ob->w;
+ frame->frame.h = ob->h;
frame->surface = ob->surface;
gbm_bo_set_user_data(bo, frame, _evas_outbuf_frame_bo_destroy);
diff --git a/src/tests/evas/evas_test_gl_drm.c b/src/tests/evas/evas_test_gl_drm.c
index f47d1267ce..dab89415ea 100644
--- a/src/tests/evas/evas_test_gl_drm.c
+++ b/src/tests/evas/evas_test_gl_drm.c
@@ -527,6 +527,8 @@ EFL_START_TEST(evas_test_gl_drm_first_frame)
ck_assert_uint_ne(frame->id, 0);
ck_assert_uint_eq(gbm_bo_get_width(frame->bo), c->w);
ck_assert_uint_eq(gbm_bo_get_height(frame->bo), c->h);
+ ck_assert_int_eq(frame->w, c->w);
+ ck_assert_int_eq(frame->h, c->h);
ck_assert_uint_eq(gbm_bo_get_format(frame->bo), GBM_FORMAT_XRGB8888);
ck_assert(_damage_is_all(c));
@@ -801,6 +803,10 @@ EFL_START_TEST(evas_test_gl_drm_resize)
/* The buffer of the frame held across the resize went away with the
* surface it came from. */
ck_assert_ptr_null(old->bo);
+ ck_assert_int_eq(old->w, CANVAS_W);
+ ck_assert_int_eq(old->h, CANVAS_H);
+ ck_assert_int_eq(c->held[1]->w, 160);
+ ck_assert_int_eq(c->held[1]->h, 120);
_held_release_all(c);
_canvas_resize(c, 64, 48);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.