[PATCH 1/2] drm: print top commit sha after loading the driver

Jani Nikula jani.nikula at linux.intel.com
Mon Apr 29 11:02:28 UTC 2024


On Wed, 24 Apr 2024, Farah Kassabri <fkassabri at habana.ai> wrote:
> Add the last driver sha to the existing log message
> which prints the drm device info.

The commit message fails to answer the most important question: why?

Especially, what makes drm devices such special snowflakes that they'd
need to be the only ones in the kernel to print git commit sha1's?

BR,
Jani.

>
> Signed-off-by: Farah Kassabri <fkassabri at habana.ai>
> ---
>  drivers/gpu/drm/drm_drv.c | 6 +++---
>  include/drm/drm_drv.h     | 2 ++
>  2 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> index 535b624d4c9d..e0f7af1b6ec3 100644
> --- a/drivers/gpu/drm/drm_drv.c
> +++ b/drivers/gpu/drm/drm_drv.c
> @@ -947,10 +947,10 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags)
>  	}
>  	drm_panic_register(dev);
>  
> -	DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
> +	DRM_INFO("Initialized %s %d.%d.%d%s %s for %s on minor %d\n",
>  		 driver->name, driver->major, driver->minor,
> -		 driver->patchlevel, driver->date,
> -		 dev->dev ? dev_name(dev->dev) : "virtual device",
> +		 driver->patchlevel, driver->git_sha ? driver->git_sha : "",
> +		 driver->date, dev->dev ? dev_name(dev->dev) : "virtual device",
>  		 dev->primary ? dev->primary->index : dev->accel->index);
>  
>  	goto out_unlock;
> diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
> index 8878260d7529..7578a1f4ce74 100644
> --- a/include/drm/drm_drv.h
> +++ b/include/drm/drm_drv.h
> @@ -407,6 +407,8 @@ struct drm_driver {
>  	int minor;
>  	/** @patchlevel: driver patch level */
>  	int patchlevel;
> +	/** @git_sha: driver last commit sha */
> +	char *git_sha;
>  	/** @name: driver name */
>  	char *name;
>  	/** @desc: driver description */

-- 
Jani Nikula, Intel


More information about the Intel-xe mailing list