summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-01-11 22:53:18 +0100
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-01-13 18:51:49 +0100
commit0a2f066c2d299edef7b58cc663c7bd22616b344d (patch)
tree867a693398c173ba628f8e4d84d1e683ea000d2b /src/lib/ecore_drm
parent093846aaea3da28f2227f8c300ee807edd5c1ff4 (diff)
ecore_drm: close all devices in shutdown
Diffstat (limited to 'src/lib/ecore_drm')
-rw-r--r--src/lib/ecore_drm/ecore_drm.c16
-rw-r--r--src/lib/ecore_drm/ecore_drm_device.c10
2 files changed, 21 insertions, 5 deletions
diff --git a/src/lib/ecore_drm/ecore_drm.c b/src/lib/ecore_drm/ecore_drm.c
index 07b6a4f..36eff1c 100644
--- a/src/lib/ecore_drm/ecore_drm.c
+++ b/src/lib/ecore_drm/ecore_drm.c
@@ -108,15 +108,18 @@ log_err:
108 108
109/** 109/**
110 * Shutdown the Ecore_Drm library. 110 * Shutdown the Ecore_Drm library.
111 * 111 *
112 * @return The number of times the library has been initialized without 112 * @return The number of times the library has been initialized without
113 * being shutdown. 0 is returned if an error occurs. 113 * being shutdown. 0 is returned if an error occurs.
114 * 114 *
115 * @ingroup Ecore_Drm_Init_Group 115 * @ingroup Ecore_Drm_Init_Group
116 */ 116 */
117EAPI int 117EAPI int
118ecore_drm_shutdown(void) 118ecore_drm_shutdown(void)
119{ 119{
120 Eina_List *lists;
121 Ecore_Drm_Device *dev;
122
120 /* _ecore_drm_init_count should not go below zero. */ 123 /* _ecore_drm_init_count should not go below zero. */
121 if (_ecore_drm_init_count < 1) 124 if (_ecore_drm_init_count < 1)
122 { 125 {
@@ -127,6 +130,13 @@ ecore_drm_shutdown(void)
127 /* if we are still in use, decrement init count and get out */ 130 /* if we are still in use, decrement init count and get out */
128 if (--_ecore_drm_init_count != 0) return _ecore_drm_init_count; 131 if (--_ecore_drm_init_count != 0) return _ecore_drm_init_count;
129 132
133 /* free the list of devices */
134 lists = eina_list_clone(ecore_drm_devices_get());
135 EINA_LIST_FREE(lists, dev)
136 {
137 ecore_drm_device_free(dev);
138 }
139
130 _ecore_drm_inputs_shutdown(); 140 _ecore_drm_inputs_shutdown();
131 141
132 /* close eeze */ 142 /* close eeze */
diff --git a/src/lib/ecore_drm/ecore_drm_device.c b/src/lib/ecore_drm/ecore_drm_device.c
index 1b7fc8b..a91af95 100644
--- a/src/lib/ecore_drm/ecore_drm_device.c
+++ b/src/lib/ecore_drm/ecore_drm_device.c
@@ -277,12 +277,18 @@ ecore_drm_device_free(Ecore_Drm_Device *dev)
277 if (dev->dumb[i]) ecore_drm_fb_destroy(dev->dumb[i]); 277 if (dev->dumb[i]) ecore_drm_fb_destroy(dev->dumb[i]);
278 dev->dumb[i] = NULL; 278 dev->dumb[i] = NULL;
279 } 279 }
280 280 /* destroy all sprites*/
281 ecore_drm_sprites_destroy(dev);
282 /* clear inputs */
281 ecore_drm_inputs_destroy(dev); 283 ecore_drm_inputs_destroy(dev);
282
283 /* free outputs */ 284 /* free outputs */
284 EINA_LIST_FREE(dev->outputs, output) 285 EINA_LIST_FREE(dev->outputs, output)
285 ecore_drm_output_free(output); 286 ecore_drm_output_free(output);
287 /* disconnect launcher */
288 ecore_drm_launcher_disconnect(dev);
289 /* close myself */
290 ecore_drm_device_close(dev);
291
286 292
287 /* free crtcs */ 293 /* free crtcs */
288 if (dev->crtcs) free(dev->crtcs); 294 if (dev->crtcs) free(dev->crtcs);