diff options
author | Chris Michael <cp.michael@samsung.com> | 2016-09-22 11:42:57 -0400 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2016-09-22 14:20:24 -0400 |
commit | ecc000d84c540804a19184c897627aa19efd220f (patch) | |
tree | 4abd4996ce5bc0b9fd21f461760f783ccc21d0a4 /src/lib/ecore_drm2/ecore_drm2_device.c | |
parent | f8e28f37dc79ab8e6c03d6d7efd6a82bc0c287ad (diff) |
ecore-drm2: Add code to free Atomic state on shutdown
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_drm2/ecore_drm2_device.c')
-rw-r--r-- | src/lib/ecore_drm2/ecore_drm2_device.c | 24 |
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) | |||
548 | err: | 550 | err: |
549 | drmModeFreeResources(res); | 551 | drmModeFreeResources(res); |
550 | } | 552 | } |
553 | |||
554 | static 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 | ||
553 | EAPI Ecore_Drm2_Device * | 564 | EAPI 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); |