summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm2
diff options
context:
space:
mode:
authorChristopher Michael <devilhorns@comcast.net>2019-01-02 10:33:42 -0500
committerChristopher Michael <cp.michael@samsung.com>2019-01-02 10:33:42 -0500
commit6fcffef3ffa1414154ed17320f209817ef14fcf8 (patch)
tree08cdd40c9a88917d08e06d8910f5fb9d006a352b /src/lib/ecore_drm2
parentbd6d83bee7c32ee0c03a941ff4b142202b7fffa4 (diff)
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
Diffstat (limited to 'src/lib/ecore_drm2')
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_device.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c b/src/lib/ecore_drm2/ecore_drm2_device.c
index f5059f5e68..9108db6ff8 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 *
95_drm2_device_find(Elput_Manager *em, const char *seat) 95_drm2_device_find(Elput_Manager *em, const char *seat)
96{ 96{
97 Eina_List *devs, *l; 97 Eina_List *devs, *l;
98 const char *dev, *ret = NULL, *chosen_dev = NULL; 98 const char *dev, *ret = NULL, *chosen_dev = NULL, *d = NULL;
99 Eina_Bool found = EINA_FALSE; 99 Eina_Bool found = EINA_FALSE;
100 Eina_Bool modeset; 100 Eina_Bool modeset;
101 int fd; 101 int fd;
102 102
103 EINA_SAFETY_ON_NULL_RETURN_VAL(seat, NULL); 103 EINA_SAFETY_ON_NULL_RETURN_VAL(seat, NULL);
104 104
105 devs = eeze_udev_find_by_subsystem_sysname("drm", "card[0-9]*"); 105 d = getenv("ECORE_DRM2_CARD");
106 if (d)
107 devs = eeze_udev_find_by_subsystem_sysname("drm", d);
108 else
109 devs = eeze_udev_find_by_subsystem_sysname("drm", "card[0-9]*");
110
106 if (!devs) return NULL; 111 if (!devs) return NULL;
107 112
108 EINA_LIST_FOREACH(devs, l, dev) 113 EINA_LIST_FOREACH(devs, l, dev)