Skip to content

Commit d9aa1da

Browse files
committed
Merge tag 'drm-intel-gt-next-2023-08-04' of git://anongit.freedesktop.org/drm/drm-intel into drm-next
Driver Changes: - Avoid infinite GPU waits by avoidin premature release of request's reusable memory (Chris, Janusz) - Expose RPS thresholds in sysfs (Tvrtko) - Apply GuC SLPC min frequency softlimit correctly (Vinay) - Restore SLPC efficient freq earlier (Vinay) - Consider OA buffer boundary when zeroing out reports (Umesh) - Extend Wa_14015795083 to TGL, RKL, DG1 and ADL (Matt R) - Fix context workarounds with non-masked regs on MTL/DG2 (Lucas) - Enable the CCS_FLUSH bit in the pipe control and in the CS for MTL+ (Andi) - Update MTL workarounds 14018778641, 22016122933 (Tejas, Zhanjun) - Ensure memory quiesced before AUX CCS invalidation (Jonathan) - Add a gsc_info debugfs (Daniele) - Invalidate the TLBs on each GT on multi-GT device (Chris) - Fix a VMA UAF for multi-gt platform (Nirmoy) - Do not use stolen on MTL due to HW bug (Nirmoy) - Check HuC and GuC version compatibility on MTL (Daniele) - Dump perf_limit_reasons for slow GuC init debug (Vinay) - Replace kmap() with kmap_local_page() (Sumitra, Ira) - Add sentinel to xehp_oa_b_counters for KASAN (Andrzej) - Add the gen12_needs_ccs_aux_inv helper (Andi) - Fixes and updates for GSC memory allocation (Daniele) - Fix one wrong caching mode enum usage (Tvrtko) - Fixes for GSC wakeref (Alan) - Static checker fixes (Harshit, Arnd, Dan, Cristophe, David, Andi) - Rename flags with bit_group_X according to the datasheet (Andi) - Use direct alias for i915 in requests (Andrzej) - Replace i915->gt0 with to_gt(i915) (Andi) - Use the i915_vma_flush_writes helper (Tvrtko) - Selftest improvements (Alan) - Remove dead code (Tvrtko) Signed-off-by: Dave Airlie <[email protected]> # Conflicts: # drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c From: Joonas Lahtinen <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 7c9aa0f + 28e6711 commit d9aa1da

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1529
-531
lines changed

drivers/gpu/drm/i915/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ gt-y += \
132132
gt/intel_sseu.o \
133133
gt/intel_sseu_debugfs.o \
134134
gt/intel_timeline.o \
135+
gt/intel_tlb.o \
135136
gt/intel_wopcm.o \
136137
gt/intel_workarounds.o \
137138
gt/shmem_utils.o \
@@ -197,7 +198,8 @@ i915-y += \
197198
gt/uc/intel_gsc_fw.o \
198199
gt/uc/intel_gsc_proxy.o \
199200
gt/uc/intel_gsc_uc.o \
200-
gt/uc/intel_gsc_uc_heci_cmd_submit.o\
201+
gt/uc/intel_gsc_uc_debugfs.o \
202+
gt/uc/intel_gsc_uc_heci_cmd_submit.o \
201203
gt/uc/intel_guc.o \
202204
gt/uc/intel_guc_ads.o \
203205
gt/uc/intel_guc_capture.o \

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,8 @@ flush_write_domain(struct drm_i915_gem_object *obj, unsigned int flush_domains)
6868
switch (obj->write_domain) {
6969
case I915_GEM_DOMAIN_GTT:
7070
spin_lock(&obj->vma.lock);
71-
for_each_ggtt_vma(vma, obj) {
72-
if (i915_vma_unset_ggtt_write(vma))
73-
intel_gt_flush_ggtt_writes(vma->vm->gt);
74-
}
71+
for_each_ggtt_vma(vma, obj)
72+
i915_vma_flush_writes(vma);
7573
spin_unlock(&obj->vma.lock);
7674

7775
i915_gem_object_flush_frontbuffer(obj, ORIGIN_CPU);

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

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2229,8 +2229,8 @@ static int i915_reset_gen7_sol_offsets(struct i915_request *rq)
22292229
u32 *cs;
22302230
int i;
22312231

2232-
if (GRAPHICS_VER(rq->engine->i915) != 7 || rq->engine->id != RCS0) {
2233-
drm_dbg(&rq->engine->i915->drm, "sol reset is gen7/rcs only\n");
2232+
if (GRAPHICS_VER(rq->i915) != 7 || rq->engine->id != RCS0) {
2233+
drm_dbg(&rq->i915->drm, "sol reset is gen7/rcs only\n");
22342234
return -EINVAL;
22352235
}
22362236

@@ -2691,6 +2691,7 @@ static int
26912691
eb_select_engine(struct i915_execbuffer *eb)
26922692
{
26932693
struct intel_context *ce, *child;
2694+
struct intel_gt *gt;
26942695
unsigned int idx;
26952696
int err;
26962697

@@ -2714,10 +2715,17 @@ eb_select_engine(struct i915_execbuffer *eb)
27142715
}
27152716
}
27162717
eb->num_batches = ce->parallel.number_children + 1;
2718+
gt = ce->engine->gt;
27172719

27182720
for_each_child(ce, child)
27192721
intel_context_get(child);
2720-
intel_gt_pm_get(ce->engine->gt);
2722+
intel_gt_pm_get(gt);
2723+
/*
2724+
* Keep GT0 active on MTL so that i915_vma_parked() doesn't
2725+
* free VMAs while execbuf ioctl is validating VMAs.
2726+
*/
2727+
if (gt->info.id)
2728+
intel_gt_pm_get(to_gt(gt->i915));
27212729

27222730
if (!test_bit(CONTEXT_ALLOC_BIT, &ce->flags)) {
27232731
err = intel_context_alloc_state(ce);
@@ -2756,7 +2764,10 @@ eb_select_engine(struct i915_execbuffer *eb)
27562764
return err;
27572765

27582766
err:
2759-
intel_gt_pm_put(ce->engine->gt);
2767+
if (gt->info.id)
2768+
intel_gt_pm_put(to_gt(gt->i915));
2769+
2770+
intel_gt_pm_put(gt);
27602771
for_each_child(ce, child)
27612772
intel_context_put(child);
27622773
intel_context_put(ce);
@@ -2769,6 +2780,12 @@ eb_put_engine(struct i915_execbuffer *eb)
27692780
struct intel_context *child;
27702781

27712782
i915_vm_put(eb->context->vm);
2783+
/*
2784+
* This works in conjunction with eb_select_engine() to prevent
2785+
* i915_vma_parked() from interfering while execbuf validates vmas.
2786+
*/
2787+
if (eb->gt->info.id)
2788+
intel_gt_pm_put(to_gt(eb->gt->i915));
27722789
intel_gt_pm_put(eb->gt);
27732790
for_each_child(eb->context, child)
27742791
intel_context_put(child);

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include "i915_selftest.h"
1818
#include "i915_vma_resource.h"
1919

20+
#include "gt/intel_gt_defines.h"
21+
2022
struct drm_i915_gem_object;
2123
struct intel_fronbuffer;
2224
struct intel_memory_region;
@@ -675,7 +677,7 @@ struct drm_i915_gem_object {
675677
*/
676678
bool dirty:1;
677679

678-
u32 tlb;
680+
u32 tlb[I915_MAX_GT];
679681
} mm;
680682

681683
struct {

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <drm/drm_cache.h>
88

99
#include "gt/intel_gt.h"
10-
#include "gt/intel_gt_pm.h"
10+
#include "gt/intel_tlb.h"
1111

1212
#include "i915_drv.h"
1313
#include "i915_gem_object.h"
@@ -193,13 +193,16 @@ static void unmap_object(struct drm_i915_gem_object *obj, void *ptr)
193193
static void flush_tlb_invalidate(struct drm_i915_gem_object *obj)
194194
{
195195
struct drm_i915_private *i915 = to_i915(obj->base.dev);
196-
struct intel_gt *gt = to_gt(i915);
196+
struct intel_gt *gt;
197+
int id;
197198

198-
if (!obj->mm.tlb)
199-
return;
199+
for_each_gt(gt, i915, id) {
200+
if (!obj->mm.tlb[id])
201+
return;
200202

201-
intel_gt_invalidate_tlb(gt, obj->mm.tlb);
202-
obj->mm.tlb = 0;
203+
intel_gt_invalidate_tlb_full(gt, obj->mm.tlb[id]);
204+
obj->mm.tlb[id] = 0;
205+
}
203206
}
204207

205208
struct sg_table *

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ i915_gem_stolen_lmem_setup(struct drm_i915_private *i915, u16 type,
892892
} else {
893893
resource_size_t lmem_range;
894894

895-
lmem_range = intel_gt_mcr_read_any(&i915->gt0, XEHP_TILE0_ADDR_RANGE) & 0xFFFF;
895+
lmem_range = intel_gt_mcr_read_any(to_gt(i915), XEHP_TILE0_ADDR_RANGE) & 0xFFFF;
896896
lmem_size = lmem_range >> XEHP_TILE_LMEM_RANGE_SHIFT;
897897
lmem_size *= SZ_1G;
898898
}

drivers/gpu/drm/i915/gem/selftests/huge_pages.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,8 +1246,10 @@ static int igt_write_huge(struct drm_i915_private *i915,
12461246
* times in succession a possibility by enlarging the permutation array.
12471247
*/
12481248
order = i915_random_order(count * count, &prng);
1249-
if (!order)
1250-
return -ENOMEM;
1249+
if (!order) {
1250+
err = -ENOMEM;
1251+
goto out;
1252+
}
12511253

12521254
max_page_size = rounddown_pow_of_two(obj->mm.page_sizes.sg);
12531255
max = div_u64(max - size, max_page_size);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ int gen4_emit_flush_rcs(struct i915_request *rq, u32 mode)
7676
cmd = MI_FLUSH;
7777
if (mode & EMIT_INVALIDATE) {
7878
cmd |= MI_EXE_FLUSH;
79-
if (IS_G4X(rq->engine->i915) || GRAPHICS_VER(rq->engine->i915) == 5)
79+
if (IS_G4X(rq->i915) || GRAPHICS_VER(rq->i915) == 5)
8080
cmd |= MI_INVALIDATE_ISP;
8181
}
8282

0 commit comments

Comments
 (0)