forked from enlightenment/efl
ecore_drm2: Store gbm_bo for Fbs and add a getter function for it
This will aid with proper locking in gl_drm later
This commit is contained in:
parent
6bed17ccdf
commit
0722eae960
|
@ -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_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
|
* 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);
|
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
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -106,7 +106,7 @@ err:
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Ecore_Drm2_Fb *
|
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;
|
struct drm_mode_map_dumb marg;
|
||||||
Ecore_Drm2_Fb *fb;
|
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;
|
if (!fb) return NULL;
|
||||||
|
|
||||||
fb->gbm = EINA_TRUE;
|
fb->gbm = EINA_TRUE;
|
||||||
|
fb->gbm_bo = bo;
|
||||||
|
|
||||||
fb->fd = fd;
|
fb->fd = fd;
|
||||||
fb->w = width;
|
fb->w = width;
|
||||||
|
@ -322,3 +323,9 @@ ecore_drm2_fb_busy_set(Ecore_Drm2_Fb *fb, Eina_Bool busy)
|
||||||
{
|
{
|
||||||
fb->busy = busy;
|
fb->busy = busy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI void *
|
||||||
|
ecore_drm2_fb_bo_get(Ecore_Drm2_Fb *f)
|
||||||
|
{
|
||||||
|
return f->gbm_bo;
|
||||||
|
}
|
||||||
|
|
|
@ -93,6 +93,8 @@ struct _Ecore_Drm2_Fb
|
||||||
uint32_t stride, size;
|
uint32_t stride, size;
|
||||||
uint32_t format;
|
uint32_t format;
|
||||||
|
|
||||||
|
void *gbm_bo;
|
||||||
|
|
||||||
Eina_Bool gbm : 1;
|
Eina_Bool gbm : 1;
|
||||||
Eina_Bool busy : 1;
|
Eina_Bool busy : 1;
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ _evas_outbuf_fb_get(Outbuf *ob, struct gbm_bo *bo)
|
||||||
|
|
||||||
fb =
|
fb =
|
||||||
ecore_drm2_fb_gbm_create(ob->fd, w, h, ob->depth, ob->bpp,
|
ecore_drm2_fb_gbm_create(ob->fd, w, h, ob->depth, ob->bpp,
|
||||||
format, hdl, stride);
|
format, hdl, stride, bo);
|
||||||
if (!fb)
|
if (!fb)
|
||||||
{
|
{
|
||||||
ERR("Failed to create FBO");
|
ERR("Failed to create FBO");
|
||||||
|
|
Loading…
Reference in New Issue