Skip to content

Commit 0dc8538

Browse files
committed
Merge tag 'drm-xe-next-2025-01-10' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-next
Driver Changes: - SRIOV VF: Avoid reading inaccessible registers (Jakub, Marcin) - Introduce RPa frequency information (Rodrigo) - Remove unnecessary force wakes on SLPC code (Vinay) - Fix all typos in xe (Nitin) - Adding steering info support for GuC register lists (Jesus) - Remove unused xe_pciids.h harder, add missing PCI ID (Jani) Signed-off-by: Dave Airlie <[email protected]> From: Rodrigo Vivi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 255e094 + 6a04bb5 commit 0dc8538

40 files changed

+162
-302
lines changed

drivers/gpu/drm/xe/Kconfig.debug

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ config DRM_XE_DEBUG_MEM
6666
bool "Enable passing SYS/VRAM addresses to user space"
6767
default n
6868
help
69-
Pass object location trough uapi. Intended for extended
69+
Pass object location through uapi. Intended for extended
7070
testing and development only.
7171

7272
Recommended for driver developers only.
@@ -104,5 +104,5 @@ config DRM_XE_USERPTR_INVAL_INJECT
104104
Choose this option when debugging error paths that
105105
are hit during checks for userptr invalidations.
106106

107-
Recomended for driver developers only.
107+
Recommended for driver developers only.
108108
If in doubt, say "N".

drivers/gpu/drm/xe/abi/guc_capture_abi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ enum guc_state_capture_type {
2525

2626
#define GUC_STATE_CAPTURE_TYPE_MAX (GUC_STATE_CAPTURE_TYPE_ENGINE_INSTANCE + 1)
2727

28-
/* Class indecies for capture_class and capture_instance arrays */
28+
/* Class indices for capture_class and capture_instance arrays */
2929
enum guc_capture_list_class_type {
3030
GUC_CAPTURE_LIST_CLASS_RENDER_COMPUTE = 0,
3131
GUC_CAPTURE_LIST_CLASS_VIDEO = 1,

drivers/gpu/drm/xe/abi/guc_klvs_abi.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ enum {
132132
* _`GUC_KLV_VGT_POLICY_SCHED_IF_IDLE` : 0x8001
133133
* This config sets whether strict scheduling is enabled whereby any VF
134134
* that doesn’t have work to submit is still allocated a fixed execution
135-
* time-slice to ensure active VFs execution is always consitent even
135+
* time-slice to ensure active VFs execution is always consistent even
136136
* during other VF reprovisiong / rebooting events. Changing this KLV
137137
* impacts all VFs and takes effect on the next VF-Switch event.
138138
*
@@ -207,7 +207,7 @@ enum {
207207
* of and this will never be perfectly-exact (accumulated nano-second
208208
* granularity) since the GPUs clock time runs off a different crystal
209209
* from the CPUs clock. Changing this KLV on a VF that is currently
210-
* running a context wont take effect until a new context is scheduled in.
210+
* running a context won't take effect until a new context is scheduled in.
211211
* That said, when the PF is changing this value from 0x0 to
212212
* a non-zero value, it might never take effect if the VF is running an
213213
* infinitely long compute or shader kernel. In such a scenario, the
@@ -227,7 +227,7 @@ enum {
227227
* HW is capable and this will never be perfectly-exact (accumulated
228228
* nano-second granularity) since the GPUs clock time runs off a
229229
* different crystal from the CPUs clock. Changing this KLV on a VF
230-
* that is currently running a context wont take effect until a new
230+
* that is currently running a context won't take effect until a new
231231
* context is scheduled in.
232232
* That said, when the PF is changing this value from 0x0 to
233233
* a non-zero value, it might never take effect if the VF is running an

drivers/gpu/drm/xe/regs/xe_reg_defs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/**
1414
* struct xe_reg - Register definition
1515
*
16-
* Register defintion to be used by the individual register. Although the same
16+
* Register definition to be used by the individual register. Although the same
1717
* definition is used for xe_reg and xe_reg_mcr, they use different internal
1818
* APIs for accesses.
1919
*/

drivers/gpu/drm/xe/regs/xe_regs.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,16 @@
4444

4545
#define MTL_RP_STATE_CAP XE_REG(0x138000)
4646

47+
#define MTL_GT_RPA_FREQUENCY XE_REG(0x138008)
4748
#define MTL_GT_RPE_FREQUENCY XE_REG(0x13800c)
4849

4950
#define MTL_MEDIAP_STATE_CAP XE_REG(0x138020)
5051
#define MTL_RPN_CAP_MASK REG_GENMASK(24, 16)
5152
#define MTL_RP0_CAP_MASK REG_GENMASK(8, 0)
5253

54+
#define MTL_MPA_FREQUENCY XE_REG(0x138028)
55+
#define MTL_RPA_MASK REG_GENMASK(8, 0)
56+
5357
#define MTL_MPE_FREQUENCY XE_REG(0x13802c)
5458
#define MTL_RPE_MASK REG_GENMASK(8, 0)
5559

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static void read_l3cc_table(struct xe_gt *gt,
5858

5959
mocs_dbg(gt, "reg_val=0x%x\n", reg_val);
6060
} else {
61-
/* Just re-use value read on previous iteration */
61+
/* Just reuse value read on previous iteration */
6262
reg_val >>= 16;
6363
}
6464

drivers/gpu/drm/xe/xe_bb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ struct xe_bb *xe_bb_new(struct xe_gt *gt, u32 dwords, bool usm)
4141
/*
4242
* We need to allocate space for the requested number of dwords,
4343
* one additional MI_BATCH_BUFFER_END dword, and additional buffer
44-
* space to accomodate the platform-specific hardware prefetch
44+
* space to accommodate the platform-specific hardware prefetch
4545
* requirements.
4646
*/
4747
bb->bo = xe_sa_bo_new(!usm ? tile->mem.kernel_bb_pool : gt->usm.bb_pool,

drivers/gpu/drm/xe/xe_bo.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, bool evict,
786786
* / resume, some of the pinned memory is required for the
787787
* device to resume / use the GPU to move other evicted memory
788788
* (user memory) around. This likely could be optimized a bit
789-
* futher where we find the minimum set of pinned memory
789+
* further where we find the minimum set of pinned memory
790790
* required for resume but for simplity doing a memcpy for all
791791
* pinned memory.
792792
*/
@@ -875,7 +875,7 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, bool evict,
875875
* xe_bo_evict_pinned() - Evict a pinned VRAM object to system memory
876876
* @bo: The buffer object to move.
877877
*
878-
* On successful completion, the object memory will be moved to sytem memory.
878+
* On successful completion, the object memory will be moved to system memory.
879879
*
880880
* This is needed to for special handling of pinned VRAM object during
881881
* suspend-resume.
@@ -1370,7 +1370,7 @@ static const struct drm_gem_object_funcs xe_gem_object_funcs = {
13701370
/**
13711371
* xe_bo_alloc - Allocate storage for a struct xe_bo
13721372
*
1373-
* This funcition is intended to allocate storage to be used for input
1373+
* This function is intended to allocate storage to be used for input
13741374
* to __xe_bo_create_locked(), in the case a pointer to the bo to be
13751375
* created is needed before the call to __xe_bo_create_locked().
13761376
* If __xe_bo_create_locked ends up never to be called, then the
@@ -2412,7 +2412,7 @@ int xe_bo_migrate(struct xe_bo *bo, u32 mem_type)
24122412
* @force_alloc: Set force_alloc in ttm_operation_ctx
24132413
*
24142414
* On successful completion, the object memory will be moved to evict
2415-
* placement. Ths function blocks until the object has been fully moved.
2415+
* placement. This function blocks until the object has been fully moved.
24162416
*
24172417
* Return: 0 on success. Negative error code on failure.
24182418
*/

drivers/gpu/drm/xe/xe_bo_doc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* created the BO can be mmap'd (via DRM_IOCTL_XE_GEM_MMAP_OFFSET) for user
4242
* access and it can be bound for GPU access (via DRM_IOCTL_XE_VM_BIND). All
4343
* user BOs are evictable and user BOs are never pinned by XE. The allocation of
44-
* the backing store can be defered from creation time until first use which is
44+
* the backing store can be deferred from creation time until first use which is
4545
* either mmap, bind, or pagefault.
4646
*
4747
* Private BOs

drivers/gpu/drm/xe/xe_devcoredump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
*
4949
* **Coredump release**:
5050
* After a coredump is generated, it stays in kernel memory until released by
51-
* userpace by writing anything to it, or after an internal timer expires. The
51+
* userspace by writing anything to it, or after an internal timer expires. The
5252
* exact timeout may vary and should not be relied upon. Example to release
5353
* a coredump:
5454
*

drivers/gpu/drm/xe/xe_device.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ static int probe_has_flat_ccs(struct xe_device *xe)
606606
u32 reg;
607607

608608
/* Always enabled/disabled, no runtime check to do */
609-
if (GRAPHICS_VER(xe) < 20 || !xe->info.has_flat_ccs)
609+
if (GRAPHICS_VER(xe) < 20 || !xe->info.has_flat_ccs || IS_SRIOV_VF(xe))
610610
return 0;
611611

612612
gt = xe_root_mmio_gt(xe);
@@ -999,7 +999,7 @@ static void xe_device_wedged_fini(struct drm_device *drm, void *arg)
999999
* xe_device_declare_wedged - Declare device wedged
10001000
* @xe: xe device instance
10011001
*
1002-
* This is a final state that can only be cleared with a mudule
1002+
* This is a final state that can only be cleared with a module
10031003
* re-probe (unbind + bind).
10041004
* In this state every IOCTL will be blocked so the GT cannot be used.
10051005
* In general it will be called upon any critical error such as gt reset

drivers/gpu/drm/xe/xe_drm_client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ static void show_run_ticks(struct drm_printer *p, struct drm_file *file)
385385
* @p: The drm_printer ptr
386386
* @file: The drm_file ptr
387387
*
388-
* This is callabck for drm fdinfo interface. Register this callback
388+
* This is callback for drm fdinfo interface. Register this callback
389389
* in drm driver ops for show_fdinfo.
390390
*
391391
* Return: void

drivers/gpu/drm/xe/xe_exec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
*
3434
* In XE we avoid all of this complication by not allowing a BO list to be
3535
* passed into an exec, using the dma-buf implicit sync uAPI, have binds as
36-
* seperate operations, and using the DRM scheduler to flow control the ring.
36+
* separate operations, and using the DRM scheduler to flow control the ring.
3737
* Let's deep dive on each of these.
3838
*
3939
* We can get away from a BO list by forcing the user to use in / out fences on

drivers/gpu/drm/xe/xe_ggtt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ int xe_ggtt_init(struct xe_ggtt *ggtt)
362362

363363
/*
364364
* So we don't need to worry about 64K GGTT layout when dealing with
365-
* scratch entires, rather keep the scratch page in system memory on
365+
* scratch entries, rather keep the scratch page in system memory on
366366
* platforms where 64K pages are needed for VRAM.
367367
*/
368368
flags = XE_BO_FLAG_PINNED;

drivers/gpu/drm/xe/xe_gt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ int xe_gt_record_default_lrcs(struct xe_gt *gt);
3737

3838
/**
3939
* xe_gt_record_user_engines - save data related to engines available to
40-
* usersapce
40+
* userspace
4141
* @gt: GT structure
4242
*
4343
* Walk the available HW engines from gt->info.engine_mask and calculate data

drivers/gpu/drm/xe/xe_gt_freq.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,20 @@ static ssize_t rpe_freq_show(struct device *dev,
115115
}
116116
static DEVICE_ATTR_RO(rpe_freq);
117117

118+
static ssize_t rpa_freq_show(struct device *dev,
119+
struct device_attribute *attr, char *buf)
120+
{
121+
struct xe_guc_pc *pc = dev_to_pc(dev);
122+
u32 freq;
123+
124+
xe_pm_runtime_get(dev_to_xe(dev));
125+
freq = xe_guc_pc_get_rpa_freq(pc);
126+
xe_pm_runtime_put(dev_to_xe(dev));
127+
128+
return sysfs_emit(buf, "%d\n", freq);
129+
}
130+
static DEVICE_ATTR_RO(rpa_freq);
131+
118132
static ssize_t rpn_freq_show(struct device *dev,
119133
struct device_attribute *attr, char *buf)
120134
{
@@ -202,6 +216,7 @@ static const struct attribute *freq_attrs[] = {
202216
&dev_attr_act_freq.attr,
203217
&dev_attr_cur_freq.attr,
204218
&dev_attr_rp0_freq.attr,
219+
&dev_attr_rpa_freq.attr,
205220
&dev_attr_rpe_freq.attr,
206221
&dev_attr_rpn_freq.attr,
207222
&dev_attr_min_freq.attr,

drivers/gpu/drm/xe/xe_gt_mcr.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ void xe_gt_mcr_get_dss_steering(struct xe_gt *gt, unsigned int dss, u16 *group,
371371
* @group: steering group ID
372372
* @instance: steering instance ID
373373
*
374-
* Return: the coverted DSS id.
374+
* Return: the converted DSS id.
375375
*/
376376
u32 xe_gt_mcr_steering_info_to_dss_id(struct xe_gt *gt, u16 group, u16 instance)
377377
{
@@ -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_gt_sriov_pf_config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2161,7 +2161,7 @@ bool xe_gt_sriov_pf_config_is_empty(struct xe_gt *gt, unsigned int vfid)
21612161
*
21622162
* This function can only be called on PF.
21632163
*
2164-
* Return: mininum size of the buffer or the number of bytes saved,
2164+
* Return: minimum size of the buffer or the number of bytes saved,
21652165
* or a negative error code on failure.
21662166
*/
21672167
ssize_t xe_gt_sriov_pf_config_save(struct xe_gt *gt, unsigned int vfid, void *buf, size_t size)

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
@@ -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
}

drivers/gpu/drm/xe/xe_guc_capture.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1955,7 +1955,7 @@ xe_engine_snapshot_capture_for_queue(struct xe_exec_queue *q)
19551955
}
19561956

19571957
/*
1958-
* xe_guc_capture_put_matched_nodes - Cleanup macthed nodes
1958+
* xe_guc_capture_put_matched_nodes - Cleanup matched nodes
19591959
* @guc: The GuC object
19601960
*
19611961
* Free matched node and all nodes with the equal guc_id from

drivers/gpu/drm/xe/xe_guc_capture_types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ enum capture_register_data_type {
2222
* struct __guc_mmio_reg_descr - GuC mmio register descriptor
2323
*
2424
* xe_guc_capture module uses these structures to define a register
25-
* (offsets, names, flags,...) that are used at the ADS regisration
25+
* (offsets, names, flags,...) that are used at the ADS registration
2626
* time as well as during runtime processing and reporting of error-
2727
* capture states generated by GuC just prior to engine reset events.
2828
*/
@@ -48,7 +48,7 @@ struct __guc_mmio_reg_descr {
4848
*
4949
* xe_guc_capture module uses these structures to maintain static
5050
* tables (per unique platform) that consists of lists of registers
51-
* (offsets, names, flags,...) that are used at the ADS regisration
51+
* (offsets, names, flags,...) that are used at the ADS registration
5252
* time as well as during runtime processing and reporting of error-
5353
* capture states generated by GuC just prior to engine reset events.
5454
*/

drivers/gpu/drm/xe/xe_guc_ct.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ static int h2g_write(struct xe_guc_ct *ct, const u32 *action, u32 len,
710710
--len;
711711
++action;
712712

713-
/* Write H2G ensuring visable before descriptor update */
713+
/* Write H2G ensuring visible before descriptor update */
714714
xe_map_memcpy_to(xe, &map, 0, cmd, H2G_CT_HEADERS * sizeof(u32));
715715
xe_map_memcpy_to(xe, &map, H2G_CT_HEADERS * sizeof(u32), action, len * sizeof(u32));
716716
xe_device_wmb(xe);
@@ -1383,7 +1383,7 @@ static int g2h_read(struct xe_guc_ct *ct, u32 *msg, bool fast_path)
13831383
* this function and nowhere else. Hence, they cannot be different
13841384
* unless two g2h_read calls are running concurrently. Which is not
13851385
* possible because it is guarded by ct->fast_lock. And yet, some
1386-
* discrete platforms are reguarly hitting this error :(.
1386+
* discrete platforms are regularly hitting this error :(.
13871387
*
13881388
* desc_head rolling backwards shouldn't cause any noticeable
13891389
* problems - just a delay in GuC being allowed to proceed past that

0 commit comments

Comments
 (0)