ecore-drm2: Cleanup list of output planes on output_destroy
authorChris Michael <cp.michael@samsung.com>
Mon, 27 Mar 2017 15:53:54 +0000 (11:53 -0400)
committerChris Michael <cp.michael@samsung.com>
Tue, 18 Apr 2017 11:55:10 +0000 (07:55 -0400)
Small patch to make sure we free memory previously allocated for
hardware planes when we destroy an output

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/lib/ecore_drm2/ecore_drm2_outputs.c
src/lib/ecore_drm2/ecore_drm2_private.h

index 3235015..cc4f148 100644 (file)
@@ -906,11 +906,15 @@ _output_destroy(Ecore_Drm2_Device *dev, Ecore_Drm2_Output *output)
 #ifdef HAVE_ATOMIC_DRM
    if (_ecore_drm2_use_atomic)
      {
+        Ecore_Drm2_Plane *plane;
         Ecore_Drm2_Plane_State *pstate;
 
         EINA_LIST_FREE(output->plane_states, pstate)
           free(pstate);
 
+        EINA_LIST_FREE(output->planes, plane)
+          free(plane);
+
         free(output->conn_state);
         free(output->crtc_state);
      }
index 0c5937d..3a9f15a 100644 (file)
@@ -711,7 +711,7 @@ struct _Ecore_Drm2_Plane
    Ecore_Drm2_Fb *fb; // current fbo
    Ecore_Drm2_Fb *qfb; // queued fbo
 # ifdef HAVE_ATOMIC_DRM
-   Ecore_Drm2_Plane_State *plane_state;
+   Ecore_Drm2_Plane_State *state;
 # endif
 };
 
@@ -775,6 +775,7 @@ struct _Ecore_Drm2_Output
    Ecore_Drm2_Crtc_State *crtc_state;
    Ecore_Drm2_Connector_State *conn_state;
    Eina_List *plane_states;
+   Eina_List *planes;
 # endif
 
    Eina_Bool connected : 1;