Skip to content

Commit de2df16

Browse files
committed
Merge tag 'drm-intel-fixes-2020-12-09' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
Fixes for VDSC/DP, selftests, shmem_utils, preemption, submission, and gt reset: - Check the correct variable in selftest (Dan) - Propagate error from canceled submit due to context closure (Chris) - Ignore repeated attempts to suspend request flow across reset (Chris) - Cancel the preemption timeout on responding to it (Chris) - Fix unsigned compared against 0 (Colin) - Compute the correct slice count for VDSC on DP (Manasi) - Declar gen9 has 64 mocs entries (Chris) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20201209235010.GA10554@intel.com
2 parents a81ac29 + 7c5c15d commit de2df16

6 files changed

Lines changed: 18 additions & 11 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ static u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp,
573573
return 0;
574574
}
575575
/* Also take into account max slice width */
576-
min_slice_count = min_t(u8, min_slice_count,
576+
min_slice_count = max_t(u8, min_slice_count,
577577
DIV_ROUND_UP(mode_hdisplay,
578578
max_slice_width));
579579

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3097,7 +3097,7 @@ static void retire_requests(struct intel_timeline *tl, struct i915_request *end)
30973097
break;
30983098
}
30993099

3100-
static void eb_request_add(struct i915_execbuffer *eb)
3100+
static int eb_request_add(struct i915_execbuffer *eb, int err)
31013101
{
31023102
struct i915_request *rq = eb->request;
31033103
struct intel_timeline * const tl = i915_request_timeline(rq);
@@ -3118,6 +3118,7 @@ static void eb_request_add(struct i915_execbuffer *eb)
31183118
/* Serialise with context_close via the add_to_timeline */
31193119
i915_request_set_error_once(rq, -ENOENT);
31203120
__i915_request_skip(rq);
3121+
err = -ENOENT; /* override any transient errors */
31213122
}
31223123

31233124
__i915_request_queue(rq, &attr);
@@ -3127,6 +3128,8 @@ static void eb_request_add(struct i915_execbuffer *eb)
31273128
retire_requests(tl, prev);
31283129

31293130
mutex_unlock(&tl->mutex);
3131+
3132+
return err;
31303133
}
31313134

31323135
static const i915_user_extension_fn execbuf_extensions[] = {
@@ -3332,7 +3335,7 @@ i915_gem_do_execbuffer(struct drm_device *dev,
33323335
err = eb_submit(&eb, batch);
33333336
err_request:
33343337
i915_request_get(eb.request);
3335-
eb_request_add(&eb);
3338+
err = eb_request_add(&eb, err);
33363339

33373340
if (eb.fences)
33383341
signal_fence_array(&eb);

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2788,6 +2788,9 @@ static void __execlists_hold(struct i915_request *rq)
27882788
static bool execlists_hold(struct intel_engine_cs *engine,
27892789
struct i915_request *rq)
27902790
{
2791+
if (i915_request_on_hold(rq))
2792+
return false;
2793+
27912794
spin_lock_irq(&engine->active.lock);
27922795

27932796
if (i915_request_completed(rq)) { /* too late! */
@@ -3169,8 +3172,10 @@ static void execlists_submission_tasklet(unsigned long data)
31693172
spin_unlock_irqrestore(&engine->active.lock, flags);
31703173

31713174
/* Recheck after serialising with direct-submission */
3172-
if (unlikely(timeout && preempt_timeout(engine)))
3175+
if (unlikely(timeout && preempt_timeout(engine))) {
3176+
cancel_timer(&engine->execlists.preempt);
31733177
execlists_reset(engine, "preemption time out");
3178+
}
31743179
}
31753180
}
31763181

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ struct drm_i915_mocs_table {
5959
#define _L3_CACHEABILITY(value) ((value) << 4)
6060

6161
/* Helper defines */
62-
#define GEN9_NUM_MOCS_ENTRIES 62 /* 62 out of 64 - 63 & 64 are reserved. */
63-
#define GEN11_NUM_MOCS_ENTRIES 64 /* 63-64 are reserved, but configured. */
62+
#define GEN9_NUM_MOCS_ENTRIES 64 /* 63-64 are reserved, but configured. */
6463

6564
/* (e)LLC caching options */
6665
/*
@@ -328,11 +327,11 @@ static unsigned int get_mocs_settings(const struct drm_i915_private *i915,
328327
if (INTEL_GEN(i915) >= 12) {
329328
table->size = ARRAY_SIZE(tgl_mocs_table);
330329
table->table = tgl_mocs_table;
331-
table->n_entries = GEN11_NUM_MOCS_ENTRIES;
330+
table->n_entries = GEN9_NUM_MOCS_ENTRIES;
332331
} else if (IS_GEN(i915, 11)) {
333332
table->size = ARRAY_SIZE(icl_mocs_table);
334333
table->table = icl_mocs_table;
335-
table->n_entries = GEN11_NUM_MOCS_ENTRIES;
334+
table->n_entries = GEN9_NUM_MOCS_ENTRIES;
336335
} else if (IS_GEN9_BC(i915) || IS_CANNONLAKE(i915)) {
337336
table->size = ARRAY_SIZE(skl_mocs_table);
338337
table->n_entries = GEN9_NUM_MOCS_ENTRIES;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void *shmem_pin_map(struct file *file)
7373
mapping_set_unevictable(file->f_mapping);
7474
return vaddr;
7575
err_page:
76-
while (--i >= 0)
76+
while (i--)
7777
put_page(pages[i]);
7878
kvfree(pages);
7979
return NULL;

drivers/gpu/drm/i915/selftests/i915_gem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ static int igt_gem_ww_ctx(void *arg)
211211
return PTR_ERR(obj);
212212

213213
obj2 = i915_gem_object_create_internal(i915, PAGE_SIZE);
214-
if (IS_ERR(obj)) {
215-
err = PTR_ERR(obj);
214+
if (IS_ERR(obj2)) {
215+
err = PTR_ERR(obj2);
216216
goto put1;
217217
}
218218

0 commit comments

Comments
 (0)