On Mon, Dec 13, 2021 at 04:01:15PM +0200, Jani Nikula wrote: > On Mon, 13 Dec 2021, Ville Syrjala <ville.syrjala@xxxxxxxxxxxxxxx> wrote: > > From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> > > > > Expose FBC debugfs files for each crtc. These may or may not point > > to the same FBC instance depending on the platform. > > > > We leave the old global debugfs files in place until > > igt catches up to the new per-crtc approach. > > > > Cc: Jani Nikula <jani.nikula@xxxxxxxxx> > > Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> > > --- > > drivers/gpu/drm/i915/display/intel_fbc.c | 31 +++++++++++++++--------- > > 1 file changed, 19 insertions(+), 12 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c > > index 53c93387710c..eafd84e7f058 100644 > > --- a/drivers/gpu/drm/i915/display/intel_fbc.c > > +++ b/drivers/gpu/drm/i915/display/intel_fbc.c > > @@ -1798,25 +1798,32 @@ DEFINE_SIMPLE_ATTRIBUTE(intel_fbc_debugfs_false_color_fops, > > intel_fbc_debugfs_false_color_set, > > "%llu\n"); > > > > -static void intel_fbc_debugfs_add(struct intel_fbc *fbc) > > +static void intel_fbc_debugfs_add(struct intel_fbc *fbc, > > + struct dentry *parent) > > { > > - struct drm_i915_private *i915 = fbc->i915; > > - struct drm_minor *minor = i915->drm.primary; > > - > > - debugfs_create_file("i915_fbc_status", 0444, > > - minor->debugfs_root, fbc, > > - &intel_fbc_debugfs_status_fops); > > + debugfs_create_file("i915_fbc_status", 0444, parent, > > + fbc, &intel_fbc_debugfs_status_fops); > > > > if (fbc->funcs->set_false_color) > > - debugfs_create_file("i915_fbc_false_color", 0644, > > - minor->debugfs_root, fbc, > > - &intel_fbc_debugfs_false_color_fops); > > + debugfs_create_file("i915_fbc_false_color", 0644, parent, > > + fbc, &intel_fbc_debugfs_false_color_fops); > > } > > > > void intel_fbc_debugfs_register(struct drm_i915_private *i915) > > { > > - struct intel_fbc *fbc = i915->fbc[INTEL_FBC_A]; > > + struct drm_minor *minor = i915->drm.primary; > > + struct intel_crtc *crtc; > > + struct intel_fbc *fbc; > > > > + for_each_intel_crtc(&i915->drm, crtc) { > > + struct intel_plane *plane = to_intel_plane(crtc->base.primary); > > + > > + if (plane->fbc) > > + intel_fbc_debugfs_add(plane->fbc, crtc->base.debugfs_entry); > > + } > > I think the per-crtc debugfs files should be registered via > intel_crtc_debugfs_add(). I supposs. Seems a bit more leaky as far as abstractions goes though. It would make a lot more sense if crtcs could be registered dynamically, but they can't. I'll respin anyway. -- Ville Syrjälä Intel