diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-06 13:34:18 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-06 13:39:32 +0100 |
commit | 694ff54aca16ccf39e94d505942eb857b3101d7d (patch) | |
tree | 90c06734d9b082c81d818dcc8b266e62b6b3179b | |
parent | 0ebcef4f2ebe82e9b90589aa4266a9228e2b5fdb (diff) |
sna: Report KMS driver version
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/intel_device.c | 10 | ||||
-rw-r--r-- | src/intel_driver.h | 1 | ||||
-rw-r--r-- | src/sna/sna_driver.c | 33 |
3 files changed, 42 insertions, 2 deletions
diff --git a/src/intel_device.c b/src/intel_device.c index c1c6d846..610b2235 100644 --- a/src/intel_device.c +++ b/src/intel_device.c @@ -376,6 +376,16 @@ err_path: return -1; } +int __intel_peek_fd(ScrnInfoPtr scrn) +{ + struct intel_device *dev; + + dev = intel_device(scrn); + assert(dev && dev->fd != -1); + + return dev->fd; +} + int intel_get_device(ScrnInfoPtr scrn) { struct intel_device *dev; diff --git a/src/intel_driver.h b/src/intel_driver.h index 3dc640cf..d295250a 100644 --- a/src/intel_driver.h +++ b/src/intel_driver.h @@ -125,6 +125,7 @@ void intel_detect_chipset(ScrnInfoPtr scrn, EntityInfoPtr ent); int intel_open_device(int entity_num, const struct pci_device *pci, struct xf86_platform_device *dev); +int __intel_peek_fd(ScrnInfoPtr scrn); int intel_get_device(ScrnInfoPtr scrn); const char *intel_get_client_name(ScrnInfoPtr scrn); int intel_get_client_fd(ScrnInfoPtr scrn); diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c index b9232360..3810090e 100644 --- a/src/sna/sna_driver.c +++ b/src/sna/sna_driver.c @@ -1276,9 +1276,31 @@ static void sna_leave_vt__hosted(VT_FUNC_ARGS_DECL) { } -Bool sna_init_scrn(ScrnInfoPtr scrn, int entity_num) +static void describe_kms(ScrnInfoPtr scrn) +{ + int fd = __intel_peek_fd(scrn); + drm_version_t version; + char name[128] = ""; + char date[128] = ""; + + memset(&version, 0, sizeof(version)); + version.name_len = sizeof(name) - 1; + version.name = name; + version.date_len = sizeof(date) - 1; + version.date = date; + + if (drmIoctl(fd, DRM_IOCTL_VERSION, &version)) + return; + + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "Using Kernel Mode Setting driver: %s, version %d.%d.%d %s\n", + version.name, + version.version_major, version.version_minor, version.version_patchlevel, + version.date); +} + +static void describe_sna(ScrnInfoPtr scrn) { - DBG(("%s: entity_num=%d\n", __FUNCTION__, entity_num)); #if defined(USE_GIT_DESCRIBE) xf86DrvMsg(scrn->scrnIndex, X_INFO, "SNA compiled from %s\n", git_version); @@ -1303,6 +1325,13 @@ Bool sna_init_scrn(ScrnInfoPtr scrn, int entity_num) "SNA compiled with extra pixmap/damage validation\n"); #endif DBG(("pixman version: %s\n", pixman_version_string())); +} + +Bool sna_init_scrn(ScrnInfoPtr scrn, int entity_num) +{ + DBG(("%s: entity_num=%d\n", __FUNCTION__, entity_num)); + describe_kms(scrn); + describe_sna(scrn); scrn->PreInit = sna_pre_init; scrn->ScreenInit = sna_screen_init; |