ecore-drm: add ecore_drm_devices_get to get the list of drm devices

Summary:
    when enlightenment is working as wayland display server, enlightenment
    changes KDSETMODE to KD_GRAPHICS in _ecore_drm_tty_setup(). However,
    when enlightenment is killed by SIGSEGV, it doesn't changes KDSETMODE
    to KD_TEXT because englightenment process doesn't call ecore_drm_tty_close().
    To make possible enlightenment call ecore_drm_tty_close(), drm devices
    should be exposed.
    When enlightenment is killed by SIGSEGV, it will get drm devices with
    ecore_drm_device_get_list(), and will call ecore_drm_launcher_disconnect(),
    and ecore_drm_launcher_disconnect will call ecore_drm_tty_close() internally.

@feature

Change-Id: I1c594739ec96660a09cee77b823ace6548ee5282

Reviewers: zmike, cedric, raster, gwanglim, devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2159
This commit is contained in:
Boram Park 2015-03-17 09:30:59 -04:00 committed by Chris Michael
parent 841890a7b6
commit 9baacf802d
2 changed files with 22 additions and 0 deletions

View File

@ -326,4 +326,14 @@ EAPI Eina_Stringshare *ecore_drm_output_make_get(Ecore_Drm_Output *output);
*/
EAPI void ecore_drm_device_pointer_xy_get(Ecore_Drm_Device *dev, int *x, int *y);
/**
* Get the list of drm devices which are allocated.
*
* @return Eina_List of drm devices, NULL otherwise
*
* @ingroup Ecore_Drm_Device_Group
* @since 1.14
*/
EAPI Eina_List *ecore_drm_devices_get(void);
#endif

View File

@ -5,6 +5,8 @@
#include "ecore_drm_private.h"
#include <dlfcn.h>
static Eina_List *drm_devices;
static void
_ecore_drm_device_cb_page_flip(int fd EINA_UNUSED, unsigned int frame EINA_UNUSED, unsigned int sec EINA_UNUSED, unsigned int usec EINA_UNUSED, void *data)
{
@ -191,6 +193,8 @@ cont:
dev->session = NULL;
DBG("Using Drm Device: %s", dev->drm.name);
drm_devices = eina_list_append(drm_devices, dev);
}
out:
@ -236,6 +240,8 @@ ecore_drm_device_free(Ecore_Drm_Device *dev)
/* free session */
free(dev->session);
drm_devices = eina_list_remove(drm_devices, dev);
/* free structure */
free(dev);
}
@ -334,6 +340,12 @@ ecore_drm_device_close(Ecore_Drm_Device *dev)
return EINA_TRUE;
}
EAPI Eina_List *
ecore_drm_devices_get(void)
{
return drm_devices;
}
/**
* Get if a given Ecore_Drm_Device is master
*