All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Spotswood <john.a.spotswood@intel.com>
To: "Wajdeczko, Michal" <Michal.Wajdeczko@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 03/21] drm/i915/guc: Simplify preparation of GuC parameter block
Date: Thu, 30 Aug 2018 15:58:27 -0700	[thread overview]
Message-ID: <1535669907.3405.10.camel@intel.com> (raw)
In-Reply-To: <20180829191056.63760-4-michal.wajdeczko@intel.com>

On Wed, 2018-08-29 at 12:10 -0700, Wajdeczko, Michal wrote:
> Definition of the parameters block passed to GuC is about to change.
> Slightly refactor code now to make upcoming patch smaller.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: John Spotswood <john.a.spotswood@intel.com>

Reviewed-by: John Spotswood <john.a.spotswood@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_guc.c | 38 +++++++++++++++++++++++-------
> --------
>  1 file changed, 23 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_guc.c
> b/drivers/gpu/drm/i915/intel_guc.c
> index 230aea6..982bcc8 100644
> --- a/drivers/gpu/drm/i915/intel_guc.c
> +++ b/drivers/gpu/drm/i915/intel_guc.c
> @@ -320,19 +320,8 @@ static u32 guc_ctl_log_params_flags(struct
> intel_guc *guc)
>  	return flags;
>  }
>  
> -/*
> - * Initialise the GuC parameter block before starting the firmware
> - * transfer. These parameters are read by the firmware on startup
> - * and cannot be changed thereafter.
> - */
> -void intel_guc_init_params(struct intel_guc *guc)
> +static void guc_prepare_params(struct intel_guc *guc, u32 *params)
>  {
> -	struct drm_i915_private *dev_priv = guc_to_i915(guc);
> -	u32 params[GUC_CTL_MAX_DWORDS];
> -	int i;
> -
> -	memset(params, 0, sizeof(params));
> -
>  	/*
>  	 * GuC ARAT increment is 10 ns. GuC default scheduler
> quantum is one
>  	 * second. This ARAR is calculated by:
> @@ -347,9 +336,12 @@ void intel_guc_init_params(struct intel_guc
> *guc)
>  	params[GUC_CTL_LOG_PARAMS]  = guc_ctl_log_params_flags(guc);
>  	params[GUC_CTL_DEBUG] = guc_ctl_debug_flags(guc);
>  	params[GUC_CTL_CTXINFO] = guc_ctl_ctxinfo_flags(guc);
> +}
>  
> -	for (i = 0; i < GUC_CTL_MAX_DWORDS; i++)
> -		DRM_DEBUG_DRIVER("param[%2d] = %#x\n", i,
> params[i]);
> +static void guc_write_params(struct intel_guc *guc, const u32
> *params)
> +{
> +	struct drm_i915_private *dev_priv = guc_to_i915(guc);
> +	int i;
>  
>  	/*
>  	 * All SOFT_SCRATCH registers are in FORCEWAKE_BLITTER
> domain and
> @@ -360,12 +352,28 @@ void intel_guc_init_params(struct intel_guc
> *guc)
>  
>  	I915_WRITE(SOFT_SCRATCH(0), 0);
>  
> -	for (i = 0; i < GUC_CTL_MAX_DWORDS; i++)
> +	for (i = 0; i < GUC_CTL_MAX_DWORDS; i++) {
> +		DRM_DEBUG_DRIVER("param[%2d] = %#x\n", i,
> params[i]);
>  		I915_WRITE(SOFT_SCRATCH(1 + i), params[i]);
> +	}
>  
>  	intel_uncore_forcewake_put(dev_priv, FORCEWAKE_BLITTER);
>  }
>  
> +/*
> + * Initialise the GuC parameter block before starting the firmware
> + * transfer. These parameters are read by the firmware on startup
> + * and cannot be changed thereafter.
> + */
> +void intel_guc_init_params(struct intel_guc *guc)
> +{
> +	u32 params[GUC_CTL_MAX_DWORDS];
> +
> +	memset(params, 0, sizeof(params));
> +	guc_prepare_params(guc, params);
> +	guc_write_params(guc, params);
> +}
> +
>  int intel_guc_send_nop(struct intel_guc *guc, const u32 *action, u32
> len,
>  		       u32 *response_buf, u32 response_buf_size)
>  {
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-08-30 22:58 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-29 19:10 [PATCH 00/21] New GuC ABI Michal Wajdeczko
2018-08-29 19:10 ` [PATCH 01/21] drm/i915/guc: Update GuC power domain states Michal Wajdeczko
2018-08-29 20:57   ` Daniele Ceraolo Spurio
2018-08-29 22:43     ` Michal Wajdeczko
2018-08-29 19:10 ` [PATCH 02/21] drm/i915/guc: Don't allow GuC submission on pre-Gen11 Michal Wajdeczko
2018-08-29 19:16   ` Srivatsa, Anusha
2018-08-30 22:58   ` John Spotswood
2018-09-06  8:28   ` Joonas Lahtinen
2018-09-06  8:29   ` Joonas Lahtinen
2018-08-29 19:10 ` [PATCH 03/21] drm/i915/guc: Simplify preparation of GuC parameter block Michal Wajdeczko
2018-08-30 22:58   ` John Spotswood [this message]
2018-09-06  8:32   ` Joonas Lahtinen
2018-08-29 19:10 ` [PATCH 04/21] drm/i915/guc: Support dual Gen9/Gen11 parameters block Michal Wajdeczko
2018-08-30 22:58   ` John Spotswood
2018-09-06  8:39   ` Joonas Lahtinen
2018-08-29 19:10 ` [PATCH 05/21] drm/i915/guc: Update sample-forcewake command Michal Wajdeczko
2018-08-29 21:52   ` Daniele Ceraolo Spurio
2018-08-29 22:31     ` Michal Wajdeczko
2018-08-29 19:10 ` [PATCH 06/21] drm/i915/guc: Use guc_class instead of engine_class in fw interface Michal Wajdeczko
2018-08-29 19:58   ` Michel Thierry
2018-08-30  0:16     ` Lionel Landwerlin
2018-08-30 13:29       ` Lis, Tomasz
2018-08-30 14:16         ` Lis, Tomasz
2018-08-30 14:56         ` Lionel Landwerlin
2018-08-30 22:34       ` Daniele Ceraolo Spurio
2018-09-06  8:55   ` Joonas Lahtinen
2018-08-29 19:15 ` [PATCH 07/21] drm/i915/guc: New GuC ADS object definition Michal Wajdeczko
2018-08-29 19:16 ` [PATCH 08/21] drm/i915/guc: Make use of the SW counter field in the context descriptor Michal Wajdeczko
2018-08-30  0:08   ` Lionel Landwerlin
2018-08-30 14:15     ` Lis, Tomasz
2018-08-31 15:31       ` Lis, Tomasz
2018-08-29 19:17 ` [PATCH 09/21] drm/i915/guc: New GuC IDs based on engine class and instance Michal Wajdeczko
2018-08-29 19:18 ` [PATCH 10/21] drm/i915: Add hooks for (per-engine) context allocation/update/free Michal Wajdeczko
2018-08-29 19:18   ` [PATCH 11/21] drm/i915/guc: New GuC stage descriptors Michal Wajdeczko
2018-08-29 23:14     ` Daniele Ceraolo Spurio
2018-10-12 18:25     ` [RFC] " Daniele Ceraolo Spurio
2018-10-17 18:42       ` Lis, Tomasz
2018-10-18 21:07         ` Daniele Ceraolo Spurio
2018-08-29 19:18   ` [PATCH 12/21] drm/i915/guc: New GuC workqueue item submission mechanism Michal Wajdeczko
2018-08-29 19:18   ` [PATCH 13/21] drm/i915/guc: Add support for resume-parsing wq item Michal Wajdeczko
2018-08-29 19:18   ` [PATCH 14/21] drm/i915/guc: New reset-engine command Michal Wajdeczko
2018-08-29 19:18   ` [PATCH 15/21] drm/i915/guc: Support for extended GuC notification messages Michal Wajdeczko
2018-08-29 19:18   ` [PATCH 16/21] drm/i915/guc: New engine-reset-complete message Michal Wajdeczko
2018-08-29 19:18   ` [PATCH 17/21] drm/i915/guc: New GuC interrupt register for Gen11 Michal Wajdeczko
2018-08-29 19:18   ` [PATCH 18/21] drm/i915/guc: New GuC scratch registers " Michal Wajdeczko
2018-08-29 19:18   ` [PATCH 19/21] drm/i915/huc: New HuC status register " Michal Wajdeczko
2018-08-30 22:59     ` John Spotswood
2018-08-29 19:19 ` [PATCH 20/21] drm/i915/guc: Enable command transport buffers " Michal Wajdeczko
2018-08-29 19:19   ` [PATCH 21/21] HAX Don't enable GuC submission on pre-Gen11 even if forced Michal Wajdeczko

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=1535669907.3405.10.camel@intel.com \
    --to=john.a.spotswood@intel.com \
    --cc=Michal.Wajdeczko@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.