Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: "Michał Winiarski" <michal.winiarski@intel.com>
Cc: intel-xe@lists.freedesktop.org,
	"Lucas De Marchi" <lucas.demarchi@intel.com>,
	"Matt Roper" <matthew.d.roper@intel.com>,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	"Brian Welty" <brian.welty@intel.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Michal Wajdeczko" <michal.wajdeczko@intel.com>
Subject: Re: [PATCH 2/4] drm/xe/huc: Realloc HuC FW in vram for post-hwconfig
Date: Thu, 1 Feb 2024 17:41:12 +0000	[thread overview]
Message-ID: <ZbvXuNZjK/qD08RI@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <20240129130308.3544466-3-michal.winiarski@intel.com>

On Mon, Jan 29, 2024 at 02:03:06PM +0100, Michał Winiarski wrote:
> Similar to GuC, we're using system memory for the initial stage, and
> move the image to vram when it's available for subsequent loads (e.g.
> after reset).
> 

This patch LGTM but same question as in [1] - should we release the
system memory for the HuC once the VRAM is allocated?

Matt

[1] https://patchwork.freedesktop.org/patch/576287/?series=129268&rev=1 

> Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_huc.c | 19 +++++++++++++++++++
>  drivers/gpu/drm/xe/xe_huc.h |  1 +
>  drivers/gpu/drm/xe/xe_uc.c  |  4 ++++
>  3 files changed, 24 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_huc.c b/drivers/gpu/drm/xe/xe_huc.c
> index eca109791c6ae..b545f850087cd 100644
> --- a/drivers/gpu/drm/xe/xe_huc.c
> +++ b/drivers/gpu/drm/xe/xe_huc.c
> @@ -112,6 +112,25 @@ int xe_huc_init(struct xe_huc *huc)
>  	return ret;
>  }
>  
> +int xe_huc_init_post_hwconfig(struct xe_huc *huc)
> +{
> +	struct xe_tile *tile = gt_to_tile(huc_to_gt(huc));
> +	struct xe_device *xe = huc_to_xe(huc);
> +	int ret;
> +
> +	if (!IS_DGFX(huc_to_xe(huc)))
> +		return 0;
> +
> +	if (!xe_uc_fw_is_loadable(&huc->fw))
> +		return 0;
> +
> +	ret = xe_managed_bo_reinit_in_vram(xe, tile, &huc->fw.bo);
> +	if (ret)
> +		return ret;
> +
> +	return 0;
> +}
> +
>  int xe_huc_upload(struct xe_huc *huc)
>  {
>  	if (!xe_uc_fw_is_loadable(&huc->fw))
> diff --git a/drivers/gpu/drm/xe/xe_huc.h b/drivers/gpu/drm/xe/xe_huc.h
> index 532017230287f..3ab56cc14b00a 100644
> --- a/drivers/gpu/drm/xe/xe_huc.h
> +++ b/drivers/gpu/drm/xe/xe_huc.h
> @@ -17,6 +17,7 @@ enum xe_huc_auth_types {
>  };
>  
>  int xe_huc_init(struct xe_huc *huc);
> +int xe_huc_init_post_hwconfig(struct xe_huc *huc);
>  int xe_huc_upload(struct xe_huc *huc);
>  int xe_huc_auth(struct xe_huc *huc, enum xe_huc_auth_types type);
>  bool xe_huc_is_authenticated(struct xe_huc *huc, enum xe_huc_auth_types type);
> diff --git a/drivers/gpu/drm/xe/xe_uc.c b/drivers/gpu/drm/xe/xe_uc.c
> index 8f37a809525fb..d62137306d280 100644
> --- a/drivers/gpu/drm/xe/xe_uc.c
> +++ b/drivers/gpu/drm/xe/xe_uc.c
> @@ -94,6 +94,10 @@ int xe_uc_init_post_hwconfig(struct xe_uc *uc)
>  	if (err)
>  		return err;
>  
> +	err = xe_huc_init_post_hwconfig(&uc->huc);
> +	if (err)
> +		return err;
> +
>  	return xe_gsc_init_post_hwconfig(&uc->gsc);
>  }
>  
> -- 
> 2.43.0
> 

  reply	other threads:[~2024-02-01 17:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-29 13:03 [PATCH 0/4] drm/xe: Remaining probe reordering Michał Winiarski
2024-01-29 13:03 ` [PATCH 1/4] drm/xe/guc: Allocate GuC data structures in system memory for initial load Michał Winiarski
2024-02-01 17:36   ` Matthew Brost
2024-02-01 20:25     ` Michał Winiarski
2024-02-01 21:57       ` Rodrigo Vivi
2024-02-02  0:37         ` Matthew Brost
2024-01-29 13:03 ` [PATCH 2/4] drm/xe/huc: Realloc HuC FW in vram for post-hwconfig Michał Winiarski
2024-02-01 17:41   ` Matthew Brost [this message]
2024-02-01 21:58     ` Rodrigo Vivi
2024-01-29 13:03 ` [PATCH 3/4] drm/xe/guc: Move GuC power control init to "post-hwconfig" Michał Winiarski
2024-01-29 13:03 ` [PATCH 4/4] drm/xe: Initialize GuC earlier during probe Michał Winiarski
2024-01-29 13:06 ` ✓ CI.Patch_applied: success for drm/xe: Remaining probe reordering Patchwork
2024-01-29 13:06 ` ✓ CI.checkpatch: " Patchwork
2024-01-29 13:07 ` ✓ CI.KUnit: " Patchwork
2024-01-29 13:14 ` ✓ CI.Build: " Patchwork
2024-01-29 13:15 ` ✗ CI.Hooks: failure " Patchwork
2024-01-29 13:16 ` ✓ CI.checksparse: success " Patchwork

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=ZbvXuNZjK/qD08RI@DUT025-TGLU.fm.intel.com \
    --to=matthew.brost@intel.com \
    --cc=brian.welty@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=matthew.d.roper@intel.com \
    --cc=michal.wajdeczko@intel.com \
    --cc=michal.winiarski@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=ville.syrjala@linux.intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox