summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux-core/Makefile5
-rw-r--r--linux-core/nouveau_drv.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/linux-core/Makefile b/linux-core/Makefile
index 7f6b123e..3af6f370 100644
--- a/linux-core/Makefile
+++ b/linux-core/Makefile
@@ -335,6 +335,11 @@ ifneq (,$(findstring i915,$(DRM_MODULES)))
CONFIG_DRM_I915 := m
endif
+GIT_REVISION := $(shell cd "$(DRMSRCDIR)" && git-describe --abbrev=17)
+ifneq ($(GIT_REVISION),)
+EXTRA_CFLAGS+=-D"GIT_REVISION=\"$(GIT_REVISION)\""
+endif
+
include $(DRMSRCDIR)/Makefile.kernel
# Depencencies
diff --git a/linux-core/nouveau_drv.c b/linux-core/nouveau_drv.c
index e9623eb1..c8f57dff 100644
--- a/linux-core/nouveau_drv.c
+++ b/linux-core/nouveau_drv.c
@@ -86,7 +86,11 @@ static struct drm_driver driver = {
.name = DRIVER_NAME,
.desc = DRIVER_DESC,
+#ifdef GIT_REVISION
+ .date = GIT_REVISION,
+#else
.date = DRIVER_DATE,
+#endif
.major = DRIVER_MAJOR,
.minor = DRIVER_MINOR,
.patchlevel = DRIVER_PATCHLEVEL,