devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=39c28cbe8e61011f2e4abf9521e27dba848d48e0

commit 39c28cbe8e61011f2e4abf9521e27dba848d48e0
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Wed Jun 3 12:57:59 2015 -0400

    ecore-evas-drm: Update ecore_evas_drm for recent evas gl_drm changes
    
    Summary: Previous Ecore_Evas drm code would create the gbm device and
    surface inside the gl_drm function. As these are now handled inside
    the evas-gl-drm engine itself, this code is not needed here.
    
    @fix
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 .../ecore_evas/engines/drm/ecore_evas_drm.c        | 41 ++++++++++++++--------
 1 file changed, 27 insertions(+), 14 deletions(-)

diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c 
b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
index 01c230b..ae0c359 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -360,6 +360,12 @@ ecore_evas_gl_drm_new_internal(const char *device, 
unsigned int parent EINA_UNUS
    /* try to init drm */
    if (_ecore_evas_drm_init(device) < 1) return NULL;
 
+   if (!ecore_drm_device_software_setup(dev))
+     {
+        ERR("Could not setup device for software");
+        goto soft_err;
+     }
+
    /* try to load gl libary, gbm libary */
    /* Typically, gbm loads the dri driver However some versions of Mesa
     * do not have libglapi symbols linked in the driver. Because of this,
@@ -427,9 +433,16 @@ ecore_evas_gl_drm_new_internal(const char *device, 
unsigned int parent EINA_UNUS
    evas_data_attach_set(ee->evas, ee);
    evas_output_method_set(ee->evas, method);
 
-   /* FIXME: Support initial rotation ?? */
-   evas_output_size_set(ee->evas, w, h);
-   evas_output_viewport_set(ee->evas, 0, 0, w, h);
+   if ((ee->rotation == 90) || (ee->rotation == 270))
+     {
+        evas_output_size_set(ee->evas, h, w);
+        evas_output_viewport_set(ee->evas, 0, 0, h, w);
+     }
+   else
+     {
+        evas_output_size_set(ee->evas, w, h);
+        evas_output_viewport_set(ee->evas, 0, 0, w, h);
+     }
 
    if (ee->can_async_render)
      evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_POST,
@@ -437,6 +450,8 @@ ecore_evas_gl_drm_new_internal(const char *device, unsigned 
int parent EINA_UNUS
 
    if ((einfo = (Evas_Engine_Info_GL_Drm *)evas_engine_info_get(ee->evas)))
      {
+        Ecore_Drm_Output *output;
+
         einfo->info.depth = 32;
         einfo->info.destination_alpha = ee->alpha;
         einfo->info.rotation = ee->rotation;
@@ -444,24 +459,22 @@ ecore_evas_gl_drm_new_internal(const char *device, 
unsigned int parent EINA_UNUS
         if ((num = getenv("EVAS_DRM_VSYNC")))
           {
              if (!atoi(num)) 
-               einfo->vsync = EINA_FALSE;
+               einfo->info.vsync = EINA_FALSE;
              else 
-               einfo->vsync = EINA_TRUE;
+               einfo->info.vsync = EINA_TRUE;
           }
         else 
-          einfo->vsync = EINA_TRUE;
+          einfo->info.vsync = EINA_TRUE;
 
-        einfo->info.fd = ecore_drm_device_fd_get(dev);
         einfo->info.dev = dev;
         einfo->info.format = format;
         einfo->info.flags = flags;
 
-        if (einfo->info.fd) 
-          einfo->info.gbm = gbm_create_device(einfo->info.fd);
-        if (einfo->info.gbm)
+        if ((output = ecore_drm_device_output_find(dev, x, y)))
           {
-             einfo->info.surface = 
-               gbm_surface_create(einfo->info.gbm, w, h, format, flags);
+             einfo->info.conn_id = ecore_drm_output_connector_id_get(output);
+             einfo->info.crtc_id = ecore_drm_output_crtc_id_get(output);
+             einfo->info.buffer_id = ecore_drm_output_crtc_buffer_get(output);
           }
 
         if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
@@ -476,7 +489,7 @@ ecore_evas_gl_drm_new_internal(const char *device, unsigned 
int parent EINA_UNUS
         goto eng_err;
      }
 
-   ee->prop.window = einfo->info.output;
+   ee->prop.window = einfo->info.buffer_id;
 
    _ecore_evas_register(ee);
    ecore_evas_input_event_register(ee);
@@ -497,9 +510,9 @@ ecore_evas_gl_drm_new_internal(const char *device, unsigned 
int parent EINA_UNUS
 
 eng_err:
    ecore_evas_free(ee);
+soft_err:
 ee_err:
    _ecore_evas_drm_shutdown();
-
    return NULL;
 }
 #endif

-- 


Reply via email to