ecore_drm: Added internal function to check if drm device is hotplug device
Summary: Added _ecore_drm_output_device_is_hotplug API to check if the drm device is hotplug device. It returns EINA_TRUE if device is hotplug else returns EINA_FALSE @feature Signed-off-by: vivek <vivek.ellur@samsung.com> Reviewers: devilhorns Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1559
This commit is contained in:
parent
e1c0928ea3
commit
2a9272333f
|
@ -623,6 +623,26 @@ finish:
|
|||
_ecore_drm_output_frame_finish(output);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_ecore_drm_output_device_is_hotplug(Ecore_Drm_Output *output)
|
||||
{
|
||||
const char *syspath;
|
||||
const char *val;
|
||||
int sysnum;
|
||||
|
||||
syspath = output->dev->drm.path;
|
||||
sysnum = eeze_udev_syspath_get_sysnum(syspath);
|
||||
|
||||
if ((sysnum == -1) || (sysnum != output->dev->id))
|
||||
return EINA_FALSE;
|
||||
|
||||
val = eeze_udev_syspath_get_property(syspath, "HOTPLUG");
|
||||
if (!val)
|
||||
return EINA_FALSE;
|
||||
|
||||
return (strcmp(val, "1") == 0);
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_drm_output_event(const char *device, Eeze_Udev_Event event, void *data, Eeze_Udev_Watch *watch EINA_UNUSED)
|
||||
{
|
||||
|
@ -630,7 +650,10 @@ _ecore_drm_output_event(const char *device, Eeze_Udev_Event event, void *data, E
|
|||
|
||||
if (!(output = data)) return;
|
||||
|
||||
/* TODO: Check if device is hotplug and update outputs */
|
||||
if (_ecore_drm_output_device_is_hotplug(output))
|
||||
{
|
||||
DBG("Output Hotplug Event");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue