From ca701a5ff2773c6c77d9f6feeab8299c20dc3a93 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Wed, 12 Mar 2014 10:25:36 +0000 Subject: [PATCH] ecore-evas-drm: Try to find a drm device with the given name If we are given a drm device name, tell ecore_drm to try and find That device. If it is not found, we fallback to the default drm device. Signed-off-by: Chris Michael --- src/modules/ecore_evas/engines/drm/ecore_evas_drm.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c index cd408e4..600b805 100644 --- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c +++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c @@ -28,7 +28,7 @@ struct _Ecore_Evas_Engine_Data_Drm }; /* local function prototypes */ -static int _ecore_evas_drm_init(void); +static int _ecore_evas_drm_init(const char *device); static int _ecore_evas_drm_shutdown(void); static Ecore_Evas_Interface_Drm *_ecore_evas_drm_interface_new(void); @@ -137,7 +137,7 @@ ecore_evas_drm_new_internal(const char *device, unsigned int parent, int x, int } /* try to init drm */ - if (_ecore_evas_drm_init() < 1) return NULL; + if (_ecore_evas_drm_init(device) < 1) return NULL; /* try to allocate space for new ecore_evas */ if (!(ee = calloc(1, sizeof(Ecore_Evas)))) @@ -232,7 +232,7 @@ ee_err: /* local functions */ static int -_ecore_evas_drm_init(void) +_ecore_evas_drm_init(const char *device) { if (++_ecore_evas_init_count != 1) return _ecore_evas_init_count; @@ -244,10 +244,13 @@ _ecore_evas_drm_init(void) } /* try to find the device */ - if (!(dev = ecore_drm_device_find(NULL, NULL))) + if (!(dev = ecore_drm_device_find(device, NULL))) { - ERR("Could not find default drm device"); - goto dev_err; + ERR("Could not find drm device with name: %s"); + + /* try getting the default drm device */ + if (!(dev = ecore_drm_device_find(NULL, NULL))) + goto dev_err; } /* try to open the graphics card */ -- 2.7.4