[Intel-gfx] [PATCH 6/7] drm/i915/guc: Make GuC log sizes runtime configurable

Teres Alexis, Alan Previn alan.previn.teres.alexis at intel.com
Mon Aug 15 05:43:59 UTC 2022


Looks good to me. 

Reviewed-by: Alan Previn <alan.previn.teres.alexis at intel.com>


On Wed, 2022-07-27 at 19:20 -0700, John.C.Harrison at Intel.com wrote:
> From: John Harrison <John.C.Harrison at Intel.com>
> 
> The GuC log buffer sizes had to be configured statically at compile
> time. This can be quite troublesome when needing to get larger logs
> out of a released driver. So re-organise the code to allow a boot time
> module parameter override.
> 
> Signed-off-by: John Harrison <John.C.Harrison at Intel.com>
> ---
>  drivers/gpu/drm/i915/gt/uc/intel_guc.c        |  53 ++----
>  .../gpu/drm/i915/gt/uc/intel_guc_capture.c    |  14 +-
>  drivers/gpu/drm/i915/gt/uc/intel_guc_log.c    | 176 +++++++++++++++++-
>  drivers/gpu/drm/i915/gt/uc/intel_guc_log.h    |  42 +++--
>  drivers/gpu/drm/i915/i915_params.c            |  12 ++
>  drivers/gpu/drm/i915/i915_params.h            |   3 +
>  6 files changed, 226 insertions(+), 74 deletions(-)
> 
...
> +static s32 scale_log_param(struct intel_guc_log *log, const struct guc_log_section *section,
> +			   s32 param)
> +{
> +	/* -1 means default */
> +	if (param < 0)
> +		return section->default_val;
> +
> +	/* Check for 32-bit overflow */
> +	if (param >= SZ_4K) {
> +		drm_err(&guc_to_gt(log_to_guc(log))->i915->drm, "Size too large for GuC %s log: %dMB!",
> +			section->name, param);
> +		return section->default_val;
> +	}
> +
> +	/* Param units are 1MB */
> +	return param * SZ_1M;
> +}
> +





More information about the dri-devel mailing list