Hi Sebastian,

[...]

> > index 865b61057566..88e6d706210c 100644
> > --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c
> > +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_capture.c
> > @@ -88,7 +88,7 @@
> >     { GEN12_SC_INSTDONE_EXTRA,  0,      0, "GEN12_SC_INSTDONE_EXTRA" }, \
> >     { GEN12_SC_INSTDONE_EXTRA2, 0,      0, "GEN12_SC_INSTDONE_EXTRA2" }
> >  
> > -#define COMMON_GEN12BASE_VEC \
> > +#define COMMON_GEN12BASE_VC \
> s/VC/VD/ ?
Yup, good catch.

> 
> and if
> #define GEN12_SFC_DONE(n) _MMIO(0x1cc000 + (n) * 0x1000)
> - SFC_DONE(0) = 0x1cc000
> - SFC_DONE(1) = 0x1cd000
> - SFC_DONE(2) = 0x1ce000
> - SFC_DONE(3) = 0x1cf000
> 
> >     { GEN12_SFC_DONE(0),        0,      0, "SFC_DONE[0]" }, \
> >     { GEN12_SFC_DONE(1),        0,      0, "SFC_DONE[1]" }, \
> >     { GEN12_SFC_DONE(2),        0,      0, "SFC_DONE[2]" }, \
> mtl_lists captures SFC_DONE(0..3) always. On the MTL media GT,
> __xelpmp_fw_ranges (intel_uncore.c) has this entry:
> ------------------------------------------------------------
> GEN_FW_RANGE(0x1cc000, 0x1cffff, FORCEWAKE_MEDIA_VDBOX0)
> 0x1cc000 - 0x1cdfff: VD0
> 0x1ce000 - 0x1cffff: reserved
> ------------------------------------------------------------
> 
> So only SFC_DONE(0) and (1) are in the documented range.  SFC_DONE(2)
> and (3) (0x1ce000, 0x1cf000) are marked reserved.
> 
> I don't know how GuC handles reserved registers. Could you please either
> trim the list to (0) and (1), or explain why reading (2) and (3) is fine.
Yeah, GUC generally responds to MTL only with these registers.
I ran tests on all members of Gen 12 and none of them seemed to
respond to the capture of SFC_DONE list on either vecs or vcs.

I'll remove 2 and 3 from the list.

> 
> 
> > @@ -117,9 +117,9 @@ static const struct __guc_mmio_reg_descr 
> > gen8_vd_inst_regs[] = {
> >     COMMON_BASE_ENGINE_INSTANCE,
> >  };
> >  
> > -/* XE_LP Video Enhancement Per-Class */
> > -static const struct __guc_mmio_reg_descr xe_lp_vec_class_regs[] = {
> > -   COMMON_GEN12BASE_VEC,
> > +/* XE_LP Video Per-Class */
> > +static const struct __guc_mmio_reg_descr xe_lp_vc_class_regs[] = {
> > +   COMMON_GEN12BASE_VC,
> >  };
> >  
> >  /* GEN8+ Video Enhancement Per-Engine-Instance */
> > @@ -189,7 +189,22 @@ static const struct __guc_mmio_reg_descr_group 
> > xe_lp_lists[] = {
> >     MAKE_REGLIST(gen8_rc_inst_regs, PF, ENGINE_INSTANCE, 
> > GUC_CAPTURE_LIST_CLASS_RENDER_COMPUTE),
> >     MAKE_REGLIST(empty_regs_list, PF, ENGINE_CLASS, 
> > GUC_CAPTURE_LIST_CLASS_VIDEO),
> >     MAKE_REGLIST(gen8_vd_inst_regs, PF, ENGINE_INSTANCE, 
> > GUC_CAPTURE_LIST_CLASS_VIDEO),
> > -   MAKE_REGLIST(xe_lp_vec_class_regs, PF, ENGINE_CLASS, 
> > GUC_CAPTURE_LIST_CLASS_VIDEOENHANCE),
> > +   MAKE_REGLIST(empty_regs_list, PF, ENGINE_CLASS, 
> > GUC_CAPTURE_LIST_CLASS_VIDEOENHANCE),
> > +   MAKE_REGLIST(gen8_vec_inst_regs, PF, ENGINE_INSTANCE, 
> > GUC_CAPTURE_LIST_CLASS_VIDEOENHANCE),
> > +   MAKE_REGLIST(empty_regs_list, PF, ENGINE_CLASS, 
> > GUC_CAPTURE_LIST_CLASS_BLITTER),
> > +   MAKE_REGLIST(gen8_blt_inst_regs, PF, ENGINE_INSTANCE, 
> > GUC_CAPTURE_LIST_CLASS_BLITTER),
> > +   MAKE_REGLIST(empty_regs_list, PF, ENGINE_CLASS, 
> > GUC_CAPTURE_LIST_CLASS_GSC_OTHER),
> > +   MAKE_REGLIST(xe_lp_gsc_inst_regs, PF, ENGINE_INSTANCE, 
> > GUC_CAPTURE_LIST_CLASS_GSC_OTHER),
> > +   {}
> > +};
> > +
> > +static const struct __guc_mmio_reg_descr_group mtl_lists[] = {
> > +   MAKE_REGLIST(xe_lp_global_regs, PF, GLOBAL, 0),
> > +   MAKE_REGLIST(xe_lp_rc_class_regs, PF, ENGINE_CLASS, 
> > GUC_CAPTURE_LIST_CLASS_RENDER_COMPUTE),
> > +   MAKE_REGLIST(gen8_rc_inst_regs, PF, ENGINE_INSTANCE, 
> > GUC_CAPTURE_LIST_CLASS_RENDER_COMPUTE),
> > +   MAKE_REGLIST(xe_lp_vc_class_regs, PF, ENGINE_CLASS, 
> > GUC_CAPTURE_LIST_CLASS_VIDEO),
> a
> Convention for CLASS_VIDEO is vd(e.g. gen8_vd_inst_regs).
> 
> > +   MAKE_REGLIST(gen8_vd_inst_regs, PF, ENGINE_INSTANCE, 
> > GUC_CAPTURE_LIST_CLASS_VIDEO),
> > +   MAKE_REGLIST(empty_regs_list, PF, ENGINE_CLASS, 
> > GUC_CAPTURE_LIST_CLASS_VIDEOENHANCE),
> >     MAKE_REGLIST(gen8_vec_inst_regs, PF, ENGINE_INSTANCE, 
> > GUC_CAPTURE_LIST_CLASS_VIDEOENHANCE),
> >     MAKE_REGLIST(empty_regs_list, PF, ENGINE_CLASS, 
> > GUC_CAPTURE_LIST_CLASS_BLITTER),
> >     MAKE_REGLIST(gen8_blt_inst_regs, PF, ENGINE_INSTANCE, 
> > GUC_CAPTURE_LIST_CLASS_BLITTER),
> > @@ -354,7 +369,13 @@ guc_capture_get_device_reglist(struct intel_guc *guc)
> >     struct drm_i915_private *i915 = guc_to_i915(guc);
> >     const struct __guc_mmio_reg_descr_group *lists;
> >  
> > -   if (GRAPHICS_VER(i915) >= 12)
> > +   if (IS_METEORLAKE(i915))
> > +           /**
> Those are kernrl doc comments style.
I assume you want to change the style here.

> 
> > +            * MTL is the only member of Gen 12 with SFC_DONE registers 
> > supported by
> > +            * error capture in GuC firmware, so use a separate list of 
> > registers there.
> > +            */
> > +           lists = mtl_lists;
> > +   else if (GRAPHICS_VER(i915) >= 12)
> >             lists = xe_lp_lists;
> You never mention other gen12 platforms (TGL, RKL, ADL, PVC), and this
> change is gonna affect them as well.
Yeah, this should land in the commit message. The GUC still only
ever responds to this on MTL and I found no trace of anybody
ever requiring to have these registerscaptured on other
platforms.

I'll also CC GuC folks in the thread of v2.

> 
> >     else
> >             lists = gen8_lists;
> 
> 
> 
> 
> 
> -- 
> Best regards,
> Sebastian
> 

-- 
Best Regards,
Krzysztof

Reply via email to