ecore-evas-drm: Use new Ecore_Drm functions to get properties of the output
authorChris Michael <cp.michael@samsung.com>
Wed, 8 Apr 2015 17:54:48 +0000 (13:54 -0400)
committerStefan Schmidt <s.schmidt@samsung.com>
Fri, 10 Apr 2015 09:09:51 +0000 (11:09 +0200)
Summary: This makes use of the newly added Ecore_Drm API functions to
get information about the output so we can setup the Evas engine
properly

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/modules/ecore_evas/engines/drm/ecore_evas_drm.c

index 72e2d62..d602f47 100644 (file)
@@ -249,14 +249,33 @@ ecore_evas_drm_new_internal(const char *device, unsigned int parent EINA_UNUSED,
 
    if ((einfo = (Evas_Engine_Info_Drm *)evas_engine_info_get(ee->evas)))
      {
+        Ecore_Drm_Output *output;
+        char *num;
+
         einfo->info.depth = 32; // FIXME
         einfo->info.destination_alpha = ee->alpha;
         einfo->info.rotation = ee->rotation;
-        einfo->info.vsync = EINA_TRUE;
+
+        if ((num = getenv("EVAS_DRM_VSYNC")))
+          {
+             if (!atoi(num))
+               einfo->info.vsync = EINA_FALSE;
+             else
+               einfo->info.vsync = EINA_TRUE;
+          }
+        else
+          einfo->info.vsync = EINA_TRUE;
+
         einfo->info.use_hw_accel = EINA_FALSE;
-        einfo->info.fd = ecore_drm_device_fd_get(dev);
         einfo->info.dev = dev;
 
+        if ((output = ecore_drm_device_output_find(dev, x, y)))
+          {
+             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))
           {
              ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
@@ -269,7 +288,7 @@ ecore_evas_drm_new_internal(const char *device, unsigned int parent EINA_UNUSED,
         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);
@@ -869,7 +888,7 @@ _ecore_evas_drm_fullscreen_set(Ecore_Evas *ee, Eina_Bool on)
         edata->w = ee->w;
         edata->h = ee->h;
         if ((einfo = (Evas_Engine_Info_Drm *)evas_engine_info_get(ee->evas)))
-          ecore_drm_output_size_get(dev, einfo->info.output, &ow, &oh);
+          ecore_drm_output_size_get(dev, einfo->info.buffer_id, &ow, &oh);
 
         if ((ow == 0) || (oh == 0))
           {