ecore-drm: Added initial support to check if drm device is hotplug and update outputs
Summary: Added watch to check if drm output device is hotplug and update the outputs accordingly. NB: This is only partially complete. The actual update of outputs still needs to be implemented. Signed-off-by: vivek <vivek.ellur@samsung.com> Reviewers: devilhorns Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1552
This commit is contained in:
parent
fc4b1982cc
commit
0fb11c15a1
|
@ -623,6 +623,18 @@ finish:
|
|||
_ecore_drm_output_frame_finish(output);
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_drm_output_event(const char *device, Eeze_Udev_Event event, void *data, Eeze_Udev_Watch *watch EINA_UNUSED)
|
||||
{
|
||||
Ecore_Drm_Output *output;
|
||||
|
||||
if (!(output = data)) return;
|
||||
|
||||
/* TODO: Check if device is hotplug and update outputs */
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @defgroup Ecore_Drm_Output_Group Ecore DRM Output
|
||||
*
|
||||
|
@ -727,7 +739,19 @@ ecore_drm_outputs_create(Ecore_Drm_Device *dev)
|
|||
/* free resources */
|
||||
drmModeFreeResources(res);
|
||||
|
||||
/* TODO: add hook for udev drm output updates */
|
||||
if (!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;
|
||||
}
|
||||
|
|
|
@ -116,6 +116,7 @@ struct _Ecore_Drm_Output
|
|||
unsigned int crtc_id;
|
||||
unsigned int conn_id;
|
||||
drmModeCrtcPtr crtc;
|
||||
Eeze_Udev_Watch *watch;
|
||||
|
||||
int x, y;
|
||||
int drm_fd;
|
||||
|
|
Loading…
Reference in New Issue