]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/i915/gt: Create gt/gtN/.defaults/ for per gt sysfs defaults
authorAshutosh Dixit <ashutosh.dixit@intel.com>
Tue, 19 Jul 2022 01:07:07 +0000 (18:07 -0700)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 19 Jul 2022 10:14:01 +0000 (06:14 -0400)
Create a gt/gtN/.defaults/ directory (similar to
engine/<engine-name>/.defaults/) to expose default parameter values for
each gt in sysfs. This allows userspace to restore default parameter values
after they have changed. The empty 'struct gt_defaults' will be populated
by subsequent patches.

v2: Changed 'struct intel_rps_defaults rps_defaults' to
    'struct gt_defaults defaults' (Andi)

Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Andi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/be7c30d0ae58be9d8d5b8242ba00a1b2825e63ad.1658192398.git.ashutosh.dixit@intel.com
drivers/gpu/drm/i915/gt/intel_gt_sysfs.c
drivers/gpu/drm/i915/gt/intel_gt_types.h

index 9e4ebf53379bcaf8a17afd24ec921b492b136267..6447c0376dbdcbcfd522c90070fa66000ef5cfb6 100644 (file)
@@ -101,6 +101,10 @@ void intel_gt_sysfs_register(struct intel_gt *gt)
                                 gt->i915->sysfs_gt, "gt%d", gt->info.id))
                goto exit_fail;
 
+       gt->sysfs_defaults = kobject_create_and_add(".defaults", &gt->sysfs_gt);
+       if (!gt->sysfs_defaults)
+               goto exit_fail;
+
        intel_gt_sysfs_pm_init(gt, &gt->sysfs_gt);
 
        return;
@@ -113,5 +117,6 @@ exit_fail:
 
 void intel_gt_sysfs_unregister(struct intel_gt *gt)
 {
+       kobject_put(gt->sysfs_defaults);
        kobject_put(&gt->sysfs_gt);
 }
index df708802889dfc00e17863295b11bba5bf7d2e90..92839b9adb122194936d917e813bef50cb7e0bff 100644 (file)
@@ -75,6 +75,9 @@ enum intel_submission_method {
        INTEL_SUBMISSION_GUC,
 };
 
+struct gt_defaults {
+};
+
 struct intel_gt {
        struct drm_i915_private *i915;
        struct intel_uncore *uncore;
@@ -235,6 +238,10 @@ struct intel_gt {
 
        /* gt/gtN sysfs */
        struct kobject sysfs_gt;
+
+       /* sysfs defaults per gt */
+       struct gt_defaults defaults;
+       struct kobject *sysfs_defaults;
 };
 
 enum intel_gt_scratch_field {