Skip to content

Commit 9b1b1b7

Browse files
committed
Merge tag 'drm-fixes-2023-08-11' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "This week's fixes, as expected amdgpu is probably a little larger since it skipped a week, but otherwise a few nouveau fixes, a couple of bridge, rockchip and ivpu fixes. 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 bridge: - it6505: runtime PM fix - lt9611: revert Do not generate HFP/HBP/HSA and EOT packet nouveau: - enable global memory loads for helper invocations for userspace driver - dp 1.3 dpcd+ workaround fix - remove unused function - revert incorrect NULL check accel/ivpu: - Add set_pages_array_wc/uc for internal buffers rockchip: - Don't spam logs in atomic check" * tag 'drm-fixes-2023-08-11' of git://anongit.freedesktop.org/drm/drm: (23 commits) drm/shmem-helper: Reset vma->vm_ops before calling dma_buf_mmap() drm/amdkfd: disable IOMMUv2 support for Raven drm/amdkfd: disable IOMMUv2 support for KV/CZ drm/amdkfd: ignore crat by default drm/amdgpu/gfx11: only enable CP GFX shadowing on SR-IOV drm/amd/display: Fix a regression on Polaris cards drm/amdgpu: fix possible UAF in amdgpu_cs_pass1() drm/amd/pm: Fix SMU v13.0.6 energy reporting drm/amd/display: check attr flag before set cursor degamma on DCN3+ drm/amd/pm: disable the SMU13 OD feature support temporarily drm/amd/pm: correct the pcie width for smu 13.0.0 drm/amd/display: Don't show stack trace for missing eDP drm/amdgpu: Match against exact bootloader status drm/amd/pm: skip the RLC stop when S0i3 suspend for SMU v13.0.4/11 drm/amd: Disable S/G for APUs when 64GB or more host memory drm/rockchip: Don't spam logs in atomic check accel/ivpu: Add set_pages_array_wc/uc for internal buffers drm/nouveau/disp: Revert a NULL check inside nouveau_connector_get_modes Revert "drm/bridge: lt9611: Do not generate HFP/HBP/HSA and EOT packet" drm/nouveau: remove unused tu102_gr_load() function ...
2 parents 25aa0be + fbe8ff7 commit 9b1b1b7

30 files changed

+173
-82
lines changed

drivers/accel/ivpu/ivpu_gem.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ static void internal_free_pages_locked(struct ivpu_bo *bo)
173173
{
174174
unsigned int i, npages = bo->base.size >> PAGE_SHIFT;
175175

176+
if (ivpu_bo_cache_mode(bo) != DRM_IVPU_BO_CACHED)
177+
set_pages_array_wb(bo->pages, bo->base.size >> PAGE_SHIFT);
178+
176179
for (i = 0; i < npages; i++)
177180
put_page(bo->pages[i]);
178181

@@ -587,6 +590,11 @@ ivpu_bo_alloc_internal(struct ivpu_device *vdev, u64 vpu_addr, u64 size, u32 fla
587590
if (ivpu_bo_cache_mode(bo) != DRM_IVPU_BO_CACHED)
588591
drm_clflush_pages(bo->pages, bo->base.size >> PAGE_SHIFT);
589592

593+
if (bo->flags & DRM_IVPU_BO_WC)
594+
set_pages_array_wc(bo->pages, bo->base.size >> PAGE_SHIFT);
595+
else if (bo->flags & DRM_IVPU_BO_UNCACHED)
596+
set_pages_array_uc(bo->pages, bo->base.size >> PAGE_SHIFT);
597+
590598
prot = ivpu_bo_pgprot(bo, PAGE_KERNEL);
591599
bo->kvaddr = vmap(bo->pages, bo->base.size >> PAGE_SHIFT, VM_MAP, prot);
592600
if (!bo->kvaddr) {

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;

0 commit comments

Comments
 (0)