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 14:20:24 -0400
commitecc000d84c540804a19184c897627aa19efd220f (patch)
tree4abd4996ce5bc0b9fd21f461760f783ccc21d0a4
parentf8e28f37dc79ab8e6c03d6d7efd6a82bc0c287ad (diff)
downloadefl-ecc000d84c540804a19184c897627aa19efd220f.tar.gz
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)
{
pstate->cid.id = prop->prop_id;
pstate->cid.value = oprops->prop_values[i];
+ DBG("\t\t\tValue: %d", pstate->cid.value);
}
else if (!strcmp(prop->name, "FB_ID"))
{
pstate->fid.id = prop->prop_id;
pstate->fid.value = oprops->prop_values[i];
- }
+ DBG("\t\t\tValue: %d", pstate->fid.value);
+ }
else if (!strcmp(prop->name, "CRTC_X"))
{
pstate->cx.id = prop->prop_id;
@@ -426,13 +428,13 @@ _drm2_atomic_state_plane_fill(Ecore_Drm2_Plane_State *pstate, int fd)
switch (pstate->type.value)
{
case DRM_PLANE_TYPE_OVERLAY:
- DBG("\t\t\tOverlay Type");
+ DBG("\t\t\tOverlay Plane");
break;
case DRM_PLANE_TYPE_PRIMARY:
- DBG("\t\t\tPrimary Type");
+ DBG("\t\t\tPrimary Plane");
break;
case DRM_PLANE_TYPE_CURSOR:
- DBG("\t\t\tCursor Type");
+ DBG("\t\t\tCursor Plane");
break;
default:
DBG("\t\t\tValue: %d", pstate->type.value);
@@ -548,6 +550,15 @@ _drm2_atomic_state_fill(Ecore_Drm2_Atomic_State *state, int fd)
err:
drmModeFreeResources(res);
}
+
+static void
+_drm2_atomic_state_free(Ecore_Drm2_Atomic_State *state)
+{
+ free(state->plane_states);
+ free(state->conn_states);
+ free(state->crtc_states);
+ free(state);
+}
#endif
EAPI Ecore_Drm2_Device *
@@ -655,6 +666,11 @@ ecore_drm2_device_free(Ecore_Drm2_Device *device)
{
EINA_SAFETY_ON_NULL_RETURN(device);
+#ifdef HAVE_ATOMIC_DRM
+ if (_ecore_drm2_use_atomic)
+ _drm2_atomic_state_free(device->state);
+#endif
+
ecore_event_handler_del(device->active_hdlr);
ecore_event_handler_del(device->device_change_hdlr);
eina_stringshare_del(device->path);