[Intel-gfx] [PATCH v2 7/7] drm/i915: Dump device info at once
Chris Wilson
chris at chris-wilson.co.uk
Thu Dec 21 21:36:29 UTC 2017
Quoting Michal Wajdeczko (2017-12-21 18:53:34)
> We are dumping device info separately for sw_only and runtime part
> but to simplify the code we can also do it from one place once
> we complete driver load.
>
> v2: use dedicated welcome function (Chris)
>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.c | 33 +++++++++++++++++----------------
> 1 file changed, 17 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 5bf4f58..6c8da9d 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -931,12 +931,6 @@ static int i915_driver_init_early(struct drm_i915_private *dev_priv,
>
> intel_display_crc_init(dev_priv);
>
> - if (drm_debug & DRM_UT_DRIVER) {
> - struct drm_printer p = drm_debug_printer("i915 device info:");
> -
> - intel_device_info_dump(&dev_priv->info, &p);
> - }
> -
> intel_detect_preproduction_hw(dev_priv);
>
> return 0;
> @@ -1089,11 +1083,6 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)
> return -ENODEV;
>
> intel_device_info_runtime_init(mkwrite_device_info(dev_priv));
> - if (drm_debug & DRM_UT_DRIVER) {
> - struct drm_printer p = drm_debug_printer("i915 device info:");
> -
> - intel_device_info_dump_runtime(&dev_priv->info, &p);
> - }
>
> intel_sanitize_options(dev_priv);
>
> @@ -1303,6 +1292,21 @@ static void i915_driver_unregister(struct drm_i915_private *dev_priv)
> i915_gem_shrinker_unregister(dev_priv);
> }
>
> +static void i915_welcome_messages(struct drm_i915_private *dev_priv)
> +{
> + if (drm_debug & DRM_UT_DRIVER) {
> + struct drm_printer p = drm_debug_printer("i915 device info:");
> +
> + intel_device_info_dump(&dev_priv->info, &p);
> + intel_device_info_dump_runtime(&dev_priv->info, &p);
I'd throw the flags into here as well (and to debugfs), then all parties
are doing the same and we can reduce this to a single
intel_device_info_dump() routine.
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris
More information about the Intel-gfx
mailing list