Skip to content

Commit 2ab82ef

Browse files
committed
Merge tag 'drm-intel-gt-next-2022-03-03' of git://anongit.freedesktop.org/drm/drm-intel into drm-next
Cross-subsystem Changes: - drm-next backmerge for buddy allocator changes Driver Changes: - Skip i915_perf init for DG2 as it is not yet enabled (Ram) - Add missing workarounds for DG2 (Clint) - Add 64K page/align support for platforms like DG2 that require it (Matt A, Ram, Bob) - Add accelerated migration support for DG2 (Matt A) - Add flat CCS support for XeHP SDV (Abdiel, Ram) - Add Compute Command Streamer (CCS) engine support for XeHP SDV (Michel, Daniele, Aravind, Matt R) - Don't support parallel submission on compute / render (Matt B, Matt R) - Disable i915 build on PREEMPT_RT until RT behaviour fixed (Sebastian) - Remove RPS interrupt support for TGL+ (Jose) - Fix S/R with PM_EARLY for non-GTT mappable objects on DG2 (Matt, Lucas) - Skip stolen memory init if it is fully reserved (Jose) - Use iosys_map for GuC data structures that may be in LMEM BAR or SMEM (Lucas) - Do not complain about stale GuC reset notifications for banned contexts (John) - Move context descriptor fields to intel_lrc.h - Start adding support for small BAR (Matt A) - Clarify vma lifetime (Thomas) - Simplify subplatform detection on TGL (Jose) - Correct the param count for unset GuC SLPC param (Vinay, Umesh) - Read RP_STATE_CAP correctly on Gen12 with GuC SLPC (Vinay) - Initialize GuC submission locks and queues early (Daniele) - Fix GuC flag query helper function to not modify state (John) - Drop fake lmem support now we have real hardware available (Lucas) - Move misplaced W/A to their correct locations (Srinivasan) - Use get_reset_domain() helper (Tejas) - Move context descriptor fields to intel_lrc.h (Matt R) - Selftest improvements (Matt A) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/YiBzY1dM7bKwMQ3H@jlahtine-mobl.ger.corp.intel.com
2 parents c9e9ce0 + b200606 commit 2ab82ef

71 files changed

Lines changed: 2318 additions & 627 deletions

Some content is hidden

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

drivers/gpu/drm/i915/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ config DRM_I915
33
tristate "Intel 8xx/9xx/G3x/G4x/HD Graphics"
44
depends on DRM
55
depends on X86 && PCI
6+
depends on !PREEMPT_RT
67
select INTEL_GTT
78
select INTERVAL_TREE
89
# we need shmfs for the swappable backing store, and in particular

drivers/gpu/drm/i915/Kconfig.unstable

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,3 @@ config DRM_I915_UNSTABLE
1919
Recommended for driver developers _only_.
2020

2121
If in the slightest bit of doubt, say "N".
22-
23-
config DRM_I915_UNSTABLE_FAKE_LMEM
24-
bool "Enable the experimental fake lmem"
25-
depends on DRM_I915_UNSTABLE
26-
default n
27-
help
28-
Convert some system memory into a fake local memory region for
29-
testing.

drivers/gpu/drm/i915/display/intel_ddi_buf_trans.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1321,7 +1321,7 @@ tgl_get_combo_buf_trans_dp(struct intel_encoder *encoder,
13211321
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
13221322

13231323
if (crtc_state->port_clock > 270000) {
1324-
if (IS_TGL_U(dev_priv) || IS_TGL_Y(dev_priv)) {
1324+
if (IS_TGL_UY(dev_priv)) {
13251325
return intel_get_buf_trans(&tgl_uy_combo_phy_trans_dp_hbr2,
13261326
n_entries);
13271327
} else {

drivers/gpu/drm/i915/display/intel_fbdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
265265
struct intel_memory_region *mem = obj->mm.region;
266266

267267
info->apertures->ranges[0].base = mem->io_start;
268-
info->apertures->ranges[0].size = mem->total;
268+
info->apertures->ranges[0].size = mem->io_size;
269269

270270
/* Use fbdev's framebuffer from lmem for discrete */
271271
info->fix.smem_start =

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,16 @@ set_proto_ctx_engines_parallel_submit(struct i915_user_extension __user *base,
670670
goto out_err;
671671
}
672672

673+
/*
674+
* We don't support breadcrumb handshake on these
675+
* classes
676+
*/
677+
if (siblings[n]->class == RENDER_CLASS ||
678+
siblings[n]->class == COMPUTE_CLASS) {
679+
err = -EINVAL;
680+
goto out_err;
681+
}
682+
673683
if (n) {
674684
if (prev_engine.engine_class !=
675685
ci.engine_class) {

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

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -272,26 +272,14 @@ void __i915_gem_object_pages_fini(struct drm_i915_gem_object *obj)
272272
if (!list_empty(&obj->vma.list)) {
273273
struct i915_vma *vma;
274274

275-
/*
276-
* Note that the vma keeps an object reference while
277-
* it is active, so it *should* not sleep while we
278-
* destroy it. Our debug code errs insits it *might*.
279-
* For the moment, play along.
280-
*/
281275
spin_lock(&obj->vma.lock);
282276
while ((vma = list_first_entry_or_null(&obj->vma.list,
283277
struct i915_vma,
284278
obj_link))) {
285279
GEM_BUG_ON(vma->obj != obj);
286280
spin_unlock(&obj->vma.lock);
287281

288-
/* Verify that the vma is unbound under the vm mutex. */
289-
mutex_lock(&vma->vm->mutex);
290-
atomic_and(~I915_VMA_PIN_MASK, &vma->flags);
291-
__i915_vma_unbind(vma);
292-
mutex_unlock(&vma->vm->mutex);
293-
294-
__i915_vma_put(vma);
282+
i915_vma_destroy(vma);
295283

296284
spin_lock(&obj->vma.lock);
297285
}

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,16 +319,23 @@ struct drm_i915_gem_object {
319319
#define I915_BO_ALLOC_PM_VOLATILE BIT(4)
320320
/* Object needs to be restored early using memcpy during resume */
321321
#define I915_BO_ALLOC_PM_EARLY BIT(5)
322+
/*
323+
* Object is likely never accessed by the CPU. This will prioritise the BO to be
324+
* allocated in the non-mappable portion of lmem. This is merely a hint, and if
325+
* dealing with userspace objects the CPU fault handler is free to ignore this.
326+
*/
327+
#define I915_BO_ALLOC_GPU_ONLY BIT(6)
322328
#define I915_BO_ALLOC_FLAGS (I915_BO_ALLOC_CONTIGUOUS | \
323329
I915_BO_ALLOC_VOLATILE | \
324330
I915_BO_ALLOC_CPU_CLEAR | \
325331
I915_BO_ALLOC_USER | \
326332
I915_BO_ALLOC_PM_VOLATILE | \
327-
I915_BO_ALLOC_PM_EARLY)
328-
#define I915_BO_READONLY BIT(6)
329-
#define I915_TILING_QUIRK_BIT 7 /* unknown swizzling; do not release! */
330-
#define I915_BO_PROTECTED BIT(8)
331-
#define I915_BO_WAS_BOUND_BIT 9
333+
I915_BO_ALLOC_PM_EARLY | \
334+
I915_BO_ALLOC_GPU_ONLY)
335+
#define I915_BO_READONLY BIT(7)
336+
#define I915_TILING_QUIRK_BIT 8 /* unknown swizzling; do not release! */
337+
#define I915_BO_PROTECTED BIT(9)
338+
#define I915_BO_WAS_BOUND_BIT 10
332339
/**
333340
* @mem_flags - Mutable placement-related flags
334341
*

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,9 @@ void *i915_gem_object_pin_map(struct drm_i915_gem_object *obj,
358358
!i915_gem_object_has_iomem(obj))
359359
return ERR_PTR(-ENXIO);
360360

361+
if (WARN_ON_ONCE(obj->flags & I915_BO_ALLOC_GPU_ONLY))
362+
return ERR_PTR(-EINVAL);
363+
361364
assert_object_held(obj);
362365

363366
pinned = !(type & I915_MAP_OVERRIDE);

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ i915_gem_object_create_region(struct intel_memory_region *mem,
4545

4646
GEM_BUG_ON(flags & ~I915_BO_ALLOC_FLAGS);
4747

48+
if (WARN_ON_ONCE(flags & I915_BO_ALLOC_GPU_ONLY &&
49+
(flags & I915_BO_ALLOC_CPU_CLEAR ||
50+
flags & I915_BO_ALLOC_PM_EARLY)))
51+
return ERR_PTR(-EINVAL);
52+
4853
if (!mem)
4954
return ERR_PTR(-ENODEV);
5055

@@ -67,6 +72,17 @@ i915_gem_object_create_region(struct intel_memory_region *mem,
6772
if (!obj)
6873
return ERR_PTR(-ENOMEM);
6974

75+
/*
76+
* Anything smaller than the min_page_size can't be freely inserted into
77+
* the GTT, due to alignemnt restrictions. For such special objects,
78+
* make sure we force memcpy based suspend-resume. In the future we can
79+
* revisit this, either by allowing special mis-aligned objects in the
80+
* migration path, or by mapping all of LMEM upfront using cheap 1G
81+
* GTT entries.
82+
*/
83+
if (default_page_size < mem->min_page_size)
84+
flags |= I915_BO_ALLOC_PM_EARLY;
85+
7086
err = mem->ops->init_object(mem, obj, size, page_size, flags);
7187
if (err)
7288
goto err_object_free;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ struct intel_memory_region *i915_gem_shmem_setup(struct drm_i915_private *i915,
699699
{
700700
return intel_memory_region_create(i915, 0,
701701
totalram_pages() << PAGE_SHIFT,
702-
PAGE_SIZE, 0,
702+
PAGE_SIZE, 0, 0,
703703
type, instance,
704704
&shmem_region_ops);
705705
}

0 commit comments

Comments
 (0)