drm/xe: Check skip_guc_pc before setting SLPC flag
authorVinay Belgaumkar <vinay.belgaumkar@intel.com>
Mon, 8 Jan 2024 22:58:42 +0000 (14:58 -0800)
committerThomas Hellström <thomas.hellstrom@linux.intel.com>
Mon, 15 Jan 2024 14:36:52 +0000 (15:36 +0100)
Don't set SLPC GuC feature ctl flag if skip_guc_pc is true.

v2: Skip the freq related sysfs creation as well (Badal)
v3: Remove unnecessary parenthesis (Lucas)

Fixes: 975e4a3795d4 ("drm/xe: Manually setup C6 when skip_guc_pc is set")
Fixes: bef52b5c7a19 ("drm/xe: Create a xe_gt_freq component for raw management and sysfs")
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Link: https://lore.kernel.org/r/20240108225842.966066-1-vinay.belgaumkar@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
(cherry picked from commit 69cac0a8f3ef8db4d62441c4a2686ec676c9facd)
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
drivers/gpu/drm/xe/xe_gt_freq.c
drivers/gpu/drm/xe/xe_guc.c

index 3adfa6686e7cf9eb2763bccc28b7a0a382dd4834..e5b0f4ecdbe8261ee5c3fa9530a30dc2fd46c14b 100644 (file)
@@ -196,6 +196,9 @@ void xe_gt_freq_init(struct xe_gt *gt)
        struct xe_device *xe = gt_to_xe(gt);
        int err;
 
+       if (xe->info.skip_guc_pc)
+               return;
+
        gt->freq = kobject_create_and_add("freq0", gt->sysfs);
        if (!gt->freq) {
                drm_warn(&xe->drm, "failed to add freq0 directory to %s\n",
index 482cb0df9f15bc28d9f5c2a0ea194319f1b2a21a..0a61390c64a7b7100113641f2e073f4ce58d358e 100644 (file)
@@ -60,7 +60,12 @@ static u32 guc_ctl_debug_flags(struct xe_guc *guc)
 
 static u32 guc_ctl_feature_flags(struct xe_guc *guc)
 {
-       return GUC_CTL_ENABLE_SLPC;
+       u32 flags = 0;
+
+       if (!guc_to_xe(guc)->info.skip_guc_pc)
+               flags |= GUC_CTL_ENABLE_SLPC;
+
+       return flags;
 }
 
 static u32 guc_ctl_log_params_flags(struct xe_guc *guc)