drm/xe: Store pointer to struct xe_gt in gt/ debugfs directory
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Thu, 28 Mar 2024 16:28:06 +0000 (17:28 +0100)
committerMichal Wajdeczko <michal.wajdeczko@intel.com>
Fri, 29 Mar 2024 13:00:05 +0000 (14:00 +0100)
Attributes added under 'gt/' directories may wish to use that
in case they can't obtain it from elsewhere.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Acked-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://lore.kernel.org/r/20240214115756.1525-2-michal.wajdeczko@intel.com
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240328162808.451-2-michal.wajdeczko@intel.com
drivers/gpu/drm/xe/xe_gt_debugfs.c

index 6b4dc292772772d544a1060d5ce578124f0aafce..abec616927f05df99ebe8fd2da0dd1e4509246f6 100644 (file)
@@ -268,6 +268,13 @@ void xe_gt_debugfs_register(struct xe_gt *gt)
                return;
        }
 
+       /*
+        * Store the xe_gt pointer as private data of the gt/ directory node
+        * so other GT specific attributes under that directory may refer to
+        * it by looking at its parent node private data.
+        */
+       root->d_inode->i_private = gt;
+
        /*
         * Allocate local copy as we need to pass in the GT to the debugfs
         * entry and drm_debugfs_create_files just references the drm_info_list