Skip to content

Commit ee5a132

Browse files
jnar17dceraolo
authored andcommitted
drm/xe/guc: Adding steering info support for GuC register lists
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: 9c57bc0 ("drm/xe/lnl: Drop force_probe requirement") Signed-off-by: Jesus Narvaez <[email protected]> Cc: Matt Roper <[email protected]> Cc: Lucas De Marchi <[email protected]> Cc: Daniele Ceraolo Spurio <[email protected]> Reviewed-by: Jonathan Cavitt <[email protected]> Signed-off-by: Daniele Ceraolo Spurio <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 75fd04f commit ee5a132

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

drivers/gpu/drm/xe/xe_gt_mcr.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -550,9 +550,9 @@ void xe_gt_mcr_set_implicit_defaults(struct xe_gt *gt)
550550
* Returns true if the caller should steer to the @group/@instance values
551551
* returned. Returns false if the caller need not perform any steering
552552
*/
553-
static bool xe_gt_mcr_get_nonterminated_steering(struct xe_gt *gt,
554-
struct xe_reg_mcr reg_mcr,
555-
u8 *group, u8 *instance)
553+
bool xe_gt_mcr_get_nonterminated_steering(struct xe_gt *gt,
554+
struct xe_reg_mcr reg_mcr,
555+
u8 *group, u8 *instance)
556556
{
557557
const struct xe_reg reg = to_xe_reg(reg_mcr);
558558
const struct xe_mmio_range *implicit_ranges;

drivers/gpu/drm/xe/xe_gt_mcr.h

+4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ void xe_gt_mcr_unicast_write(struct xe_gt *gt, struct xe_reg_mcr mcr_reg,
2626
void xe_gt_mcr_multicast_write(struct xe_gt *gt, struct xe_reg_mcr mcr_reg,
2727
u32 value);
2828

29+
bool xe_gt_mcr_get_nonterminated_steering(struct xe_gt *gt,
30+
struct xe_reg_mcr reg_mcr,
31+
u8 *group, u8 *instance);
32+
2933
void xe_gt_mcr_steering_dump(struct xe_gt *gt, struct drm_printer *p);
3034
void xe_gt_mcr_get_dss_steering(struct xe_gt *gt, unsigned int dss, u16 *group, u16 *instance);
3135
u32 xe_gt_mcr_steering_info_to_dss_id(struct xe_gt *gt, u16 group, u16 instance);

drivers/gpu/drm/xe/xe_guc_ads.c

+15
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "xe_platform_types.h"
3030
#include "xe_uc_fw.h"
3131
#include "xe_wa.h"
32+
#include "xe_gt_mcr.h"
3233

3334
/* Slack of a few additional entries per engine */
3435
#define ADS_REGSET_EXTRA_MAX 8
@@ -696,6 +697,20 @@ static void guc_mmio_regset_write_one(struct xe_guc_ads *ads,
696697
.flags = reg.masked ? GUC_REGSET_MASKED : 0,
697698
};
698699

700+
if (reg.mcr) {
701+
struct xe_reg_mcr mcr_reg = XE_REG_MCR(reg.addr);
702+
u8 group, instance;
703+
704+
bool steer = xe_gt_mcr_get_nonterminated_steering(ads_to_gt(ads), mcr_reg,
705+
&group, &instance);
706+
707+
if (steer) {
708+
entry.flags |= FIELD_PREP(GUC_REGSET_STEERING_GROUP, group);
709+
entry.flags |= FIELD_PREP(GUC_REGSET_STEERING_INSTANCE, instance);
710+
entry.flags |= GUC_REGSET_STEERING_NEEDED;
711+
}
712+
}
713+
699714
xe_map_memcpy_to(ads_to_xe(ads), regset_map, n_entry * sizeof(entry),
700715
&entry, sizeof(entry));
701716
}

0 commit comments

Comments
 (0)