Skip to content

Commit fbe8ff7

Browse files
committed
Merge tag 'amd-drm-fixes-6.5-2023-08-09' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
amd-drm-fixes-6.5-2023-08-09: amdgpu: - S/G display workaround for platforms with >= 64G of memory - S0i3 fix - SMU 13.0.0 fixes - Disable SMU 13.x OD features temporarily while the interface is reworked to enable additional functionality - Fix cursor gamma issues on DCN3+ - SMU 13.0.6 fixes - Fix possible UAF in CS IOCTL - Polaris display regression fix - Only enable CP GFX shadowing on SR-IOV amdkfd: - Raven/Picasso KFD regression fix Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexander.deucher@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230809182827.8135-1-alexander.deucher@amd.com
2 parents 8ba371c + 091ae54 commit fbe8ff7

File tree

16 files changed

+81
-54
lines changed

16 files changed

+81
-54
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,6 +1296,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
12961296
void amdgpu_device_pci_config_reset(struct amdgpu_device *adev);
12971297
int amdgpu_device_pci_reset(struct amdgpu_device *adev);
12981298
bool amdgpu_device_need_post(struct amdgpu_device *adev);
1299+
bool amdgpu_sg_display_supported(struct amdgpu_device *adev);
12991300
bool amdgpu_device_pcie_dynamic_switching_supported(void);
13001301
bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev);
13011302
bool amdgpu_device_aspm_support_quirk(void);

drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p,
295295

296296
if (!p->gang_size) {
297297
ret = -EINVAL;
298-
goto free_partial_kdata;
298+
goto free_all_kdata;
299299
}
300300

301301
for (i = 0; i < p->gang_size; ++i) {

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,6 +1458,32 @@ bool amdgpu_device_need_post(struct amdgpu_device *adev)
14581458
return true;
14591459
}
14601460

1461+
/*
1462+
* On APUs with >= 64GB white flickering has been observed w/ SG enabled.
1463+
* Disable S/G on such systems until we have a proper fix.
1464+
* https://gitlab.freedesktop.org/drm/amd/-/issues/2354
1465+
* https://gitlab.freedesktop.org/drm/amd/-/issues/2735
1466+
*/
1467+
bool amdgpu_sg_display_supported(struct amdgpu_device *adev)
1468+
{
1469+
switch (amdgpu_sg_display) {
1470+
case -1:
1471+
break;
1472+
case 0:
1473+
return false;
1474+
case 1:
1475+
return true;
1476+
default:
1477+
return false;
1478+
}
1479+
if ((totalram_pages() << (PAGE_SHIFT - 10)) +
1480+
(adev->gmc.real_vram_size / 1024) >= 64000000) {
1481+
DRM_WARN("Disabling S/G due to >=64GB RAM\n");
1482+
return false;
1483+
}
1484+
return true;
1485+
}
1486+
14611487
/*
14621488
* Intel hosts such as Raptor Lake and Sapphire Rapids don't support dynamic
14631489
* speed switching. Until we have confirmation from Intel that a specific host

drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,12 @@ static void gfx_v11_0_check_fw_cp_gfx_shadow(struct amdgpu_device *adev)
471471
case IP_VERSION(11, 0, 3):
472472
if ((adev->gfx.me_fw_version >= 1505) &&
473473
(adev->gfx.pfp_fw_version >= 1600) &&
474-
(adev->gfx.mec_fw_version >= 512))
475-
adev->gfx.cp_gfx_shadow = true;
474+
(adev->gfx.mec_fw_version >= 512)) {
475+
if (amdgpu_sriov_vf(adev))
476+
adev->gfx.cp_gfx_shadow = true;
477+
else
478+
adev->gfx.cp_gfx_shadow = false;
479+
}
476480
break;
477481
default:
478482
adev->gfx.cp_gfx_shadow = false;

drivers/gpu/drm/amd/amdgpu/psp_v13_0.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,15 @@ static int psp_v13_0_wait_for_bootloader(struct psp_context *psp)
137137
int ret;
138138
int retry_loop;
139139

140+
/* Wait for bootloader to signify that it is ready having bit 31 of
141+
* C2PMSG_35 set to 1. All other bits are expected to be cleared.
142+
* If there is an error in processing command, bits[7:0] will be set.
143+
* This is applicable for PSP v13.0.6 and newer.
144+
*/
140145
for (retry_loop = 0; retry_loop < 10; retry_loop++) {
141-
/* Wait for bootloader to signify that is
142-
ready having bit 31 of C2PMSG_35 set to 1 */
143-
ret = psp_wait_for(psp,
144-
SOC15_REG_OFFSET(MP0, 0, regMP0_SMN_C2PMSG_35),
145-
0x80000000,
146-
0x80000000,
147-
false);
146+
ret = psp_wait_for(
147+
psp, SOC15_REG_OFFSET(MP0, 0, regMP0_SMN_C2PMSG_35),
148+
0x80000000, 0xffffffff, false);
148149

149150
if (ret == 0)
150151
return 0;

drivers/gpu/drm/amd/amdkfd/kfd_crat.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,11 +1543,7 @@ static bool kfd_ignore_crat(void)
15431543
if (ignore_crat)
15441544
return true;
15451545

1546-
#ifndef KFD_SUPPORT_IOMMU_V2
15471546
ret = true;
1548-
#else
1549-
ret = false;
1550-
#endif
15511547

15521548
return ret;
15531549
}

drivers/gpu/drm/amd/amdkfd/kfd_device.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,6 @@ static void kfd_device_info_init(struct kfd_dev *kfd,
194194

195195
kfd_device_info_set_event_interrupt_class(kfd);
196196

197-
/* Raven */
198-
if (gc_version == IP_VERSION(9, 1, 0) ||
199-
gc_version == IP_VERSION(9, 2, 2))
200-
kfd->device_info.needs_iommu_device = true;
201-
202197
if (gc_version < IP_VERSION(11, 0, 0)) {
203198
/* Navi2x+, Navi1x+ */
204199
if (gc_version == IP_VERSION(10, 3, 6))
@@ -233,10 +228,6 @@ static void kfd_device_info_init(struct kfd_dev *kfd,
233228
asic_type != CHIP_TONGA)
234229
kfd->device_info.supports_cwsr = true;
235230

236-
if (asic_type == CHIP_KAVERI ||
237-
asic_type == CHIP_CARRIZO)
238-
kfd->device_info.needs_iommu_device = true;
239-
240231
if (asic_type != CHIP_HAWAII && !vf)
241232
kfd->device_info.needs_pci_atomics = true;
242233
}
@@ -249,7 +240,6 @@ struct kfd_dev *kgd2kfd_probe(struct amdgpu_device *adev, bool vf)
249240
uint32_t gfx_target_version = 0;
250241

251242
switch (adev->asic_type) {
252-
#ifdef KFD_SUPPORT_IOMMU_V2
253243
#ifdef CONFIG_DRM_AMDGPU_CIK
254244
case CHIP_KAVERI:
255245
gfx_target_version = 70000;
@@ -262,7 +252,6 @@ struct kfd_dev *kgd2kfd_probe(struct amdgpu_device *adev, bool vf)
262252
if (!vf)
263253
f2g = &gfx_v8_kfd2kgd;
264254
break;
265-
#endif
266255
#ifdef CONFIG_DRM_AMDGPU_CIK
267256
case CHIP_HAWAII:
268257
gfx_target_version = 70001;
@@ -298,15 +287,13 @@ struct kfd_dev *kgd2kfd_probe(struct amdgpu_device *adev, bool vf)
298287
gfx_target_version = 90000;
299288
f2g = &gfx_v9_kfd2kgd;
300289
break;
301-
#ifdef KFD_SUPPORT_IOMMU_V2
302290
/* Raven */
303291
case IP_VERSION(9, 1, 0):
304292
case IP_VERSION(9, 2, 2):
305293
gfx_target_version = 90002;
306294
if (!vf)
307295
f2g = &gfx_v9_kfd2kgd;
308296
break;
309-
#endif
310297
/* Vega12 */
311298
case IP_VERSION(9, 2, 1):
312299
gfx_target_version = 90004;

drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2538,18 +2538,12 @@ struct device_queue_manager *device_queue_manager_init(struct kfd_node *dev)
25382538
}
25392539

25402540
switch (dev->adev->asic_type) {
2541-
case CHIP_CARRIZO:
2542-
device_queue_manager_init_vi(&dqm->asic_ops);
2543-
break;
2544-
25452541
case CHIP_KAVERI:
2546-
device_queue_manager_init_cik(&dqm->asic_ops);
2547-
break;
2548-
25492542
case CHIP_HAWAII:
25502543
device_queue_manager_init_cik_hawaii(&dqm->asic_ops);
25512544
break;
25522545

2546+
case CHIP_CARRIZO:
25532547
case CHIP_TONGA:
25542548
case CHIP_FIJI:
25552549
case CHIP_POLARIS10:

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,9 +1638,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
16381638
}
16391639
break;
16401640
}
1641-
if (init_data.flags.gpu_vm_support &&
1642-
(amdgpu_sg_display == 0))
1643-
init_data.flags.gpu_vm_support = false;
1641+
if (init_data.flags.gpu_vm_support)
1642+
init_data.flags.gpu_vm_support = amdgpu_sg_display_supported(adev);
16441643

16451644
if (init_data.flags.gpu_vm_support)
16461645
adev->mode_info.gpu_vm_support = true;

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,7 @@ int compute_mst_dsc_configs_for_state(struct drm_atomic_state *state,
13201320
if (computed_streams[i])
13211321
continue;
13221322

1323-
if (!res_pool->funcs->remove_stream_from_ctx ||
1323+
if (res_pool->funcs->remove_stream_from_ctx &&
13241324
res_pool->funcs->remove_stream_from_ctx(stream->ctx->dc, dc_state, stream) != DC_OK)
13251325
return -EINVAL;
13261326

0 commit comments

Comments
 (0)