summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2014-10-21 08:26:25 -0400
committerChris Michael <cp.michael@samsung.com>2014-10-21 08:26:25 -0400
commit8549ee799ad9175ff011ae680def3f6787140206 (patch)
tree1b45e7ee7d2a2161ac0a47a0df4f0d7a4fc65a67 /src
parent6cf9246ad63b77f0dcc3bec92862529debf48fed (diff)
downloadefl-8549ee799ad9175ff011ae680def3f6787140206.tar.gz
ecore-drm: Create udev watch for each output, and delete the watch
when we free the output. Summary: This commit fixes an issue where a hotplug watch was Only being added for One input, and also deletes any created watch during output_free. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_drm/ecore_drm_output.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_output.c b/src/lib/ecore_drm/ecore_drm_output.c
index 396e888aaf..67f8f0cefe 100644
--- a/src/lib/ecore_drm/ecore_drm_output.c
+++ b/src/lib/ecore_drm/ecore_drm_output.c
@@ -680,6 +680,8 @@ ecore_drm_outputs_create(Ecore_Drm_Device *dev)
for (i = 0; i < res->count_connectors; i++)
{
+ int events = 0;
+
/* get the connector */
if (!(conn = drmModeGetConnector(dev->drm.fd, res->connectors[i])))
continue;
@@ -720,6 +722,15 @@ ecore_drm_outputs_create(Ecore_Drm_Device *dev)
drmModeFreeCrtc(crtc);
drmModeFreeEncoder(enc);
+ events = (EEZE_UDEV_EVENT_ADD | EEZE_UDEV_EVENT_REMOVE);
+
+ output->watch =
+ eeze_udev_watch_add(EEZE_UDEV_TYPE_DRM, events,
+ _ecore_drm_output_event, output);
+
+ if (!output->watch)
+ ERR("Could not create Eeze_Udev_Watch for drm output");
+
dev->outputs = eina_list_append(dev->outputs, output);
}
@@ -737,20 +748,6 @@ ecore_drm_outputs_create(Ecore_Drm_Device *dev)
/* free resources */
drmModeFreeResources(res);
- if ((output) && (!output->watch))
- {
- int events = 0;
-
- events = (EEZE_UDEV_EVENT_ADD | EEZE_UDEV_EVENT_REMOVE);
- if (!(output->watch =
- eeze_udev_watch_add(EEZE_UDEV_TYPE_DRM, events,
- _ecore_drm_output_event, output)))
- {
- ERR("Could not create Eeze_Udev_Watch for drm output");
- return EINA_FALSE;
- }
- }
-
return ret;
}
@@ -762,6 +759,9 @@ ecore_drm_output_free(Ecore_Drm_Output *output)
/* check for valid output */
if (!output) return;
+ /* delete any added udev watch */
+ if (output->watch) eeze_udev_watch_del(output->watch);
+
/* free modes */
EINA_LIST_FREE(output->modes, mode)
free(mode);