Skip to content

Commit 9b1c673

Browse files
committed
Merge tag 'drm-xe-fixes-2025-01-16' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes
Driver Changes: - Add steering info support for GuC register lists (Jesus Narvaez) - Add means to wait for reset and synchronous reset (Maciej) - Make changing ccs_mode a synchronous action (Maciej) - Add missing mux registers (Ashutosh) - Mark ComputeCS read mode as UC on iGPU, unblocking ULLS on iGPU (Matt Brost) Signed-off-by: Dave Airlie <[email protected]> From: Thomas Hellstrom <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/Z4ll3F1anLEwCvrf@fedora
2 parents cfaf51a + b1231ff commit 9b1c673

File tree

10 files changed

+55
-14
lines changed

10 files changed

+55
-14
lines changed

drivers/gpu/drm/xe/tests/xe_bo.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,9 @@ static int evict_test_run_tile(struct xe_device *xe, struct xe_tile *tile, struc
257257
* however seems quite fragile not to also restart the GT. Try
258258
* to do that here by triggering a GT reset.
259259
*/
260-
for_each_gt(__gt, xe, id) {
261-
xe_gt_reset_async(__gt);
262-
flush_work(&__gt->reset.worker);
263-
}
260+
for_each_gt(__gt, xe, id)
261+
xe_gt_reset(__gt);
262+
264263
if (err) {
265264
KUNIT_FAIL(test, "restore kernel err=%pe\n",
266265
ERR_PTR(err));

drivers/gpu/drm/xe/tests/xe_mocs.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,7 @@ static int mocs_reset_test_run_device(struct xe_device *xe)
162162
if (flags & HAS_LNCF_MOCS)
163163
read_l3cc_table(gt, &mocs.table);
164164

165-
xe_gt_reset_async(gt);
166-
flush_work(&gt->reset.worker);
165+
xe_gt_reset(gt);
167166

168167
kunit_info(test, "mocs_reset_test after reset\n");
169168
if (flags & HAS_GLOBAL_MOCS)

drivers/gpu/drm/xe/xe_gt.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,31 @@ void xe_gt_sanitize(struct xe_gt *gt);
5656
int xe_gt_sanitize_freq(struct xe_gt *gt);
5757
void xe_gt_remove(struct xe_gt *gt);
5858

59+
/**
60+
* xe_gt_wait_for_reset - wait for gt's async reset to finalize.
61+
* @gt: GT structure
62+
* Return:
63+
* %true if it waited for the work to finish execution,
64+
* %false if there was no scheduled reset or it was done.
65+
*/
66+
static inline bool xe_gt_wait_for_reset(struct xe_gt *gt)
67+
{
68+
return flush_work(&gt->reset.worker);
69+
}
70+
71+
/**
72+
* xe_gt_reset - perform synchronous reset
73+
* @gt: GT structure
74+
* Return:
75+
* %true if it waited for the reset to finish,
76+
* %false if there was no scheduled reset.
77+
*/
78+
static inline bool xe_gt_reset(struct xe_gt *gt)
79+
{
80+
xe_gt_reset_async(gt);
81+
return xe_gt_wait_for_reset(gt);
82+
}
83+
5984
/**
6085
* xe_gt_any_hw_engine_by_reset_domain - scan the list of engines and return the
6186
* first that matches the same reset domain as @class

drivers/gpu/drm/xe/xe_gt_ccs_mode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ ccs_mode_store(struct device *kdev, struct device_attribute *attr,
150150
xe_gt_info(gt, "Setting compute mode to %d\n", num_engines);
151151
gt->ccs_mode = num_engines;
152152
xe_gt_record_user_engines(gt);
153-
xe_gt_reset_async(gt);
153+
xe_gt_reset(gt);
154154
}
155155

156156
mutex_unlock(&xe->drm.filelist_mutex);

drivers/gpu/drm/xe/xe_gt_debugfs.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,9 @@ static int force_reset(struct xe_gt *gt, struct drm_printer *p)
132132
static int force_reset_sync(struct xe_gt *gt, struct drm_printer *p)
133133
{
134134
xe_pm_runtime_get(gt_to_xe(gt));
135-
xe_gt_reset_async(gt);
135+
xe_gt_reset(gt);
136136
xe_pm_runtime_put(gt_to_xe(gt));
137137

138-
flush_work(&gt->reset.worker);
139-
140138
return 0;
141139
}
142140

drivers/gpu/drm/xe/xe_gt_mcr.c

Lines changed: 3 additions & 3 deletions
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

Lines changed: 4 additions & 0 deletions
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

Lines changed: 15 additions & 0 deletions
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
@@ -701,6 +702,20 @@ static void guc_mmio_regset_write_one(struct xe_guc_ads *ads,
701702
.flags = reg.masked ? GUC_REGSET_MASKED : 0,
702703
};
703704

705+
if (reg.mcr) {
706+
struct xe_reg_mcr mcr_reg = XE_REG_MCR(reg.addr);
707+
u8 group, instance;
708+
709+
bool steer = xe_gt_mcr_get_nonterminated_steering(ads_to_gt(ads), mcr_reg,
710+
&group, &instance);
711+
712+
if (steer) {
713+
entry.flags |= FIELD_PREP(GUC_REGSET_STEERING_GROUP, group);
714+
entry.flags |= FIELD_PREP(GUC_REGSET_STEERING_INSTANCE, instance);
715+
entry.flags |= GUC_REGSET_STEERING_NEEDED;
716+
}
717+
}
718+
704719
xe_map_memcpy_to(ads_to_xe(ads), regset_map, n_entry * sizeof(entry),
705720
&entry, sizeof(entry));
706721
}

drivers/gpu/drm/xe/xe_hw_engine.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ hw_engine_setup_default_state(struct xe_hw_engine *hwe)
419419
* Bspec: 72161
420420
*/
421421
const u8 mocs_write_idx = gt->mocs.uc_index;
422-
const u8 mocs_read_idx = hwe->class == XE_ENGINE_CLASS_COMPUTE &&
422+
const u8 mocs_read_idx = hwe->class == XE_ENGINE_CLASS_COMPUTE && IS_DGFX(xe) &&
423423
(GRAPHICS_VER(xe) >= 20 || xe->info.platform == XE_PVC) ?
424424
gt->mocs.wb_index : gt->mocs.uc_index;
425425
u32 ring_cmd_cctl_val = REG_FIELD_PREP(CMD_CCTL_WRITE_OVERRIDE_MASK, mocs_write_idx) |

drivers/gpu/drm/xe/xe_oa.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2198,6 +2198,7 @@ static const struct xe_mmio_range xe2_oa_mux_regs[] = {
21982198
{ .start = 0x5194, .end = 0x5194 }, /* SYS_MEM_LAT_MEASURE_MERTF_GRP_3D */
21992199
{ .start = 0x8704, .end = 0x8704 }, /* LMEM_LAT_MEASURE_MCFG_GRP */
22002200
{ .start = 0xB1BC, .end = 0xB1BC }, /* L3_BANK_LAT_MEASURE_LBCF_GFX */
2201+
{ .start = 0xD0E0, .end = 0xD0F4 }, /* VISACTL */
22012202
{ .start = 0xE18C, .end = 0xE18C }, /* SAMPLER_MODE */
22022203
{ .start = 0xE590, .end = 0xE590 }, /* TDL_LSC_LAT_MEASURE_TDL_GFX */
22032204
{ .start = 0x13000, .end = 0x137FC }, /* PES_0_PESL0 - PES_63_UPPER_PESL3 */

0 commit comments

Comments
 (0)