]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/xe/guc: Adding steering info support for GuC register lists
authorJesus Narvaez <jesus.narvaez@intel.com>
Thu, 12 Dec 2024 19:01:00 +0000 (11:01 -0800)
committerThomas Hellström <thomas.hellstrom@linux.intel.com>
Wed, 15 Jan 2025 10:32:50 +0000 (11:32 +0100)
The guc_mmio_reg interface supports steering, but it is currently not
implemented. This will allow the GuC to control steering of MMIO
registers after save-restore and avoid reading from fused off MCR
register instances.

Fixes: 9c57bc08652a ("drm/xe/lnl: Drop force_probe requirement")
Signed-off-by: Jesus Narvaez <jesus.narvaez@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241212190100.3768068-1-jesus.narvaez@intel.com
(cherry picked from commit ee5a1321df90891d59d83b7c9d5b6c5b755d059d)
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
drivers/gpu/drm/xe/xe_gt_mcr.c
drivers/gpu/drm/xe/xe_gt_mcr.h
drivers/gpu/drm/xe/xe_guc_ads.c

index 5013d674e17da8e968c8cc996e1166784c20b23b..d929a78c26a99c59a67de8b25183d29a343ad3dc 100644 (file)
@@ -550,9 +550,9 @@ void xe_gt_mcr_set_implicit_defaults(struct xe_gt *gt)
  * Returns true if the caller should steer to the @group/@instance values
  * returned.  Returns false if the caller need not perform any steering
  */
-static bool xe_gt_mcr_get_nonterminated_steering(struct xe_gt *gt,
-                                                struct xe_reg_mcr reg_mcr,
-                                                u8 *group, u8 *instance)
+bool xe_gt_mcr_get_nonterminated_steering(struct xe_gt *gt,
+                                         struct xe_reg_mcr reg_mcr,
+                                         u8 *group, u8 *instance)
 {
        const struct xe_reg reg = to_xe_reg(reg_mcr);
        const struct xe_mmio_range *implicit_ranges;
index c0cd36021c24692e759facc8b4269d34af315fa6..bc06520befabcb728ed12bb0ff7d819d40dd1d4a 100644 (file)
@@ -26,6 +26,10 @@ void xe_gt_mcr_unicast_write(struct xe_gt *gt, struct xe_reg_mcr mcr_reg,
 void xe_gt_mcr_multicast_write(struct xe_gt *gt, struct xe_reg_mcr mcr_reg,
                               u32 value);
 
+bool xe_gt_mcr_get_nonterminated_steering(struct xe_gt *gt,
+                                         struct xe_reg_mcr reg_mcr,
+                                         u8 *group, u8 *instance);
+
 void xe_gt_mcr_steering_dump(struct xe_gt *gt, struct drm_printer *p);
 void xe_gt_mcr_get_dss_steering(struct xe_gt *gt, unsigned int dss, u16 *group, u16 *instance);
 u32 xe_gt_mcr_steering_info_to_dss_id(struct xe_gt *gt, u16 group, u16 instance);
index 4e746ae98888f50bacb4069168751cb02eadc2d0..dd7f9d0effa9666e3140e0a26e314e440056db71 100644 (file)
@@ -29,6 +29,7 @@
 #include "xe_platform_types.h"
 #include "xe_uc_fw.h"
 #include "xe_wa.h"
+#include "xe_gt_mcr.h"
 
 /* Slack of a few additional entries per engine */
 #define ADS_REGSET_EXTRA_MAX   8
@@ -701,6 +702,20 @@ static void guc_mmio_regset_write_one(struct xe_guc_ads *ads,
                .flags = reg.masked ? GUC_REGSET_MASKED : 0,
        };
 
+       if (reg.mcr) {
+               struct xe_reg_mcr mcr_reg = XE_REG_MCR(reg.addr);
+               u8 group, instance;
+
+               bool steer = xe_gt_mcr_get_nonterminated_steering(ads_to_gt(ads), mcr_reg,
+                                                                 &group, &instance);
+
+               if (steer) {
+                       entry.flags |= FIELD_PREP(GUC_REGSET_STEERING_GROUP, group);
+                       entry.flags |= FIELD_PREP(GUC_REGSET_STEERING_INSTANCE, instance);
+                       entry.flags |= GUC_REGSET_STEERING_NEEDED;
+               }
+       }
+
        xe_map_memcpy_to(ads_to_xe(ads), regset_map, n_entry * sizeof(entry),
                         &entry, sizeof(entry));
 }