ecore_drm2: Store gbm_bo for Fbs and add a getter function for it
authorDerek Foreman <derekf@osg.samsung.com>
Fri, 9 Sep 2016 18:18:41 +0000 (13:18 -0500)
committerDerek Foreman <derekf@osg.samsung.com>
Fri, 9 Sep 2016 18:39:05 +0000 (13:39 -0500)
This will aid with proper locking in gl_drm later

src/lib/ecore_drm2/Ecore_Drm2.h
src/lib/ecore_drm2/ecore_drm2_fb.c
src/lib/ecore_drm2/ecore_drm2_private.h
src/modules/evas/engines/gl_drm/evas_outbuf.c

index 598d831..99a2e9a 100644 (file)
@@ -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
index f660f05..d772768 100644 (file)
@@ -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;
+}
index 96acfa4..d78d011 100644 (file)
@@ -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;
 
index fb16c29..fb75313 100644 (file)
@@ -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");