Re: [PATCH v2 2/5] drm/i915/uc: Move uC WOPCM setup in uc_init_hw

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

 



Quoting Michal Wajdeczko (2019-07-31 10:00:57)
> On Wed, 31 Jul 2019 01:07:40 +0200, Daniele Ceraolo Spurio  
> <daniele.ceraolospurio@xxxxxxxxx> wrote:
> 
> > The register we write are not WOPCM regs but uC ones related to how
> > GuC and HuC are going to use the WOPCM, so it makes logical sense
> > for them to be programmed as part of uc_init_hw. The WOPCM map on the
> > other side is not uC-specific (although that is our main use-case), so
> > keep that separate.
> >
> > v2: move write_and_verify to uncore, fix log, re-use err_out tag,
> >     add intel_wopcm_guc_base, fix log
> >
> > Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@xxxxxxxxx>
> > Cc: Michal Wajdeczko <michal.wajdeczko@xxxxxxxxx>
> > Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> > ---
> 
> > --- a/drivers/gpu/drm/i915/intel_uncore.h
> > +++ b/drivers/gpu/drm/i915/intel_uncore.h
> > @@ -393,6 +393,18 @@ static inline void intel_uncore_rmw_fw(struct  
> > intel_uncore *uncore,
> >       intel_uncore_write_fw(uncore, reg, val);
> >  }
> > +static inline int intel_uncore_write_and_verify(struct intel_uncore  
> > *uncore,
> > +                                             i915_reg_t reg, u32 val,
> > +                                             u32 mask, u32 expected_val)
> > +{
> > +     u32 reg_val;
> > +
> > +     intel_uncore_write(uncore, reg, val);
> > +     reg_val = intel_uncore_read(uncore, reg);
> > +
> > +     return (reg_val & mask) != expected_val ? -EINVAL : 0;
> > +}
> 
> nit: I'm not sure that -EINVAL is the best choice (not sure about
> -ENODATA or -ENOKEY either) that's why I wanted to use bool ;)

ENXIO? It's a bridge we can cross later.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




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

  Powered by Linux