Skip to content

Commit d1c13e8

Browse files
committed
Merge tag 'drm-fixes-2024-04-12' of https://gitlab.freedesktop.org/drm/kernel
Pull drm fixes from Dave Airlie: "Looks like everyone woke up after holidays, this weeks pull has a bunch of stuff all over, 2 weeks worth of amdgpu is a lot of it, then i915/xe have a few, a bunch of msm fixes, then some scattered driver fixes. I expect things will settle down for rc5. client: - Protect connector modes with mode_config mutex ast: - Fix soft lockup host1x: - Do not setup DMA for virtual addresses ivpu: - Fix deadlock in context_xa - PCI fixes - Fixes to error handling nouveau: - gsp: Fix OOB access - Fix casting panfrost: - Fix error path in MMU code qxl: - Revert "drm/qxl: simplify qxl_fence_wait" vmwgfx: - Enable DMA for SEV mappings i915: - Couple CDCLK programming fixes - HDCP related fix - 4 Bigjoiner related fixes - Fix for a circular locking around GuC on reset+wedged case xe: - Fix double display mutex initializations - Fix u32 -> u64 implicit conversions - Fix RING_CONTEXT_CONTROL not marked as masked msm: - DP refcount leak fix on disconnect - Add missing newlines to prints in msm_fb and msm_kms - fix dpu debugfs entry permissions - Fix the interface table for the catalog of X1E80100 - fix irq message printing - Bindings fix to add DP node as child of mdss for mdss node - Minor typo fix in DP driver API which handles port status change - fix CHRASHDUMP_READ() - fix HHB (highest bank bit) for a619 to fix UBWC corruption amdgpu: - GPU reset fixes - Fix some confusing logging - UMSCH fix - Aborted suspend fix - DCN 3.5 fixes - S4 fix - MES logging fixes - SMU 14 fixes - SDMA 4.4.2 fix - KASAN fix - SMU 13.0.10 fix - VCN partition fix - GFX11 fixes - DWB fixes - Plane handling fix - FAMS fix - DCN 3.1.6 fix - VSC SDP fixes - OLED panel fix - GFX 11.5 fix amdkfd: - GPU reset fixes - fix ioctl integer overflow" * tag 'drm-fixes-2024-04-12' of https://gitlab.freedesktop.org/drm/kernel: (65 commits) amdkfd: use calloc instead of kzalloc to avoid integer overflow drm/xe: Label RING_CONTEXT_CONTROL as masked drm/xe/xe_migrate: Cast to output precision before multiplying operands drm/xe/hwmon: Cast result to output precision on left shift of operand drm/xe/display: Fix double mutex initialization drm/amdgpu: differentiate external rev id for gfx 11.5.0 drm/amd/display: Adjust dprefclk by down spread percentage. drm/amd/display: Set VSC SDP Colorimetry same way for MST and SST drm/amd/display: Program VSC SDP colorimetry for all DP sinks >= 1.4 drm/amd/display: fix disable otg wa logic in DCN316 drm/amd/display: Do not recursively call manual trigger programming drm/amd/display: always reset ODM mode in context when adding first plane drm/amdgpu: fix incorrect number of active RBs for gfx11 drm/amd/display: Return max resolution supported by DWB amd/amdkfd: sync all devices to wait all processes being evicted drm/amdgpu: clear set_q_mode_offs when VM changed drm/amdgpu: Fix VCN allocation in CPX partition drm/amd/pm: fix the high voltage issue after unload drm/amd/display: Skip on writeback when it's not applicable drm/amdgpu: implement IRQ_STATE_ENABLE for SDMA v4.4.2 ...
2 parents 586b5df + 3b0daec commit d1c13e8

Some content is hidden

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

73 files changed

+930
-266
lines changed

Documentation/devicetree/bindings/display/msm/qcom,sm8150-mdss.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ patternProperties:
5353
compatible:
5454
const: qcom,sm8150-dpu
5555

56+
"^displayport-controller@[0-9a-f]+$":
57+
type: object
58+
additionalProperties: true
59+
60+
properties:
61+
compatible:
62+
contains:
63+
const: qcom,sm8150-dp
64+
5665
"^dsi@[0-9a-f]+$":
5766
type: object
5867
additionalProperties: true

drivers/accel/ivpu/ivpu_drv.c

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/*
3-
* Copyright (C) 2020-2023 Intel Corporation
3+
* Copyright (C) 2020-2024 Intel Corporation
44
*/
55

66
#include <linux/firmware.h>
@@ -131,22 +131,6 @@ static int ivpu_get_capabilities(struct ivpu_device *vdev, struct drm_ivpu_param
131131
return 0;
132132
}
133133

134-
static int ivpu_get_core_clock_rate(struct ivpu_device *vdev, u64 *clk_rate)
135-
{
136-
int ret;
137-
138-
ret = ivpu_rpm_get_if_active(vdev);
139-
if (ret < 0)
140-
return ret;
141-
142-
*clk_rate = ret ? ivpu_hw_reg_pll_freq_get(vdev) : 0;
143-
144-
if (ret)
145-
ivpu_rpm_put(vdev);
146-
147-
return 0;
148-
}
149-
150134
static int ivpu_get_param_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
151135
{
152136
struct ivpu_file_priv *file_priv = file->driver_priv;
@@ -170,7 +154,7 @@ static int ivpu_get_param_ioctl(struct drm_device *dev, void *data, struct drm_f
170154
args->value = vdev->platform;
171155
break;
172156
case DRM_IVPU_PARAM_CORE_CLOCK_RATE:
173-
ret = ivpu_get_core_clock_rate(vdev, &args->value);
157+
args->value = ivpu_hw_ratio_to_freq(vdev, vdev->hw->pll.max_ratio);
174158
break;
175159
case DRM_IVPU_PARAM_NUM_CONTEXTS:
176160
args->value = ivpu_get_context_count(vdev);
@@ -387,12 +371,15 @@ int ivpu_shutdown(struct ivpu_device *vdev)
387371
{
388372
int ret;
389373

390-
ivpu_prepare_for_reset(vdev);
374+
/* Save PCI state before powering down as it sometimes gets corrupted if NPU hangs */
375+
pci_save_state(to_pci_dev(vdev->drm.dev));
391376

392377
ret = ivpu_hw_power_down(vdev);
393378
if (ret)
394379
ivpu_warn(vdev, "Failed to power down HW: %d\n", ret);
395380

381+
pci_set_power_state(to_pci_dev(vdev->drm.dev), PCI_D3hot);
382+
396383
return ret;
397384
}
398385

@@ -530,7 +517,7 @@ static int ivpu_dev_init(struct ivpu_device *vdev)
530517
vdev->context_xa_limit.min = IVPU_USER_CONTEXT_MIN_SSID;
531518
vdev->context_xa_limit.max = IVPU_USER_CONTEXT_MAX_SSID;
532519
atomic64_set(&vdev->unique_id_counter, 0);
533-
xa_init_flags(&vdev->context_xa, XA_FLAGS_ALLOC);
520+
xa_init_flags(&vdev->context_xa, XA_FLAGS_ALLOC | XA_FLAGS_LOCK_IRQ);
534521
xa_init_flags(&vdev->submitted_jobs_xa, XA_FLAGS_ALLOC1);
535522
xa_init_flags(&vdev->db_xa, XA_FLAGS_ALLOC1);
536523
lockdep_set_class(&vdev->submitted_jobs_xa.xa_lock, &submitted_jobs_xa_lock_class_key);
@@ -560,11 +547,11 @@ static int ivpu_dev_init(struct ivpu_device *vdev)
560547
/* Power up early so the rest of init code can access VPU registers */
561548
ret = ivpu_hw_power_up(vdev);
562549
if (ret)
563-
goto err_power_down;
550+
goto err_shutdown;
564551

565552
ret = ivpu_mmu_global_context_init(vdev);
566553
if (ret)
567-
goto err_power_down;
554+
goto err_shutdown;
568555

569556
ret = ivpu_mmu_init(vdev);
570557
if (ret)
@@ -601,10 +588,8 @@ static int ivpu_dev_init(struct ivpu_device *vdev)
601588
ivpu_mmu_reserved_context_fini(vdev);
602589
err_mmu_gctx_fini:
603590
ivpu_mmu_global_context_fini(vdev);
604-
err_power_down:
605-
ivpu_hw_power_down(vdev);
606-
if (IVPU_WA(d3hot_after_power_off))
607-
pci_set_power_state(to_pci_dev(vdev->drm.dev), PCI_D3hot);
591+
err_shutdown:
592+
ivpu_shutdown(vdev);
608593
err_xa_destroy:
609594
xa_destroy(&vdev->db_xa);
610595
xa_destroy(&vdev->submitted_jobs_xa);
@@ -628,9 +613,8 @@ static void ivpu_bo_unbind_all_user_contexts(struct ivpu_device *vdev)
628613
static void ivpu_dev_fini(struct ivpu_device *vdev)
629614
{
630615
ivpu_pm_disable(vdev);
616+
ivpu_prepare_for_reset(vdev);
631617
ivpu_shutdown(vdev);
632-
if (IVPU_WA(d3hot_after_power_off))
633-
pci_set_power_state(to_pci_dev(vdev->drm.dev), PCI_D3hot);
634618

635619
ivpu_jobs_abort_all(vdev);
636620
ivpu_job_done_consumer_fini(vdev);

drivers/accel/ivpu/ivpu_drv.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* SPDX-License-Identifier: GPL-2.0-only */
22
/*
3-
* Copyright (C) 2020-2023 Intel Corporation
3+
* Copyright (C) 2020-2024 Intel Corporation
44
*/
55

66
#ifndef __IVPU_DRV_H__
@@ -90,7 +90,6 @@
9090
struct ivpu_wa_table {
9191
bool punit_disabled;
9292
bool clear_runtime_mem;
93-
bool d3hot_after_power_off;
9493
bool interrupt_clear_with_0;
9594
bool disable_clock_relinquish;
9695
bool disable_d0i3_msg;

drivers/accel/ivpu/ivpu_hw.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ struct ivpu_hw_ops {
2121
u32 (*profiling_freq_get)(struct ivpu_device *vdev);
2222
void (*profiling_freq_drive)(struct ivpu_device *vdev, bool enable);
2323
u32 (*reg_pll_freq_get)(struct ivpu_device *vdev);
24+
u32 (*ratio_to_freq)(struct ivpu_device *vdev, u32 ratio);
2425
u32 (*reg_telemetry_offset_get)(struct ivpu_device *vdev);
2526
u32 (*reg_telemetry_size_get)(struct ivpu_device *vdev);
2627
u32 (*reg_telemetry_enable_get)(struct ivpu_device *vdev);
@@ -130,6 +131,11 @@ static inline u32 ivpu_hw_reg_pll_freq_get(struct ivpu_device *vdev)
130131
return vdev->hw->ops->reg_pll_freq_get(vdev);
131132
};
132133

134+
static inline u32 ivpu_hw_ratio_to_freq(struct ivpu_device *vdev, u32 ratio)
135+
{
136+
return vdev->hw->ops->ratio_to_freq(vdev, ratio);
137+
}
138+
133139
static inline u32 ivpu_hw_reg_telemetry_offset_get(struct ivpu_device *vdev)
134140
{
135141
return vdev->hw->ops->reg_telemetry_offset_get(vdev);

drivers/accel/ivpu/ivpu_hw_37xx.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/*
3-
* Copyright (C) 2020-2023 Intel Corporation
3+
* Copyright (C) 2020-2024 Intel Corporation
44
*/
55

66
#include "ivpu_drv.h"
@@ -75,7 +75,6 @@ static void ivpu_hw_wa_init(struct ivpu_device *vdev)
7575
{
7676
vdev->wa.punit_disabled = false;
7777
vdev->wa.clear_runtime_mem = false;
78-
vdev->wa.d3hot_after_power_off = true;
7978

8079
REGB_WR32(VPU_37XX_BUTTRESS_INTERRUPT_STAT, BUTTRESS_ALL_IRQ_MASK);
8180
if (REGB_RD32(VPU_37XX_BUTTRESS_INTERRUPT_STAT) == BUTTRESS_ALL_IRQ_MASK) {
@@ -86,7 +85,6 @@ static void ivpu_hw_wa_init(struct ivpu_device *vdev)
8685

8786
IVPU_PRINT_WA(punit_disabled);
8887
IVPU_PRINT_WA(clear_runtime_mem);
89-
IVPU_PRINT_WA(d3hot_after_power_off);
9088
IVPU_PRINT_WA(interrupt_clear_with_0);
9189
}
9290

@@ -805,12 +803,12 @@ static void ivpu_hw_37xx_profiling_freq_drive(struct ivpu_device *vdev, bool ena
805803
/* Profiling freq - is a debug feature. Unavailable on VPU 37XX. */
806804
}
807805

808-
static u32 ivpu_hw_37xx_pll_to_freq(u32 ratio, u32 config)
806+
static u32 ivpu_hw_37xx_ratio_to_freq(struct ivpu_device *vdev, u32 ratio)
809807
{
810808
u32 pll_clock = PLL_REF_CLK_FREQ * ratio;
811809
u32 cpu_clock;
812810

813-
if ((config & 0xff) == PLL_RATIO_4_3)
811+
if ((vdev->hw->config & 0xff) == PLL_RATIO_4_3)
814812
cpu_clock = pll_clock * 2 / 4;
815813
else
816814
cpu_clock = pll_clock * 2 / 5;
@@ -829,7 +827,7 @@ static u32 ivpu_hw_37xx_reg_pll_freq_get(struct ivpu_device *vdev)
829827
if (!ivpu_is_silicon(vdev))
830828
return PLL_SIMULATION_FREQ;
831829

832-
return ivpu_hw_37xx_pll_to_freq(pll_curr_ratio, vdev->hw->config);
830+
return ivpu_hw_37xx_ratio_to_freq(vdev, pll_curr_ratio);
833831
}
834832

835833
static u32 ivpu_hw_37xx_reg_telemetry_offset_get(struct ivpu_device *vdev)
@@ -1052,6 +1050,7 @@ const struct ivpu_hw_ops ivpu_hw_37xx_ops = {
10521050
.profiling_freq_get = ivpu_hw_37xx_profiling_freq_get,
10531051
.profiling_freq_drive = ivpu_hw_37xx_profiling_freq_drive,
10541052
.reg_pll_freq_get = ivpu_hw_37xx_reg_pll_freq_get,
1053+
.ratio_to_freq = ivpu_hw_37xx_ratio_to_freq,
10551054
.reg_telemetry_offset_get = ivpu_hw_37xx_reg_telemetry_offset_get,
10561055
.reg_telemetry_size_get = ivpu_hw_37xx_reg_telemetry_size_get,
10571056
.reg_telemetry_enable_get = ivpu_hw_37xx_reg_telemetry_enable_get,

drivers/accel/ivpu/ivpu_hw_40xx.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -980,6 +980,11 @@ static u32 ivpu_hw_40xx_reg_pll_freq_get(struct ivpu_device *vdev)
980980
return PLL_RATIO_TO_FREQ(pll_curr_ratio);
981981
}
982982

983+
static u32 ivpu_hw_40xx_ratio_to_freq(struct ivpu_device *vdev, u32 ratio)
984+
{
985+
return PLL_RATIO_TO_FREQ(ratio);
986+
}
987+
983988
static u32 ivpu_hw_40xx_reg_telemetry_offset_get(struct ivpu_device *vdev)
984989
{
985990
return REGB_RD32(VPU_40XX_BUTTRESS_VPU_TELEMETRY_OFFSET);
@@ -1230,6 +1235,7 @@ const struct ivpu_hw_ops ivpu_hw_40xx_ops = {
12301235
.profiling_freq_get = ivpu_hw_40xx_profiling_freq_get,
12311236
.profiling_freq_drive = ivpu_hw_40xx_profiling_freq_drive,
12321237
.reg_pll_freq_get = ivpu_hw_40xx_reg_pll_freq_get,
1238+
.ratio_to_freq = ivpu_hw_40xx_ratio_to_freq,
12331239
.reg_telemetry_offset_get = ivpu_hw_40xx_reg_telemetry_offset_get,
12341240
.reg_telemetry_size_get = ivpu_hw_40xx_reg_telemetry_size_get,
12351241
.reg_telemetry_enable_get = ivpu_hw_40xx_reg_telemetry_enable_get,

drivers/accel/ivpu/ivpu_ipc.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/*
3-
* Copyright (C) 2020-2023 Intel Corporation
3+
* Copyright (C) 2020-2024 Intel Corporation
44
*/
55

66
#include <linux/genalloc.h>
@@ -501,7 +501,11 @@ int ivpu_ipc_init(struct ivpu_device *vdev)
501501
spin_lock_init(&ipc->cons_lock);
502502
INIT_LIST_HEAD(&ipc->cons_list);
503503
INIT_LIST_HEAD(&ipc->cb_msg_list);
504-
drmm_mutex_init(&vdev->drm, &ipc->lock);
504+
ret = drmm_mutex_init(&vdev->drm, &ipc->lock);
505+
if (ret) {
506+
ivpu_err(vdev, "Failed to initialize ipc->lock, ret %d\n", ret);
507+
goto err_free_rx;
508+
}
505509
ivpu_ipc_reset(vdev);
506510
return 0;
507511

drivers/accel/ivpu/ivpu_mmu.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,23 +278,23 @@ static const char *ivpu_mmu_event_to_str(u32 cmd)
278278
case IVPU_MMU_EVT_F_VMS_FETCH:
279279
return "Fetch of VMS caused external abort";
280280
default:
281-
return "Unknown CMDQ command";
281+
return "Unknown event";
282282
}
283283
}
284284

285285
static const char *ivpu_mmu_cmdq_err_to_str(u32 err)
286286
{
287287
switch (err) {
288288
case IVPU_MMU_CERROR_NONE:
289-
return "No CMDQ Error";
289+
return "No error";
290290
case IVPU_MMU_CERROR_ILL:
291291
return "Illegal command";
292292
case IVPU_MMU_CERROR_ABT:
293-
return "External abort on CMDQ read";
293+
return "External abort on command queue read";
294294
case IVPU_MMU_CERROR_ATC_INV_SYNC:
295295
return "Sync failed to complete ATS invalidation";
296296
default:
297-
return "Unknown CMDQ Error";
297+
return "Unknown error";
298298
}
299299
}
300300

drivers/accel/ivpu/ivpu_pm.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/*
3-
* Copyright (C) 2020-2023 Intel Corporation
3+
* Copyright (C) 2020-2024 Intel Corporation
44
*/
55

66
#include <linux/highmem.h>
@@ -58,14 +58,11 @@ static int ivpu_suspend(struct ivpu_device *vdev)
5858
{
5959
int ret;
6060

61-
/* Save PCI state before powering down as it sometimes gets corrupted if NPU hangs */
62-
pci_save_state(to_pci_dev(vdev->drm.dev));
61+
ivpu_prepare_for_reset(vdev);
6362

6463
ret = ivpu_shutdown(vdev);
6564
if (ret)
66-
ivpu_err(vdev, "Failed to shutdown VPU: %d\n", ret);
67-
68-
pci_set_power_state(to_pci_dev(vdev->drm.dev), PCI_D3hot);
65+
ivpu_err(vdev, "Failed to shutdown NPU: %d\n", ret);
6966

7067
return ret;
7168
}
@@ -74,10 +71,10 @@ static int ivpu_resume(struct ivpu_device *vdev)
7471
{
7572
int ret;
7673

77-
pci_set_power_state(to_pci_dev(vdev->drm.dev), PCI_D0);
74+
retry:
7875
pci_restore_state(to_pci_dev(vdev->drm.dev));
76+
pci_set_power_state(to_pci_dev(vdev->drm.dev), PCI_D0);
7977

80-
retry:
8178
ret = ivpu_hw_power_up(vdev);
8279
if (ret) {
8380
ivpu_err(vdev, "Failed to power up HW: %d\n", ret);
@@ -100,6 +97,7 @@ static int ivpu_resume(struct ivpu_device *vdev)
10097
ivpu_mmu_disable(vdev);
10198
err_power_down:
10299
ivpu_hw_power_down(vdev);
100+
pci_set_power_state(to_pci_dev(vdev->drm.dev), PCI_D3hot);
103101

104102
if (!ivpu_fw_is_cold_boot(vdev)) {
105103
ivpu_pm_prepare_cold_boot(vdev);

drivers/gpu/drm/amd/amdgpu/amdgpu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ extern int amdgpu_async_gfx_ring;
210210
extern int amdgpu_mcbp;
211211
extern int amdgpu_discovery;
212212
extern int amdgpu_mes;
213+
extern int amdgpu_mes_log_enable;
213214
extern int amdgpu_mes_kiq;
214215
extern int amdgpu_noretry;
215216
extern int amdgpu_force_asic_type;

0 commit comments

Comments
 (0)