commit 6f5064d5ac64ef5b80f2c4d8711472155795c7cb
parent e457fe78b0f5b707ea3ad73d8635cd933e8099f1
Author: Michael Forney <mforney@mforney.org>
Date: Mon, 13 Jan 2014 04:24:15 -0800
drm: Add debug information about drivers tried
Diffstat:
3 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drm-private.h b/drm-private.h
@@ -31,6 +31,7 @@ typedef uint32_t (* drm_get_handle_func_t)(struct wld_drawable * drawable);
struct drm_driver
{
+ const char * name;
bool (* device_supported)(uint32_t vendor_id, uint32_t device_id);
struct wld_context * (* create_context)(int drm_fd);
};
diff --git a/drm.c b/drm.c
@@ -61,10 +61,13 @@ static const struct drm_driver * find_driver(int fd)
for (index = 0; index < ARRAY_LENGTH(drivers); ++index)
{
+ DEBUG("Trying DRM driver `%s'\n", drivers[index]->name);
if (drivers[index]->device_supported(vendor_id, device_id))
return drivers[index];
}
+ DEBUG("No DRM driver supports device 0x%x:0x%x\n", vendor_id, device_id);
+
return NULL;
}
diff --git a/interface/drm.h b/interface/drm.h
@@ -31,10 +31,13 @@ static struct wld_context * driver_create_context(int drm_fd);
#define EXPAND(f, x) f(x)
#define VAR(name) name ## _drm_driver
+#define STRING(name) # name
const struct drm_driver EXPAND(VAR, DRM_DRIVER_NAME) = {
+ .name = EXPAND(STRING, DRM_DRIVER_NAME),
.device_supported = &driver_device_supported,
.create_context = &driver_create_context,
};
#undef VAR
+#undef STRING
#undef EXPAND