summaryrefslogtreecommitdiff
path: root/src/modules/ecore_evas/engines/drm
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-06-03 12:57:59 -0400
committerChris Michael <cp.michael@samsung.com>2015-06-05 10:00:44 -0400
commit39c28cbe8e61011f2e4abf9521e27dba848d48e0 (patch)
tree9dd4966a31af1c21a986e7bf5a2e8dbea7340e26 /src/modules/ecore_evas/engines/drm
parentee593050f1674f29a99156f135c92f43cb5897e2 (diff)
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.michael@samsung.com>
Diffstat (limited to 'src/modules/ecore_evas/engines/drm')
-rw-r--r--src/modules/ecore_evas/engines/drm/ecore_evas_drm.c41
1 files 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 01c230b47c..ae0c359835 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
360 /* try to init drm */ 360 /* try to init drm */
361 if (_ecore_evas_drm_init(device) < 1) return NULL; 361 if (_ecore_evas_drm_init(device) < 1) return NULL;
362 362
363 if (!ecore_drm_device_software_setup(dev))
364 {
365 ERR("Could not setup device for software");
366 goto soft_err;
367 }
368
363 /* try to load gl libary, gbm libary */ 369 /* try to load gl libary, gbm libary */
364 /* Typically, gbm loads the dri driver However some versions of Mesa 370 /* Typically, gbm loads the dri driver However some versions of Mesa
365 * do not have libglapi symbols linked in the driver. Because of this, 371 * 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
427 evas_data_attach_set(ee->evas, ee); 433 evas_data_attach_set(ee->evas, ee);
428 evas_output_method_set(ee->evas, method); 434 evas_output_method_set(ee->evas, method);
429 435
430 /* FIXME: Support initial rotation ?? */ 436 if ((ee->rotation == 90) || (ee->rotation == 270))
431 evas_output_size_set(ee->evas, w, h); 437 {
432 evas_output_viewport_set(ee->evas, 0, 0, w, h); 438 evas_output_size_set(ee->evas, h, w);
439 evas_output_viewport_set(ee->evas, 0, 0, h, w);
440 }
441 else
442 {
443 evas_output_size_set(ee->evas, w, h);
444 evas_output_viewport_set(ee->evas, 0, 0, w, h);
445 }
433 446
434 if (ee->can_async_render) 447 if (ee->can_async_render)
435 evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_POST, 448 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
437 450
438 if ((einfo = (Evas_Engine_Info_GL_Drm *)evas_engine_info_get(ee->evas))) 451 if ((einfo = (Evas_Engine_Info_GL_Drm *)evas_engine_info_get(ee->evas)))
439 { 452 {
453 Ecore_Drm_Output *output;
454
440 einfo->info.depth = 32; 455 einfo->info.depth = 32;
441 einfo->info.destination_alpha = ee->alpha; 456 einfo->info.destination_alpha = ee->alpha;
442 einfo->info.rotation = ee->rotation; 457 einfo->info.rotation = ee->rotation;
@@ -444,24 +459,22 @@ ecore_evas_gl_drm_new_internal(const char *device, unsigned int parent EINA_UNUS
444 if ((num = getenv("EVAS_DRM_VSYNC"))) 459 if ((num = getenv("EVAS_DRM_VSYNC")))
445 { 460 {
446 if (!atoi(num)) 461 if (!atoi(num))
447 einfo->vsync = EINA_FALSE; 462 einfo->info.vsync = EINA_FALSE;
448 else 463 else
449 einfo->vsync = EINA_TRUE; 464 einfo->info.vsync = EINA_TRUE;
450 } 465 }
451 else 466 else
452 einfo->vsync = EINA_TRUE; 467 einfo->info.vsync = EINA_TRUE;
453 468
454 einfo->info.fd = ecore_drm_device_fd_get(dev);
455 einfo->info.dev = dev; 469 einfo->info.dev = dev;
456 einfo->info.format = format; 470 einfo->info.format = format;
457 einfo->info.flags = flags; 471 einfo->info.flags = flags;
458 472
459 if (einfo->info.fd) 473 if ((output = ecore_drm_device_output_find(dev, x, y)))
460 einfo->info.gbm = gbm_create_device(einfo->info.fd);
461 if (einfo->info.gbm)
462 { 474 {
463 einfo->info.surface = 475 einfo->info.conn_id = ecore_drm_output_connector_id_get(output);
464 gbm_surface_create(einfo->info.gbm, w, h, format, flags); 476 einfo->info.crtc_id = ecore_drm_output_crtc_id_get(output);
477 einfo->info.buffer_id = ecore_drm_output_crtc_buffer_get(output);
465 } 478 }
466 479
467 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) 480 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
476 goto eng_err; 489 goto eng_err;
477 } 490 }
478 491
479 ee->prop.window = einfo->info.output; 492 ee->prop.window = einfo->info.buffer_id;
480 493
481 _ecore_evas_register(ee); 494 _ecore_evas_register(ee);
482 ecore_evas_input_event_register(ee); 495 ecore_evas_input_event_register(ee);
@@ -497,9 +510,9 @@ ecore_evas_gl_drm_new_internal(const char *device, unsigned int parent EINA_UNUS
497 510
498eng_err: 511eng_err:
499 ecore_evas_free(ee); 512 ecore_evas_free(ee);
513soft_err:
500ee_err: 514ee_err:
501 _ecore_evas_drm_shutdown(); 515 _ecore_evas_drm_shutdown();
502
503 return NULL; 516 return NULL;
504} 517}
505#endif 518#endif