gl_drm ee: Move to new per fb status callbacks
authorDerek Foreman <derekf@osg.samsung.com>
Thu, 15 Jun 2017 18:02:21 +0000 (13:02 -0500)
committerDerek Foreman <derekf@osg.samsung.com>
Fri, 23 Jun 2017 13:15:40 +0000 (08:15 -0500)
Switch over to the per fb status callbacks as the old per output api is
about to be removed.

src/modules/evas/engines/gl_drm/evas_outbuf.c

index 63cdb07..69fe64c 100644 (file)
@@ -45,12 +45,14 @@ _evas_outbuf_fb_cb_destroy(struct gbm_bo *bo EINA_UNUSED, void *data)
 }
 
 void
-_evas_outbuf_release_fb(void *ob_v, Ecore_Drm2_Fb *fb)
- {
+_evas_outbuf_release_fb(Ecore_Drm2_Fb *fb, Ecore_Drm2_Fb_Status status, void *data)
+{
    struct gbm_bo *bo;
    Outbuf *ob;
 
-   ob = ob_v;
+   if (status != ECORE_DRM2_FB_STATUS_RELEASE) return;
+
+   ob = data;
    bo = ecore_drm2_fb_bo_get(fb);
    gbm_surface_release_buffer(ob->surface, bo);
 }
@@ -81,6 +83,8 @@ _evas_outbuf_fb_get(Outbuf *ob, struct gbm_bo *bo)
         return NULL;
      }
 
+   ecore_drm2_fb_status_handler_set(fb, _evas_outbuf_release_fb, ob);
+
    gbm_bo_set_user_data(bo, fb, _evas_outbuf_fb_cb_destroy);
 
    return fb;
@@ -400,10 +404,6 @@ evas_outbuf_new(Evas_Engine_Info_GL_Drm *info, int w, int h, Render_Engine_Swap_
    ob->format = info->info.format;
    ob->priv.output = info->info.output;
 
-   ecore_drm2_output_release_handler_set(ob->priv.output,
-                                         _evas_outbuf_release_fb,
-                                         ob);
-
    /* if ((num = getenv("EVAS_GL_DRM_VSYNC"))) */
    /*   ob->vsync = atoi(num); */