From: Christopher Michael Date: Wed, 2 Jan 2019 15:33:42 +0000 (-0500) Subject: ecore-drm2: Add support for specifying a particular drm card X-Git-Tag: accepted/tizen/unified/20190107.065404~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=deb543cbc7635486f0d4dde02d255c362758263e;p=platform%2Fupstream%2Fefl.git ecore-drm2: Add support for specifying a particular drm card Summary: There are cases where the drm card that we wish to run on is not always the first card (ie: card1, card2, etc). In our previous code, we would always start searching at card0 and if found we would always use that card. This patch allows a card to be specified in the environment that can be searched for and used. For example, if we specify ECORE_DRM2_CARD=card1 than that card will be searched and used if found. This also allows wildcard searches such as ECORE_DRM2_CARD=card[1-9]* which can be used to skip the first card (card0). Reviewers: ManMower Reviewed By: ManMower Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7530 --- diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c b/src/lib/ecore_drm2/ecore_drm2_device.c index f5059f5..9108db6 100644 --- a/src/lib/ecore_drm2/ecore_drm2_device.c +++ b/src/lib/ecore_drm2/ecore_drm2_device.c @@ -95,14 +95,19 @@ static const char * _drm2_device_find(Elput_Manager *em, const char *seat) { Eina_List *devs, *l; - const char *dev, *ret = NULL, *chosen_dev = NULL; + const char *dev, *ret = NULL, *chosen_dev = NULL, *d = NULL; Eina_Bool found = EINA_FALSE; Eina_Bool modeset; int fd; EINA_SAFETY_ON_NULL_RETURN_VAL(seat, NULL); - devs = eeze_udev_find_by_subsystem_sysname("drm", "card[0-9]*"); + d = getenv("ECORE_DRM2_CARD"); + if (d) + devs = eeze_udev_find_by_subsystem_sysname("drm", d); + else + devs = eeze_udev_find_by_subsystem_sysname("drm", "card[0-9]*"); + if (!devs) return NULL; EINA_LIST_FOREACH(devs, l, dev)