diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h index 598d83189a..99a2e9a278 100644 --- a/src/lib/ecore_drm2/Ecore_Drm2.h +++ b/src/lib/ecore_drm2/Ecore_Drm2.h @@ -686,7 +686,7 @@ EAPI Eina_Bool ecore_drm2_output_possible_crtc_get(Ecore_Drm2_Output *output, un */ EAPI Ecore_Drm2_Fb *ecore_drm2_fb_create(int fd, int width, int height, int depth, int bpp, unsigned int format); -EAPI Ecore_Drm2_Fb *ecore_drm2_fb_gbm_create(int fd, int width, int height, int depth, int bpp, unsigned int format, unsigned int handle, unsigned int stride); +EAPI Ecore_Drm2_Fb *ecore_drm2_fb_gbm_create(int fd, int width, int height, int depth, int bpp, unsigned int format, unsigned int handle, unsigned int stride, void *bo); /** * Destroy a framebuffer object @@ -808,6 +808,18 @@ EAPI void ecore_drm2_fb_busy_set(Ecore_Drm2_Fb *fb, Eina_Bool busy); */ EAPI void ecore_drm2_output_user_data_set(Ecore_Drm2_Output *o, void *data); +/** + * Get the Framebuffer's gbm buffer object + * + * @param fb The framebuffer to query + * + * @return The gbm bo for the framebuffer + * + * @ingroup Ecore_Drm2_Output_Group + * @since 1.19 + */ +EAPI void *ecore_drm2_fb_bo_get(Ecore_Drm2_Fb *fb); + # endif #endif diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c b/src/lib/ecore_drm2/ecore_drm2_fb.c index f660f0551b..d7727689f6 100644 --- a/src/lib/ecore_drm2/ecore_drm2_fb.c +++ b/src/lib/ecore_drm2/ecore_drm2_fb.c @@ -106,7 +106,7 @@ err: } EAPI Ecore_Drm2_Fb * -ecore_drm2_fb_gbm_create(int fd, int width, int height, int depth, int bpp, unsigned int format, unsigned int handle, unsigned int stride) +ecore_drm2_fb_gbm_create(int fd, int width, int height, int depth, int bpp, unsigned int format, unsigned int handle, unsigned int stride, void *bo) { struct drm_mode_map_dumb marg; Ecore_Drm2_Fb *fb; @@ -118,6 +118,7 @@ ecore_drm2_fb_gbm_create(int fd, int width, int height, int depth, int bpp, unsi if (!fb) return NULL; fb->gbm = EINA_TRUE; + fb->gbm_bo = bo; fb->fd = fd; fb->w = width; @@ -322,3 +323,9 @@ ecore_drm2_fb_busy_set(Ecore_Drm2_Fb *fb, Eina_Bool busy) { fb->busy = busy; } + +EAPI void * +ecore_drm2_fb_bo_get(Ecore_Drm2_Fb *f) +{ + return f->gbm_bo; +} diff --git a/src/lib/ecore_drm2/ecore_drm2_private.h b/src/lib/ecore_drm2/ecore_drm2_private.h index 96acfa459e..d78d011f13 100644 --- a/src/lib/ecore_drm2/ecore_drm2_private.h +++ b/src/lib/ecore_drm2/ecore_drm2_private.h @@ -93,6 +93,8 @@ struct _Ecore_Drm2_Fb uint32_t stride, size; uint32_t format; + void *gbm_bo; + Eina_Bool gbm : 1; Eina_Bool busy : 1; diff --git a/src/modules/evas/engines/gl_drm/evas_outbuf.c b/src/modules/evas/engines/gl_drm/evas_outbuf.c index fb16c29bde..fb75313efd 100644 --- a/src/modules/evas/engines/gl_drm/evas_outbuf.c +++ b/src/modules/evas/engines/gl_drm/evas_outbuf.c @@ -64,7 +64,7 @@ _evas_outbuf_fb_get(Outbuf *ob, struct gbm_bo *bo) fb = ecore_drm2_fb_gbm_create(ob->fd, w, h, ob->depth, ob->bpp, - format, hdl, stride); + format, hdl, stride, bo); if (!fb) { ERR("Failed to create FBO");