Re: [PATCH] drm/i915: Use graphics ver, rel info for media on old platforms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 11, 2022 at 01:10:26PM +0300, Jani Nikula wrote:
> On Tue, 11 Oct 2022, "Sripada, Radhakrishna" <radhakrishna.sripada@xxxxxxxxx> wrote:
> > Hi Jani,
> >
> >> -----Original Message-----
> >> From: Jani Nikula <jani.nikula@xxxxxxxxxxxxxxx>
> >> Sent: Tuesday, October 11, 2022 12:28 AM
> >> To: Sripada, Radhakrishna <radhakrishna.sripada@xxxxxxxxx>; intel-
> >> gfx@xxxxxxxxxxxxxxxxxxxxx
> >> Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx; Sripada, Radhakrishna
> >> <radhakrishna.sripada@xxxxxxxxx>; De Marchi, Lucas
> >> <lucas.demarchi@xxxxxxxxx>; Roper, Matthew D
> >> <matthew.d.roper@xxxxxxxxx>
> >> Subject: Re: [PATCH] drm/i915: Use graphics ver, rel info for media on old
> >> platforms
> >> 
> >> On Mon, 10 Oct 2022, Radhakrishna Sripada <radhakrishna.sripada@xxxxxxxxx>
> >> wrote:
> >> > Platforms prior to MTL do not have a separate media and graphics version.
> >> > On platforms where GMD id is not supported, reuse the graphics ip version,
> >> > release info for media.
> >> >
> >> > The rest of the IP graphics, display versions would be copied during driver
> >> > creation.
> >> >
> >> > While at it warn if GMD is not used for platforms greater than gen12.
> >> >
> >> > Fixes: c2c7075225ef ("drm/i915: Read graphics/media/display arch version
> >> from hw")
> >> > Cc: Jani Nikula <jani.nikula@xxxxxxxxxxxxxxx>
> >> > Cc: Lucas De Marchi <lucas.demarchi@xxxxxxxxx>
> >> > Cc: Matt Roper <matthew.d.roper@xxxxxxxxx>
> >> > Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada@xxxxxxxxx>
> >> > ---
> >> >  drivers/gpu/drm/i915/intel_device_info.c | 12 +++++++++++-
> >> >  1 file changed, 11 insertions(+), 1 deletion(-)
> >> >
> >> > diff --git a/drivers/gpu/drm/i915/intel_device_info.c
> >> b/drivers/gpu/drm/i915/intel_device_info.c
> >> > index 090097bb3c0a..ba178b61bceb 100644
> >> > --- a/drivers/gpu/drm/i915/intel_device_info.c
> >> > +++ b/drivers/gpu/drm/i915/intel_device_info.c
> >> > @@ -329,8 +329,18 @@ static void intel_ipver_early_init(struct
> >> drm_i915_private *i915)
> >> >  {
> >> >  	struct intel_runtime_info *runtime = RUNTIME_INFO(i915);
> >> >
> >> > -	if (!HAS_GMD_ID(i915))
> >> > +	if (!HAS_GMD_ID(i915)) {
> >> > +		drm_WARN_ON(&i915->drm, RUNTIME_INFO(i915)-
> >> >graphics.ip.ver > 12);
> >> > +		/*
> >> > +		 * On older platforms, graphics and media share the same ip
> >> > +		 * version and release.
> >> > +		 */
> >> > +		RUNTIME_INFO(i915)->media.ip.ver =
> >> > +			RUNTIME_INFO(i915)->graphics.ip.ver;
> >> > +		RUNTIME_INFO(i915)->media.ip.rel =
> >> > +			RUNTIME_INFO(i915)->graphics.ip.rel;
> >> 
> >> You could assign the whole struct ip_version (*) at once, or is there a
> >> reason you're intentionally not assigning step?
> > Step info would anyways be determined later in the function intel_step_init.
> > We already have macros in place to handle common gt and media steps there.
> >
> > Do you suggest we memcpy(&RUNTIME_INFO(i915)->media.ip, &RUNTIME_INFO->graphics.ip, sizeof(struct ip_version)) here?
> 
> Simple assign should do it for such a small struct.

IMO for any struct. Only use memcpy() when copying arrays and such.

-- 
Ville Syrjälä
Intel



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux