[PATCH 2/2] drm/xe: set last driver commit sha

Farah Kassabri fkassabri at habana.ai
Wed Apr 24 10:07:06 UTC 2024


This patch will set the last driver commit sha into the drm driver
info data structure, which will be used in the log message which
prints the device info at the end of the driver initialization.

Signed-off-by: Farah Kassabri <fkassabri at habana.ai>
---
 drivers/gpu/drm/xe/Makefile    | 4 ++++
 drivers/gpu/drm/xe/xe_device.c | 1 +
 2 files changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile
index 8321ec4f9b46..acccb517b7bb 100644
--- a/drivers/gpu/drm/xe/Makefile
+++ b/drivers/gpu/drm/xe/Makefile
@@ -309,6 +309,10 @@ ifeq ($(CONFIG_DEBUG_FS),y)
 		i915-display/intel_pipe_crc.o
 endif
 
+GIT_SHA ?= $(shell cd $(srctree) && git rev-parse --short HEAD)
+DRV_CFLAGS_MODULE="-DXE_DRIVER_GIT_SHA=-$(GIT_SHA)"
+CFLAGS_MODULE += ${DRV_CFLAGS_MODULE}
+
 obj-$(CONFIG_DRM_XE) += xe.o
 obj-$(CONFIG_DRM_XE_KUNIT_TEST) += tests/
 
diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index 55bbc8b8df15..2e74aa18e953 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -215,6 +215,7 @@ static struct drm_driver driver = {
 	.major = DRIVER_MAJOR,
 	.minor = DRIVER_MINOR,
 	.patchlevel = DRIVER_PATCHLEVEL,
+	.git_sha = __stringify(XE_DRIVER_GIT_SHA),
 };
 
 static void xe_device_destroy(struct drm_device *dev, void *dummy)
-- 
2.34.1



More information about the Intel-xe mailing list