Skip to content

Commit 6f167a3

Browse files
committed
Merge tag 'drm-intel-gt-next-2024-02-15' of git://anongit.freedesktop.org/drm/drm-intel into drm-next
UAPI Changes: - Add GuC submission interface version query (Tvrtko Ursulin) Driver Changes: Fixes/improvements/new stuff: - Atomically invalidate userptr on mmu-notifier (Jonathan Cavitt) - Update handling of MMIO triggered reports (Umesh Nerlige Ramappa) - Don't make assumptions about intel_wakeref_t type (Jani Nikula) - Add workaround 14019877138 [xelpg] (Tejas Upadhyay) - Allow for very slow HuC loading [huc] (John Harrison) - Flush context destruction worker at suspend [guc] (Alan Previn) - Close deregister-context race against CT-loss [guc] (Alan Previn) - Avoid circular locking issue on busyness flush [guc] (John Harrison) - Use rc6.supported flag from intel_gt for rc6_enable sysfs (Juan Escamilla) - Reflect the true and current status of rc6_enable (Juan Escamilla) - Wake GT before sending H2G message [mtl] (Vinay Belgaumkar) - Restart the heartbeat timer when forcing a pulse (John Harrison) Future platform enablement: - Extend driver code of Xe_LPG to Xe_LPG+ [xelpg] (Harish Chegondi) - Extend some workarounds/tuning to gfx version 12.74 [xelpg] (Matt Roper) Miscellaneous: - Reconcile Excess struct member kernel-doc warnings (Randy Dunlap) - Change wa and EU_PERF_CNTL registers to MCR type [guc] (Shuicheng Lin) - Add flex arrays to struct i915_syncmap (Erick Archer) - Increasing the sleep time for live_rc6_manual [selftests] (Anirban Sk) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/Zc3iIVsiAwo+bu10@tursulin-desk
2 parents b13cfb4 + eb927f0 commit 6f167a3

26 files changed

+301
-149
lines changed

drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2160,12 +2160,6 @@ static int eb_move_to_gpu(struct i915_execbuffer *eb)
21602160

21612161
#ifdef CONFIG_MMU_NOTIFIER
21622162
if (!err && (eb->args->flags & __EXEC_USERPTR_USED)) {
2163-
read_lock(&eb->i915->mm.notifier_lock);
2164-
2165-
/*
2166-
* count is always at least 1, otherwise __EXEC_USERPTR_USED
2167-
* could not have been set
2168-
*/
21692163
for (i = 0; i < count; i++) {
21702164
struct eb_vma *ev = &eb->vma[i];
21712165
struct drm_i915_gem_object *obj = ev->vma->obj;
@@ -2177,8 +2171,6 @@ static int eb_move_to_gpu(struct i915_execbuffer *eb)
21772171
if (err)
21782172
break;
21792173
}
2180-
2181-
read_unlock(&eb->i915->mm.notifier_lock);
21822174
}
21832175
#endif
21842176

drivers/gpu/drm/i915/gem/i915_gem_pm.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ void i915_gem_suspend(struct drm_i915_private *i915)
2828
GEM_TRACE("%s\n", dev_name(i915->drm.dev));
2929

3030
intel_wakeref_auto(&i915->runtime_pm.userfault_wakeref, 0);
31+
/*
32+
* On rare occasions, we've observed the fence completion triggers
33+
* free_engines asynchronously via rcu_call. Ensure those are done.
34+
* This path is only called on suspend, so it's an acceptable cost.
35+
*/
36+
rcu_barrier();
37+
3138
flush_workqueue(i915->wq);
3239

3340
/*
@@ -160,6 +167,9 @@ void i915_gem_suspend_late(struct drm_i915_private *i915)
160167
* machine in an unusable condition.
161168
*/
162169

170+
/* Like i915_gem_suspend, flush tasks staged from fence triggers */
171+
rcu_barrier();
172+
163173
for_each_gt(gt, i915, i)
164174
intel_gt_suspend_late(gt);
165175

drivers/gpu/drm/i915/gem/i915_gem_userptr.c

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
#include "i915_drv.h"
4343
#include "i915_gem_ioctls.h"
4444
#include "i915_gem_object.h"
45-
#include "i915_gem_userptr.h"
4645
#include "i915_scatterlist.h"
4746

4847
#ifdef CONFIG_MMU_NOTIFIER
@@ -61,36 +60,7 @@ static bool i915_gem_userptr_invalidate(struct mmu_interval_notifier *mni,
6160
const struct mmu_notifier_range *range,
6261
unsigned long cur_seq)
6362
{
64-
struct drm_i915_gem_object *obj = container_of(mni, struct drm_i915_gem_object, userptr.notifier);
65-
struct drm_i915_private *i915 = to_i915(obj->base.dev);
66-
long r;
67-
68-
if (!mmu_notifier_range_blockable(range))
69-
return false;
70-
71-
write_lock(&i915->mm.notifier_lock);
72-
7363
mmu_interval_set_seq(mni, cur_seq);
74-
75-
write_unlock(&i915->mm.notifier_lock);
76-
77-
/*
78-
* We don't wait when the process is exiting. This is valid
79-
* because the object will be cleaned up anyway.
80-
*
81-
* This is also temporarily required as a hack, because we
82-
* cannot currently force non-consistent batch buffers to preempt
83-
* and reschedule by waiting on it, hanging processes on exit.
84-
*/
85-
if (current->flags & PF_EXITING)
86-
return true;
87-
88-
/* we will unbind on next submission, still have userptr pins */
89-
r = dma_resv_wait_timeout(obj->base.resv, DMA_RESV_USAGE_BOOKKEEP, false,
90-
MAX_SCHEDULE_TIMEOUT);
91-
if (r <= 0)
92-
drm_err(&i915->drm, "(%ld) failed to wait for idle\n", r);
93-
9464
return true;
9565
}
9666

@@ -580,15 +550,3 @@ i915_gem_userptr_ioctl(struct drm_device *dev,
580550
#endif
581551
}
582552

583-
int i915_gem_init_userptr(struct drm_i915_private *dev_priv)
584-
{
585-
#ifdef CONFIG_MMU_NOTIFIER
586-
rwlock_init(&dev_priv->mm.notifier_lock);
587-
#endif
588-
589-
return 0;
590-
}
591-
592-
void i915_gem_cleanup_userptr(struct drm_i915_private *dev_priv)
593-
{
594-
}

drivers/gpu/drm/i915/gem/i915_gem_userptr.h

Lines changed: 0 additions & 14 deletions
This file was deleted.

drivers/gpu/drm/i915/gt/gen8_engine_cs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ u32 *gen12_emit_aux_table_inv(struct intel_engine_cs *engine, u32 *cs)
226226
static int mtl_dummy_pipe_control(struct i915_request *rq)
227227
{
228228
/* Wa_14016712196 */
229-
if (IS_GFX_GT_IP_RANGE(rq->engine->gt, IP_VER(12, 70), IP_VER(12, 71)) ||
229+
if (IS_GFX_GT_IP_RANGE(rq->engine->gt, IP_VER(12, 70), IP_VER(12, 74)) ||
230230
IS_DG2(rq->i915)) {
231231
u32 *cs;
232232

@@ -822,7 +822,7 @@ u32 *gen12_emit_fini_breadcrumb_rcs(struct i915_request *rq, u32 *cs)
822822
flags |= PIPE_CONTROL_FLUSH_L3;
823823

824824
/* Wa_14016712196 */
825-
if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 71)) || IS_DG2(i915))
825+
if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 74)) || IS_DG2(i915))
826826
/* dummy PIPE_CONTROL + depth flush */
827827
cs = gen12_emit_pipe_control(cs, 0,
828828
PIPE_CONTROL_DEPTH_CACHE_FLUSH, 0);

drivers/gpu/drm/i915/gt/intel_engine_cs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,8 @@ static int intel_engine_init_tlb_invalidation(struct intel_engine_cs *engine)
11901190
num = ARRAY_SIZE(xelpmp_regs);
11911191
}
11921192
} else {
1193-
if (GRAPHICS_VER_FULL(i915) == IP_VER(12, 71) ||
1193+
if (GRAPHICS_VER_FULL(i915) == IP_VER(12, 74) ||
1194+
GRAPHICS_VER_FULL(i915) == IP_VER(12, 71) ||
11941195
GRAPHICS_VER_FULL(i915) == IP_VER(12, 70) ||
11951196
GRAPHICS_VER_FULL(i915) == IP_VER(12, 50) ||
11961197
GRAPHICS_VER_FULL(i915) == IP_VER(12, 55)) {

drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,9 @@ static int __intel_engine_pulse(struct intel_engine_cs *engine)
290290
heartbeat_commit(rq, &attr);
291291
GEM_BUG_ON(rq->sched.attr.priority < I915_PRIORITY_BARRIER);
292292

293+
/* Ensure the forced pulse gets a full period to execute */
294+
next_heartbeat(engine);
295+
293296
return 0;
294297
}
295298

drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -176,27 +176,13 @@ static u32 get_residency(struct intel_gt *gt, enum intel_rc6_res_type id)
176176
return DIV_ROUND_CLOSEST_ULL(res, 1000);
177177
}
178178

179-
static u8 get_rc6_mask(struct intel_gt *gt)
180-
{
181-
u8 mask = 0;
182-
183-
if (HAS_RC6(gt->i915))
184-
mask |= BIT(0);
185-
if (HAS_RC6p(gt->i915))
186-
mask |= BIT(1);
187-
if (HAS_RC6pp(gt->i915))
188-
mask |= BIT(2);
189-
190-
return mask;
191-
}
192-
193179
static ssize_t rc6_enable_show(struct kobject *kobj,
194180
struct kobj_attribute *attr,
195181
char *buff)
196182
{
197183
struct intel_gt *gt = intel_gt_sysfs_get_drvdata(kobj, attr->attr.name);
198184

199-
return sysfs_emit(buff, "%x\n", get_rc6_mask(gt));
185+
return sysfs_emit(buff, "%x\n", gt->rc6.enabled);
200186
}
201187

202188
static ssize_t rc6_enable_dev_show(struct device *dev,
@@ -205,7 +191,7 @@ static ssize_t rc6_enable_dev_show(struct device *dev,
205191
{
206192
struct intel_gt *gt = intel_gt_sysfs_get_drvdata(&dev->kobj, attr->attr.name);
207193

208-
return sysfs_emit(buff, "%x\n", get_rc6_mask(gt));
194+
return sysfs_emit(buff, "%x\n", gt->rc6.enabled);
209195
}
210196

211197
static u32 __rc6_residency_ms_show(struct intel_gt *gt)

drivers/gpu/drm/i915/gt/intel_mocs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ static unsigned int get_mocs_settings(struct drm_i915_private *i915,
495495
memset(table, 0, sizeof(struct drm_i915_mocs_table));
496496

497497
table->unused_entries_index = I915_MOCS_PTE;
498-
if (IS_GFX_GT_IP_RANGE(to_gt(i915), IP_VER(12, 70), IP_VER(12, 71))) {
498+
if (IS_GFX_GT_IP_RANGE(to_gt(i915), IP_VER(12, 70), IP_VER(12, 74))) {
499499
table->size = ARRAY_SIZE(mtl_mocs_table);
500500
table->table = mtl_mocs_table;
501501
table->n_entries = MTL_NUM_MOCS_ENTRIES;

drivers/gpu/drm/i915/gt/intel_rc6.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ static void gen11_rc6_enable(struct intel_rc6 *rc6)
123123
* temporary wa and should be removed after fixing real cause
124124
* of forcewake timeouts.
125125
*/
126-
if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 71)))
126+
if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 74)))
127127
pg_enable =
128128
GEN9_MEDIA_PG_ENABLE |
129129
GEN11_MEDIA_SAMPLER_PG_ENABLE;

0 commit comments

Comments
 (0)