commit 6f5064d
Michael Forney
·
2014-01-13 12:24:15 +0000 UTC
parent e457fe7
drm: Add debug information about drivers tried
3 files changed,
+7,
-0
+1,
-0
1@@ -31,6 +31,7 @@ typedef uint32_t (* drm_get_handle_func_t)(struct wld_drawable * drawable);
2
3 struct drm_driver
4 {
5+ const char * name;
6 bool (* device_supported)(uint32_t vendor_id, uint32_t device_id);
7 struct wld_context * (* create_context)(int drm_fd);
8 };
M
drm.c
+3,
-0
1@@ -61,10 +61,13 @@ static const struct drm_driver * find_driver(int fd)
2
3 for (index = 0; index < ARRAY_LENGTH(drivers); ++index)
4 {
5+ DEBUG("Trying DRM driver `%s'\n", drivers[index]->name);
6 if (drivers[index]->device_supported(vendor_id, device_id))
7 return drivers[index];
8 }
9
10+ DEBUG("No DRM driver supports device 0x%x:0x%x\n", vendor_id, device_id);
11+
12 return NULL;
13 }
14
+3,
-0
1@@ -31,10 +31,13 @@ static struct wld_context * driver_create_context(int drm_fd);
2
3 #define EXPAND(f, x) f(x)
4 #define VAR(name) name ## _drm_driver
5+#define STRING(name) # name
6 const struct drm_driver EXPAND(VAR, DRM_DRIVER_NAME) = {
7+ .name = EXPAND(STRING, DRM_DRIVER_NAME),
8 .device_supported = &driver_device_supported,
9 .create_context = &driver_create_context,
10 };
11 #undef VAR
12+#undef STRING
13 #undef EXPAND
14