Skip to content

Commit 211b4db

Browse files
committed
Merge tag 'drm-intel-gt-next-2021-12-09' of git://anongit.freedesktop.org/drm/drm-intel into drm-next
Core Changes: - Fix PENDING_ERROR leak in dma_fence_array_signaled() (Thomas Hellström) Driver Changes: - Fix runtime PM handling during PXP suspend (Tejas Upadhyay) - Improve eviction performance on discrete by implementing async TTM moves (Thomas Hellström, Maarten Lankhorst) - Improve robustness of error capture under memory pressure (Thomas Hellström) - Fix GuC PMU versus GPU reset handling (Umesh Nerlige Ramappa) - Use per device iommu check (Tvrtko Ursulin) - Make error capture work with async migration (Thomas Hellström) - Revert incorrect implementation of Wa_1508744258 causing hangs (José Roberto de Souza) - Disable coarse power gating on some DG2 steppings workaround (Matt Roper) - Add IC cache invalidation workaround on DG2 (Ramalingam C) - Move two Icelake workarounds to the right place (Raviteja Goud Talla) - Fix error pointer dereference in i915_gem_do_execbuffer() (Dan Carpenter) - Fixup a couple of generic and DG2 specific issues in migration code (Matthew Auld) - Fix kernel-doc warnings in i915_drm_object.c (Randy Dunlap) - Drop stealing of bits from i915_sw_fence function pointer (Matthew Brost) - Introduce new macros for i915 PTE (Michael Cheng) - Prep work for engine reset by reset domain lookup (Tejas Upadhyay) - Fixup drm-intel-gt-next build failure (Matthew Auld) - Fix live_engine_busy_stats selftests in GuC mode (Umesh Nerlige Ramappa) - Remove dma_resv_prune (Maarten Lankhorst) - Preserve huge pages enablement after driver reload (Matthew Auld) - Fix a NULL pointer dereference in igt_request_rewind() (selftests) (Zhou Qingyang) - Add workaround numbers to GEN7_COMMON_SLICE_CHICKEN1 whitelisting (José Roberto de Souza) - Increase timeouts in i915_gem_contexts selftests to handle GuC being slower (Bruce Chang) Signed-off-by: Dave Airlie <[email protected]> # Conflicts: # drivers/gpu/drm/i915/display/intel_fbc.c From: Tvrtko Ursulin <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/YbIBOeqhn+nPzaYD@tursulin-mobl2
2 parents 15bb799 + 20cddfc commit 211b4db

File tree

112 files changed

+4609
-1355
lines changed

Some content is hidden

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

112 files changed

+4609
-1355
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9496,6 +9496,7 @@ INTEL DRM DRIVERS (excluding Poulsbo, Moorestown and derivative chipsets)
94969496
M: Jani Nikula <[email protected]>
94979497
M: Joonas Lahtinen <[email protected]>
94989498
M: Rodrigo Vivi <[email protected]>
9499+
M: Tvrtko Ursulin <[email protected]>
94999500
95009501
S: Supported
95019502
W: https://01.org/linuxgraphics/

drivers/dma-buf/dma-fence-array.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,11 @@ static bool dma_fence_array_signaled(struct dma_fence *fence)
104104
{
105105
struct dma_fence_array *array = to_dma_fence_array(fence);
106106

107-
return atomic_read(&array->num_pending) <= 0;
107+
if (atomic_read(&array->num_pending) > 0)
108+
return false;
109+
110+
dma_fence_array_clear_pending_error(array);
111+
return true;
108112
}
109113

110114
static void dma_fence_array_release(struct dma_fence *fence)

drivers/gpu/drm/i915/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ gem-y += \
153153
gem/i915_gem_throttle.o \
154154
gem/i915_gem_tiling.o \
155155
gem/i915_gem_ttm.o \
156+
gem/i915_gem_ttm_move.o \
156157
gem/i915_gem_ttm_pm.o \
157158
gem/i915_gem_userptr.o \
158159
gem/i915_gem_wait.o \
@@ -172,6 +173,7 @@ i915-y += \
172173
i915_trace_points.o \
173174
i915_ttm_buddy_manager.o \
174175
i915_vma.o \
176+
i915_vma_snapshot.o \
175177
intel_wopcm.o
176178

177179
# general-purpose microcontroller (GuC) support

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ static unsigned int intel_bw_data_rate(struct drm_i915_private *dev_priv,
634634
for_each_pipe(dev_priv, pipe)
635635
data_rate += bw_state->data_rate[pipe];
636636

637-
if (DISPLAY_VER(dev_priv) >= 13 && intel_vtd_active())
637+
if (DISPLAY_VER(dev_priv) >= 13 && intel_vtd_active(dev_priv))
638638
data_rate = data_rate * 105 / 100;
639639

640640
return data_rate;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,7 +1293,7 @@ static bool needs_async_flip_vtd_wa(const struct intel_crtc_state *crtc_state)
12931293
{
12941294
struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev);
12951295

1296-
return crtc_state->uapi.async_flip && intel_vtd_active() &&
1296+
return crtc_state->uapi.async_flip && intel_vtd_active(i915) &&
12971297
(DISPLAY_VER(i915) == 9 || IS_BROADWELL(i915) || IS_HASWELL(i915));
12981298
}
12991299

@@ -8815,7 +8815,7 @@ static void intel_atomic_commit_work(struct work_struct *work)
88158815
intel_atomic_commit_tail(state);
88168816
}
88178817

8818-
static int __i915_sw_fence_call
8818+
static int
88198819
intel_atomic_commit_ready(struct i915_sw_fence *fence,
88208820
enum i915_sw_fence_notify notify)
88218821
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1677,7 +1677,7 @@ static int intel_sanitize_fbc_option(struct drm_i915_private *i915)
16771677
static bool need_fbc_vtd_wa(struct drm_i915_private *i915)
16781678
{
16791679
/* WaFbcTurnOffFbcWhenHyperVisorIsUsed:skl,bxt */
1680-
if (intel_vtd_active() &&
1680+
if (intel_vtd_active(i915) &&
16811681
(IS_SKYLAKE(i915) || IS_BROXTON(i915))) {
16821682
drm_info(&i915->drm,
16831683
"Disabling framebuffer compression (FBC) to prevent screen flicker with VT-d enabled\n");

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

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,16 @@ static struct clflush *clflush_work_create(struct drm_i915_gem_object *obj)
6969
bool i915_gem_clflush_object(struct drm_i915_gem_object *obj,
7070
unsigned int flags)
7171
{
72+
struct drm_i915_private *i915 = to_i915(obj->base.dev);
7273
struct clflush *clflush;
7374

7475
assert_object_held(obj);
7576

77+
if (IS_DGFX(i915)) {
78+
WARN_ON_ONCE(obj->cache_dirty);
79+
return false;
80+
}
81+
7682
/*
7783
* Stolen memory is always coherent with the GPU as it is explicitly
7884
* marked as wc by the system, or the system is cache-coherent.
@@ -105,16 +111,24 @@ bool i915_gem_clflush_object(struct drm_i915_gem_object *obj,
105111
if (clflush) {
106112
i915_sw_fence_await_reservation(&clflush->base.chain,
107113
obj->base.resv, NULL, true,
108-
i915_fence_timeout(to_i915(obj->base.dev)),
114+
i915_fence_timeout(i915),
109115
I915_FENCE_GFP);
110116
dma_resv_add_excl_fence(obj->base.resv, &clflush->base.dma);
111117
dma_fence_work_commit(&clflush->base);
118+
/*
119+
* We must have successfully populated the pages(since we are
120+
* holding a pin on the pages as per the flush worker) to reach
121+
* this point, which must mean we have already done the required
122+
* flush-on-acquire, hence resetting cache_dirty here should be
123+
* safe.
124+
*/
125+
obj->cache_dirty = false;
112126
} else if (obj->mm.pages) {
113127
__do_clflush(obj);
128+
obj->cache_dirty = false;
114129
} else {
115130
GEM_BUG_ON(obj->write_domain != I915_GEM_DOMAIN_CPU);
116131
}
117132

118-
obj->cache_dirty = false;
119133
return true;
120134
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ static void free_engines_rcu(struct rcu_head *rcu)
10011001
free_engines(engines);
10021002
}
10031003

1004-
static int __i915_sw_fence_call
1004+
static int
10051005
engines_notify(struct i915_sw_fence *fence, enum i915_sw_fence_notify state)
10061006
{
10071007
struct i915_gem_engines *engines =

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,19 @@ static int i915_gem_object_get_pages_dmabuf(struct drm_i915_gem_object *obj)
248248
if (IS_ERR(pages))
249249
return PTR_ERR(pages);
250250

251-
/* XXX: consider doing a vmap flush or something */
252-
if (!HAS_LLC(i915) || i915_gem_object_can_bypass_llc(obj))
251+
/*
252+
* DG1 is special here since it still snoops transactions even with
253+
* CACHE_NONE. This is not the case with other HAS_SNOOP platforms. We
254+
* might need to revisit this as we add new discrete platforms.
255+
*
256+
* XXX: Consider doing a vmap flush or something, where possible.
257+
* Currently we just do a heavy handed wbinvd_on_all_cpus() here since
258+
* the underlying sg_table might not even point to struct pages, so we
259+
* can't just call drm_clflush_sg or similar, like we do elsewhere in
260+
* the driver.
261+
*/
262+
if (i915_gem_object_can_bypass_llc(obj) ||
263+
(!HAS_LLC(i915) && !IS_DG1(i915)))
253264
wbinvd_on_all_cpus();
254265

255266
sg_page_sizes = i915_sg_dma_sizes(pages->sgl);

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,32 @@
1818

1919
static bool gpu_write_needs_clflush(struct drm_i915_gem_object *obj)
2020
{
21+
struct drm_i915_private *i915 = to_i915(obj->base.dev);
22+
23+
if (IS_DGFX(i915))
24+
return false;
25+
2126
return !(obj->cache_level == I915_CACHE_NONE ||
2227
obj->cache_level == I915_CACHE_WT);
2328
}
2429

30+
bool i915_gem_cpu_write_needs_clflush(struct drm_i915_gem_object *obj)
31+
{
32+
struct drm_i915_private *i915 = to_i915(obj->base.dev);
33+
34+
if (obj->cache_dirty)
35+
return false;
36+
37+
if (!(obj->cache_coherent & I915_BO_CACHE_COHERENT_FOR_WRITE))
38+
return true;
39+
40+
if (IS_DGFX(i915))
41+
return false;
42+
43+
/* Currently in use by HW (display engine)? Keep flushed. */
44+
return i915_gem_object_is_framebuffer(obj);
45+
}
46+
2547
static void
2648
flush_write_domain(struct drm_i915_gem_object *obj, unsigned int flush_domains)
2749
{

0 commit comments

Comments
 (0)