All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Alan Previn <alan.previn.teres.alexis@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [Intel-gfx 3/6] drm/i915/guc: Add a helper for log buffer size
Date: Tue, 19 Jul 2022 19:49:47 -0700	[thread overview]
Message-ID: <87mtd4bir8.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20220509210151.1843173-4-alan.previn.teres.alexis@intel.com>

On Mon, 09 May 2022 14:01:48 -0700, Alan Previn wrote:
>
> Add a helper to get GuC log buffer size.
>
> Signed-off-by: Alan Previn <alan.previn.teres.alexis@intel.com>
> ---
>  drivers/gpu/drm/i915/gt/uc/intel_guc_log.c | 49 ++++++++++++----------
>  1 file changed, 27 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> index d902b40ded0e..f454d53a8bca 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> @@ -15,6 +15,32 @@
>
>  static void guc_log_copy_debuglogs_for_relay(struct intel_guc_log *log);
>
> +static u32 intel_guc_log_size(struct intel_guc_log *log)
> +{
> +	/*
> +	 *  GuC Log buffer Layout:
> +	 *
> +	 *  NB: Ordering must follow "enum guc_log_buffer_type".
> +	 *
> +	 *  +===============================+ 00B
> +	 *  |      Debug state header       |
> +	 *  +-------------------------------+ 32B
> +	 *  |    Crash dump state header    |
> +	 *  +-------------------------------+ 64B
> +	 *  |     Capture state header      |
> +	 *  +-------------------------------+ 96B
> +	 *  |                               |
> +	 *  +===============================+ PAGE_SIZE (4KB)
> +	 *  |          Debug logs           |
> +	 *  +===============================+ + DEBUG_SIZE
> +	 *  |        Crash Dump logs        |
> +	 *  +===============================+ + CRASH_SIZE
> +	 *  |         Capture logs          |
> +	 *  +===============================+ + CAPTURE_SIZE
> +	 */
> +	return PAGE_SIZE + CRASH_BUFFER_SIZE + DEBUG_BUFFER_SIZE + CAPTURE_BUFFER_SIZE;
> +}
> +
>  /**
>   * DOC: GuC firmware log
>   *
> @@ -464,32 +490,11 @@ int intel_guc_log_create(struct intel_guc_log *log)
>
>	GEM_BUG_ON(log->vma);
>
> -	/*
> -	 *  GuC Log buffer Layout
> -	 * (this ordering must follow "enum guc_log_buffer_type" definition)
> -	 *
> -	 *  +===============================+ 00B
> -	 *  |      Debug state header       |
> -	 *  +-------------------------------+ 32B
> -	 *  |    Crash dump state header    |
> -	 *  +-------------------------------+ 64B
> -	 *  |     Capture state header      |
> -	 *  +-------------------------------+ 96B
> -	 *  |                               |
> -	 *  +===============================+ PAGE_SIZE (4KB)
> -	 *  |          Debug logs           |
> -	 *  +===============================+ + DEBUG_SIZE
> -	 *  |        Crash Dump logs        |
> -	 *  +===============================+ + CRASH_SIZE
> -	 *  |         Capture logs          |
> -	 *  +===============================+ + CAPTURE_SIZE
> -	 */
>	if (intel_guc_capture_output_min_size_est(guc) > CAPTURE_BUFFER_SIZE)
>		DRM_WARN("GuC log buffer for state_capture maybe too small. %d < %d\n",
>			 CAPTURE_BUFFER_SIZE, intel_guc_capture_output_min_size_est(guc));
>
> -	guc_log_size = PAGE_SIZE + CRASH_BUFFER_SIZE + DEBUG_BUFFER_SIZE +
> -		       CAPTURE_BUFFER_SIZE;
> +	guc_log_size = intel_guc_log_size(log);
>
>	vma = intel_guc_allocate_vma(guc, guc_log_size);
>	if (IS_ERR(vma)) {

My nit-pick suggestions are:

* Call the static function guc_log_size() (don't append intel_ prefix for
  static/internal functions)
* Eliminate the guc_log_size variable and just do
* vma = intel_guc_allocate_vma(guc, guc_log_size());

Otherwise this is:

Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>

  reply	other threads:[~2022-07-20  2:49 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-09 21:01 [Intel-gfx] [Intel-gfx 0/6] Update GuC relay logging debugfs Alan Previn
2022-05-09 21:01 ` [Intel-gfx] [Intel-gfx 1/6] drm/i915/guc: Fix GuC relay log debugfs failing open Alan Previn
2022-07-19  3:58   ` Dixit, Ashutosh
2022-12-06  8:32   ` Tvrtko Ursulin
2022-12-06  8:35     ` Tvrtko Ursulin
2022-05-09 21:01 ` [Intel-gfx] [Intel-gfx 2/6] drm/i915/guc: Add unaligned wc memcpy for copying GuC Log Alan Previn
2022-07-19 17:54   ` Dixit, Ashutosh
2022-05-09 21:01 ` [Intel-gfx] [Intel-gfx 3/6] drm/i915/guc: Add a helper for log buffer size Alan Previn
2022-07-20  2:49   ` Dixit, Ashutosh [this message]
2022-12-06  1:56     ` Teres Alexis, Alan Previn
2022-05-09 21:01 ` [Intel-gfx] [Intel-gfx 4/6] drm/i915/guc: Provide debugfs for log relay sub-buf info Alan Previn
2022-07-20  3:40   ` Dixit, Ashutosh
2022-12-06  1:55     ` Teres Alexis, Alan Previn
2022-12-07  6:00       ` Dixit, Ashutosh
2022-05-09 21:01 ` [Intel-gfx] [Intel-gfx 5/6] drm/i915/guc: Rename GuC log relay debugfs descriptively Alan Previn
2022-07-20  5:39   ` Dixit, Ashutosh
2022-12-06  1:58     ` Teres Alexis, Alan Previn
2022-05-09 21:01 ` [Intel-gfx] [Intel-gfx 6/6] drm/i915/guc: Move guc_log_relay_chan debugfs path to uc Alan Previn
2022-07-20 19:08   ` Dixit, Ashutosh
2022-12-06  2:01     ` Teres Alexis, Alan Previn
2022-12-06  6:08       ` Teres Alexis, Alan Previn
2022-05-09 21:25 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for Update GuC relay logging debugfs Patchwork
2022-05-09 21:41 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-05-10 10:00 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-05-11 21:45   ` Teres Alexis, Alan Previn

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=87mtd4bir8.wl-ashutosh.dixit@intel.com \
    --to=ashutosh.dixit@intel.com \
    --cc=alan.previn.teres.alexis@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.