intel-xe.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Farah Kassabri <fkassabri@habana.ai>, intel-xe@lists.freedesktop.org
Cc: osharabi@habana.ai, Farah Kassabri <fkassabri@habana.ai>
Subject: Re: [PATCH 2/2] drm/xe: set last driver commit sha
Date: Mon, 29 Apr 2024 14:15:47 +0300	[thread overview]
Message-ID: <878r0w4dy4.fsf@intel.com> (raw)
In-Reply-To: <20240424100706.269523-2-fkassabri@habana.ai>

On Wed, 24 Apr 2024, Farah Kassabri <fkassabri@habana.ai> wrote:
> 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@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)

There are no guarantees that the kernel is being built from a git
checkout. Or if it is, that there are no uncommitted changes. Etc. See
scripts/setlocalversion.

IMO it's just not so simple that we could reasonably add this into a
local Makefile.

BR,
Jani.

> +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)

-- 
Jani Nikula, Intel

  reply	other threads:[~2024-04-29 11:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-24 10:07 [PATCH 1/2] drm: print top commit sha after loading the driver Farah Kassabri
2024-04-24 10:07 ` [PATCH 2/2] drm/xe: set last driver commit sha Farah Kassabri
2024-04-29 11:15   ` Jani Nikula [this message]
2024-05-08 12:09     ` Farah Kassabri
2024-04-28 21:48 ` ✓ CI.Patch_applied: success for series starting with [1/2] drm: print top commit sha after loading the driver Patchwork
2024-04-28 21:48 ` ✓ CI.checkpatch: " Patchwork
2024-04-28 21:49 ` ✓ CI.KUnit: " Patchwork
2024-04-29 11:02 ` [PATCH 1/2] " Jani Nikula
2024-04-29 15:32   ` Lucas De Marchi
2024-05-08 11:01     ` Farah Kassabri
2024-05-08 11:34       ` Jani Nikula
2024-05-16 14:17         ` Farah Kassabri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878r0w4dy4.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=fkassabri@habana.ai \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=osharabi@habana.ai \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).