Skip to content

Commit 908f606

Browse files
committed
Merge tag 'amd-drm-fixes-6.7-2023-11-30' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
amd-drm-fixes-6.7-2023-11-30: amdgpu: - DMUB fix - DCN 3.5 fixes - XGMI fix - DCN 3.2 fixes - Vangogh suspend fix - NBIO 7.9 fix - GFX11 golden register fix - Backlight fix - NBIO 7.11 fix - IB test overflow fix - DCN 3.1.4 fixes - fix a runtime pm ref count - Retimer fix - ABM fix - DCN 3.1.5 fix - Fix AGP addressing - Fix possible memory leak in SMU error path - Make sure PME is enabled in D3 - Fix possible NULL pointer dereference in debugfs - EEPROM fix - GC 9.4.3 fix amdkfd: - IP version check fix - Fix memory leak in pqm_uninit() drm: - Revert unexport of prime helpers for fd/handle conversion Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexander.deucher@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20231130213135.5083-1-alexander.deucher@amd.com
2 parents a74229b + 0514f63 commit 908f606

Some content is hidden

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

54 files changed

+464
-249
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ int amdgpu_amdkfd_get_xgmi_bandwidth_mbytes(struct amdgpu_device *dst,
547547
struct amdgpu_device *adev = dst, *peer_adev;
548548
int num_links;
549549

550-
if (adev->asic_type != CHIP_ALDEBARAN)
550+
if (amdgpu_ip_version(adev, GC_HWIP, 0) < IP_VERSION(9, 4, 2))
551551
return 0;
552552

553553
if (src)

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,9 @@ static ssize_t amdgpu_debugfs_regs_didt_read(struct file *f, char __user *buf,
638638
if (size & 0x3 || *pos & 0x3)
639639
return -EINVAL;
640640

641+
if (!adev->didt_rreg)
642+
return -EOPNOTSUPP;
643+
641644
r = pm_runtime_get_sync(adev_to_drm(adev)->dev);
642645
if (r < 0) {
643646
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
@@ -694,6 +697,9 @@ static ssize_t amdgpu_debugfs_regs_didt_write(struct file *f, const char __user
694697
if (size & 0x3 || *pos & 0x3)
695698
return -EINVAL;
696699

700+
if (!adev->didt_wreg)
701+
return -EOPNOTSUPP;
702+
697703
r = pm_runtime_get_sync(adev_to_drm(adev)->dev);
698704
if (r < 0) {
699705
pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4538,6 +4538,10 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
45384538
if (amdgpu_sriov_vf(adev))
45394539
amdgpu_virt_release_full_gpu(adev, false);
45404540

4541+
r = amdgpu_dpm_notify_rlc_state(adev, false);
4542+
if (r)
4543+
return r;
4544+
45414545
return 0;
45424546
}
45434547

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -340,14 +340,11 @@ int amdgpu_display_crtc_set_config(struct drm_mode_set *set,
340340
adev->have_disp_power_ref = true;
341341
return ret;
342342
}
343-
/* if we have no active crtcs, then drop the power ref
344-
* we got before
343+
/* if we have no active crtcs, then go to
344+
* drop the power ref we got before
345345
*/
346-
if (!active && adev->have_disp_power_ref) {
347-
pm_runtime_put_autosuspend(dev->dev);
346+
if (!active && adev->have_disp_power_ref)
348347
adev->have_disp_power_ref = false;
349-
}
350-
351348
out:
352349
/* drop the power reference we got coming in here */
353350
pm_runtime_put_autosuspend(dev->dev);

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2263,6 +2263,8 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
22632263
pm_runtime_mark_last_busy(ddev->dev);
22642264
pm_runtime_put_autosuspend(ddev->dev);
22652265

2266+
pci_wake_from_d3(pdev, TRUE);
2267+
22662268
/*
22672269
* For runpm implemented via BACO, PMFW will handle the
22682270
* timing for BACO in and out:

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ uint64_t amdgpu_gmc_agp_addr(struct ttm_buffer_object *bo)
181181
{
182182
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->bdev);
183183

184+
if (!bo->ttm)
185+
return AMDGPU_BO_INVALID_OFFSET;
186+
184187
if (bo->ttm->num_pages != 1 || bo->ttm->caching == ttm_cached)
185188
return AMDGPU_BO_INVALID_OFFSET;
186189

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,10 +1527,14 @@ u64 amdgpu_bo_gpu_offset(struct amdgpu_bo *bo)
15271527
u64 amdgpu_bo_gpu_offset_no_check(struct amdgpu_bo *bo)
15281528
{
15291529
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
1530-
uint64_t offset;
1530+
uint64_t offset = AMDGPU_BO_INVALID_OFFSET;
15311531

1532-
offset = (bo->tbo.resource->start << PAGE_SHIFT) +
1533-
amdgpu_ttm_domain_start(adev, bo->tbo.resource->mem_type);
1532+
if (bo->tbo.resource->mem_type == TTM_PL_TT)
1533+
offset = amdgpu_gmc_agp_addr(&bo->tbo);
1534+
1535+
if (offset == AMDGPU_BO_INVALID_OFFSET)
1536+
offset = (bo->tbo.resource->start << PAGE_SHIFT) +
1537+
amdgpu_ttm_domain_start(adev, bo->tbo.resource->mem_type);
15341538

15351539
return amdgpu_gmc_sign_extend(offset);
15361540
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,12 @@ static bool __get_eeprom_i2c_addr(struct amdgpu_device *adev,
214214
control->i2c_address = EEPROM_I2C_MADDR_0;
215215
return true;
216216
case IP_VERSION(13, 0, 0):
217+
if (strnstr(atom_ctx->vbios_pn, "D707",
218+
sizeof(atom_ctx->vbios_pn)))
219+
control->i2c_address = EEPROM_I2C_MADDR_0;
220+
else
221+
control->i2c_address = EEPROM_I2C_MADDR_4;
222+
return true;
217223
case IP_VERSION(13, 0, 6):
218224
case IP_VERSION(13, 0, 10):
219225
control->i2c_address = EEPROM_I2C_MADDR_4;

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -959,10 +959,8 @@ int amdgpu_ttm_alloc_gart(struct ttm_buffer_object *bo)
959959
return 0;
960960

961961
addr = amdgpu_gmc_agp_addr(bo);
962-
if (addr != AMDGPU_BO_INVALID_OFFSET) {
963-
bo->resource->start = addr >> PAGE_SHIFT;
962+
if (addr != AMDGPU_BO_INVALID_OFFSET)
964963
return 0;
965-
}
966964

967965
/* allocate GART space */
968966
placement.num_placement = 1;

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ MODULE_FIRMWARE("amdgpu/gc_11_5_0_me.bin");
8989
MODULE_FIRMWARE("amdgpu/gc_11_5_0_mec.bin");
9090
MODULE_FIRMWARE("amdgpu/gc_11_5_0_rlc.bin");
9191

92+
static const struct soc15_reg_golden golden_settings_gc_11_0[] = {
93+
SOC15_REG_GOLDEN_VALUE(GC, 0, regTCP_CNTL, 0x20000000, 0x20000000)
94+
};
95+
9296
static const struct soc15_reg_golden golden_settings_gc_11_0_1[] =
9397
{
9498
SOC15_REG_GOLDEN_VALUE(GC, 0, regCGTT_GS_NGG_CLK_CTRL, 0x9fff8fff, 0x00000010),
@@ -304,6 +308,10 @@ static void gfx_v11_0_init_golden_registers(struct amdgpu_device *adev)
304308
default:
305309
break;
306310
}
311+
soc15_program_register_sequence(adev,
312+
golden_settings_gc_11_0,
313+
(const u32)ARRAY_SIZE(golden_settings_gc_11_0));
314+
307315
}
308316

309317
static void gfx_v11_0_write_data_to_reg(struct amdgpu_ring *ring, int eng_sel,
@@ -419,7 +427,7 @@ static int gfx_v11_0_ring_test_ib(struct amdgpu_ring *ring, long timeout)
419427
adev->wb.wb[index] = cpu_to_le32(0xCAFEDEAD);
420428
cpu_ptr = &adev->wb.wb[index];
421429

422-
r = amdgpu_ib_get(adev, NULL, 16, AMDGPU_IB_POOL_DIRECT, &ib);
430+
r = amdgpu_ib_get(adev, NULL, 20, AMDGPU_IB_POOL_DIRECT, &ib);
423431
if (r) {
424432
DRM_ERROR("amdgpu: failed to get ib (%ld).\n", r);
425433
goto err1;

0 commit comments

Comments
 (0)