[Intel-xe] [PATCH v3 17/20] drm/xe/guc: Split GuC params used for "hwconfig" and "post-hwconfig"

Michał Winiarski michal.winiarski at intel.com
Tue Nov 21 13:36:50 UTC 2023


On Mon, Nov 20, 2023 at 02:09:26PM -0600, Lucas De Marchi wrote:
> On Tue, Nov 14, 2023 at 02:02:28PM +0100, Michał Winiarski wrote:
> > Move params that are not used for initial "hwconfig" load to
> > "post-hwconfig" phase.
> > 
> > Signed-off-by: Michał Winiarski <michal.winiarski at intel.com>
> 
> 
> Reviewed-by: Lucas De Marchi <lucas.demarchi at intel.com>
> 
> ... but I thought we'd remove the double guc load. Did we change
> direction?

Unfortunately, some things are still missing.
Let's take GuC log, if we would want to load GuC early during probe
(where LMEM is not initialized yet), GuC log needs to be allocated in
system memory. Unfortunately - there's no interface to register a new
GuC log buffer, which makes it problematic if we want to transition to
LMEM GuC log.

Perhaps the transition to single load will make sense in the future, but
I'd like to see SR-IOV VF code merged before any further refactoring.

-Michał

> 
> Lucas De Marchi
> 
> > ---
> > drivers/gpu/drm/xe/xe_guc.c | 22 ++++++++++++++++++++++
> > 1 file changed, 22 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c
> > index 84f0b5488783b..d1181ddf4bdae 100644
> > --- a/drivers/gpu/drm/xe/xe_guc.c
> > +++ b/drivers/gpu/drm/xe/xe_guc.c
> > @@ -192,6 +192,26 @@ static void guc_init_params(struct xe_guc *guc)
> > 	BUILD_BUG_ON(sizeof(guc->params) != GUC_CTL_MAX_DWORDS * sizeof(u32));
> > 	BUILD_BUG_ON(GUC_CTL_MAX_DWORDS + 2 != SOFT_SCRATCH_COUNT);
> > 
> > +	params[GUC_CTL_LOG_PARAMS] = guc_ctl_log_params_flags(guc);
> > +	params[GUC_CTL_FEATURE] = 0;
> > +	params[GUC_CTL_DEBUG] = guc_ctl_debug_flags(guc);
> > +	params[GUC_CTL_ADS] = guc_ctl_ads_flags(guc);
> > +	params[GUC_CTL_WA] = 0;
> > +	params[GUC_CTL_DEVID] = guc_ctl_devid(guc);
> > +
> > +	for (i = 0; i < GUC_CTL_MAX_DWORDS; i++)
> > +		drm_dbg(&xe->drm, "GuC param[%2d] = 0x%08x\n", i, params[i]);
> > +}
> > +
> > +static void guc_init_params_post_hwconfig(struct xe_guc *guc)
> > +{
> > +	struct xe_device *xe = guc_to_xe(guc);
> > +	u32 *params = guc->params;
> > +	int i;
> > +
> > +	BUILD_BUG_ON(sizeof(guc->params) != GUC_CTL_MAX_DWORDS * sizeof(u32));
> > +	BUILD_BUG_ON(GUC_CTL_MAX_DWORDS + 2 != SOFT_SCRATCH_COUNT);
> > +
> > 	params[GUC_CTL_LOG_PARAMS] = guc_ctl_log_params_flags(guc);
> > 	params[GUC_CTL_FEATURE] = guc_ctl_feature_flags(guc);
> > 	params[GUC_CTL_DEBUG] = guc_ctl_debug_flags(guc);
> > @@ -289,6 +309,8 @@ int xe_guc_init(struct xe_guc *guc)
> >  */
> > int xe_guc_init_post_hwconfig(struct xe_guc *guc)
> > {
> > +	guc_init_params_post_hwconfig(guc);
> > +
> > 	return xe_guc_ads_init_post_hwconfig(&guc->ads);
> > }
> > 
> > -- 
> > 2.42.1
> > 


More information about the Intel-xe mailing list