Skip to content

Commit 1a4edef

Browse files
committed
Merge tag 'drm-intel-fixes-2023-04-05' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
drm/i915 fixes for v6.3-rc6: - Fix DP MST DSC M/N calculation to use compressed bpp - Fix racy use-after-free in perf ioctl - Fix context runtime accounting - Fix handling of GT reset during HuC loading - Fix use of unsigned vm_fault_t for error values Signed-off-by: Daniel Vetter <[email protected]> From: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 7e364e5 + dc34215 commit 1a4edef

File tree

6 files changed

+25
-14
lines changed

6 files changed

+25
-14
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ static int intel_dp_dsc_mst_compute_link_config(struct intel_encoder *encoder,
232232
return slots;
233233
}
234234

235-
intel_link_compute_m_n(crtc_state->pipe_bpp,
235+
intel_link_compute_m_n(crtc_state->dsc.compressed_bpp,
236236
crtc_state->lane_count,
237237
adjusted_mode->crtc_clock,
238238
crtc_state->port_clock,

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,11 +1067,12 @@ static vm_fault_t vm_fault_ttm(struct vm_fault *vmf)
10671067
.interruptible = true,
10681068
.no_wait_gpu = true, /* should be idle already */
10691069
};
1070+
int err;
10701071

10711072
GEM_BUG_ON(!bo->ttm || !(bo->ttm->page_flags & TTM_TT_FLAG_SWAPPED));
10721073

1073-
ret = ttm_bo_validate(bo, i915_ttm_sys_placement(), &ctx);
1074-
if (ret) {
1074+
err = ttm_bo_validate(bo, i915_ttm_sys_placement(), &ctx);
1075+
if (err) {
10751076
dma_resv_unlock(bo->base.resv);
10761077
return VM_FAULT_SIGBUS;
10771078
}

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2018,6 +2018,8 @@ process_csb(struct intel_engine_cs *engine, struct i915_request **inactive)
20182018
* inspecting the queue to see if we need to resumbit.
20192019
*/
20202020
if (*prev != *execlists->active) { /* elide lite-restores */
2021+
struct intel_context *prev_ce = NULL, *active_ce = NULL;
2022+
20212023
/*
20222024
* Note the inherent discrepancy between the HW runtime,
20232025
* recorded as part of the context switch, and the CPU
@@ -2029,9 +2031,15 @@ process_csb(struct intel_engine_cs *engine, struct i915_request **inactive)
20292031
* and correct overselves later when updating from HW.
20302032
*/
20312033
if (*prev)
2032-
lrc_runtime_stop((*prev)->context);
2034+
prev_ce = (*prev)->context;
20332035
if (*execlists->active)
2034-
lrc_runtime_start((*execlists->active)->context);
2036+
active_ce = (*execlists->active)->context;
2037+
if (prev_ce != active_ce) {
2038+
if (prev_ce)
2039+
lrc_runtime_stop(prev_ce);
2040+
if (active_ce)
2041+
lrc_runtime_start(active_ce);
2042+
}
20352043
new_timeslice(execlists);
20362044
}
20372045

drivers/gpu/drm/i915/gt/uc/intel_huc.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,13 @@ static void delayed_huc_load_fini(struct intel_huc *huc)
235235
i915_sw_fence_fini(&huc->delayed_load.fence);
236236
}
237237

238+
int intel_huc_sanitize(struct intel_huc *huc)
239+
{
240+
delayed_huc_load_complete(huc);
241+
intel_uc_fw_sanitize(&huc->fw);
242+
return 0;
243+
}
244+
238245
static bool vcs_supported(struct intel_gt *gt)
239246
{
240247
intel_engine_mask_t mask = gt->info.engine_mask;

drivers/gpu/drm/i915/gt/uc/intel_huc.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ struct intel_huc {
4141
} delayed_load;
4242
};
4343

44+
int intel_huc_sanitize(struct intel_huc *huc);
4445
void intel_huc_init_early(struct intel_huc *huc);
4546
int intel_huc_init(struct intel_huc *huc);
4647
void intel_huc_fini(struct intel_huc *huc);
@@ -54,12 +55,6 @@ bool intel_huc_is_authenticated(struct intel_huc *huc);
5455
void intel_huc_register_gsc_notifier(struct intel_huc *huc, struct bus_type *bus);
5556
void intel_huc_unregister_gsc_notifier(struct intel_huc *huc, struct bus_type *bus);
5657

57-
static inline int intel_huc_sanitize(struct intel_huc *huc)
58-
{
59-
intel_uc_fw_sanitize(&huc->fw);
60-
return 0;
61-
}
62-
6358
static inline bool intel_huc_is_supported(struct intel_huc *huc)
6459
{
6560
return intel_uc_fw_is_supported(&huc->fw);

drivers/gpu/drm/i915/i915_perf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4638,13 +4638,13 @@ int i915_perf_add_config_ioctl(struct drm_device *dev, void *data,
46384638
err = oa_config->id;
46394639
goto sysfs_err;
46404640
}
4641-
4642-
mutex_unlock(&perf->metrics_lock);
4641+
id = oa_config->id;
46434642

46444643
drm_dbg(&perf->i915->drm,
46454644
"Added config %s id=%i\n", oa_config->uuid, oa_config->id);
4645+
mutex_unlock(&perf->metrics_lock);
46464646

4647-
return oa_config->id;
4647+
return id;
46484648

46494649
sysfs_err:
46504650
mutex_unlock(&perf->metrics_lock);

0 commit comments

Comments
 (0)