summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2016-09-22 11:42:57 -0400
committerChris Michael <cp.michael@samsung.com>2016-09-22 13:33:57 -0400
commite90722fc22760d5f855057ad65a6710a715b4ad2 (patch)
treeabdedf6f7f0142b91bdde63fe3ff0bba7eb403cd
parente92ded58dc88d0a50100df80b5582ff35e4a80cc (diff)
ecore-drm2: Add code to free Atomic state on shutdown
Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_device.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c b/src/lib/ecore_drm2/ecore_drm2_device.c
index 262de80dba..6cd415b481 100644
--- a/src/lib/ecore_drm2/ecore_drm2_device.c
+++ b/src/lib/ecore_drm2/ecore_drm2_device.c
@@ -373,12 +373,14 @@ _drm2_atomic_state_plane_fill(Ecore_Drm2_Plane_State *pstate, int fd)
373 { 373 {
374 pstate->cid.id = prop->prop_id; 374 pstate->cid.id = prop->prop_id;
375 pstate->cid.value = oprops->prop_values[i]; 375 pstate->cid.value = oprops->prop_values[i];
376 DBG("\t\t\tValue: %d", pstate->cid.value);
376 } 377 }
377 else if (!strcmp(prop->name, "FB_ID")) 378 else if (!strcmp(prop->name, "FB_ID"))
378 { 379 {
379 pstate->fid.id = prop->prop_id; 380 pstate->fid.id = prop->prop_id;
380 pstate->fid.value = oprops->prop_values[i]; 381 pstate->fid.value = oprops->prop_values[i];
381 } 382 DBG("\t\t\tValue: %d", pstate->fid.value);
383 }
382 else if (!strcmp(prop->name, "CRTC_X")) 384 else if (!strcmp(prop->name, "CRTC_X"))
383 { 385 {
384 pstate->cx.id = prop->prop_id; 386 pstate->cx.id = prop->prop_id;
@@ -426,13 +428,13 @@ _drm2_atomic_state_plane_fill(Ecore_Drm2_Plane_State *pstate, int fd)
426 switch (pstate->type.value) 428 switch (pstate->type.value)
427 { 429 {
428 case DRM_PLANE_TYPE_OVERLAY: 430 case DRM_PLANE_TYPE_OVERLAY:
429 DBG("\t\t\tOverlay Type"); 431 DBG("\t\t\tOverlay Plane");
430 break; 432 break;
431 case DRM_PLANE_TYPE_PRIMARY: 433 case DRM_PLANE_TYPE_PRIMARY:
432 DBG("\t\t\tPrimary Type"); 434 DBG("\t\t\tPrimary Plane");
433 break; 435 break;
434 case DRM_PLANE_TYPE_CURSOR: 436 case DRM_PLANE_TYPE_CURSOR:
435 DBG("\t\t\tCursor Type"); 437 DBG("\t\t\tCursor Plane");
436 break; 438 break;
437 default: 439 default:
438 DBG("\t\t\tValue: %d", pstate->type.value); 440 DBG("\t\t\tValue: %d", pstate->type.value);
@@ -548,6 +550,15 @@ _drm2_atomic_state_fill(Ecore_Drm2_Atomic_State *state, int fd)
548err: 550err:
549 drmModeFreeResources(res); 551 drmModeFreeResources(res);
550} 552}
553
554static void
555_drm2_atomic_state_free(Ecore_Drm2_Atomic_State *state)
556{
557 free(state->plane_states);
558 free(state->conn_states);
559 free(state->crtc_states);
560 free(state);
561}
551#endif 562#endif
552 563
553EAPI Ecore_Drm2_Device * 564EAPI Ecore_Drm2_Device *
@@ -655,6 +666,11 @@ ecore_drm2_device_free(Ecore_Drm2_Device *device)
655{ 666{
656 EINA_SAFETY_ON_NULL_RETURN(device); 667 EINA_SAFETY_ON_NULL_RETURN(device);
657 668
669#ifdef HAVE_ATOMIC_DRM
670 if (_ecore_drm2_use_atomic)
671 _drm2_atomic_state_free(device->state);
672#endif
673
658 ecore_event_handler_del(device->active_hdlr); 674 ecore_event_handler_del(device->active_hdlr);
659 ecore_event_handler_del(device->device_change_hdlr); 675 ecore_event_handler_del(device->device_change_hdlr);
660 eina_stringshare_del(device->path); 676 eina_stringshare_del(device->path);