Skip to content

Commit 1c1df79

Browse files
committed
Merge tag 'amd-drm-fixes-6.16-2025-05-29' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
amd-drm-fixes-6.16-2025-05-29: amdgpu: - UserQ fixes - SMU 13.x fixes - VCN fixes - JPEG fixes - Misc cleanups - runtime pm fix - DCN 4.0.1 fixes - Misc display fixes - ISP fix - VRAM manager fix - RAS fixes amdkfd: - SVM fix - Misc cleanups - Ref leak fix - WPTR BO fix radeon: - Misc cleanups Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2 parents 84e2f91 + 30837a4 commit 1c1df79

File tree

88 files changed

+1533
-347
lines changed

Some content is hidden

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

88 files changed

+1533
-347
lines changed

drivers/gpu/drm/amd/amdgpu/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ config DRM_AMDGPU_USERPTR
7777

7878
config DRM_AMD_ISP
7979
bool "Enable AMD Image Signal Processor IP support"
80-
depends on DRM_AMDGPU
80+
depends on DRM_AMDGPU && ACPI
8181
select MFD_CORE
8282
select PM_GENERIC_DOMAINS if PM
8383
help

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1713,6 +1713,10 @@ static inline bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) { retu
17131713
static inline bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev) { return false; }
17141714
#endif
17151715

1716+
#if defined(CONFIG_DRM_AMD_ISP)
1717+
int amdgpu_acpi_get_isp4_dev_hid(u8 (*hid)[ACPI_ID_LEN]);
1718+
#endif
1719+
17161720
void amdgpu_register_gpu_instance(struct amdgpu_device *adev);
17171721
void amdgpu_unregister_gpu_instance(struct amdgpu_device *adev);
17181722

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

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1532,5 +1532,35 @@ bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev)
15321532
return true;
15331533
#endif /* CONFIG_AMD_PMC */
15341534
}
1535-
15361535
#endif /* CONFIG_SUSPEND */
1536+
1537+
#if IS_ENABLED(CONFIG_DRM_AMD_ISP)
1538+
static const struct acpi_device_id isp_sensor_ids[] = {
1539+
{ "OMNI5C10" },
1540+
{ }
1541+
};
1542+
1543+
static int isp_match_acpi_device_ids(struct device *dev, const void *data)
1544+
{
1545+
return acpi_match_device(data, dev) ? 1 : 0;
1546+
}
1547+
1548+
int amdgpu_acpi_get_isp4_dev_hid(u8 (*hid)[ACPI_ID_LEN])
1549+
{
1550+
struct device *pdev __free(put_device) = NULL;
1551+
struct acpi_device *acpi_pdev;
1552+
1553+
pdev = bus_find_device(&platform_bus_type, NULL, isp_sensor_ids,
1554+
isp_match_acpi_device_ids);
1555+
if (!pdev)
1556+
return -EINVAL;
1557+
1558+
acpi_pdev = ACPI_COMPANION(pdev);
1559+
if (!acpi_pdev)
1560+
return -ENODEV;
1561+
1562+
strscpy(*hid, acpi_device_hid(acpi_pdev));
1563+
1564+
return 0;
1565+
}
1566+
#endif /* CONFIG_DRM_AMD_ISP */

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,9 @@ void amdgpu_amdkfd_free_gtt_mem(struct amdgpu_device *adev, void **mem_obj)
368368
{
369369
struct amdgpu_bo **bo = (struct amdgpu_bo **) mem_obj;
370370

371+
if (!bo || !*bo)
372+
return;
373+
371374
(void)amdgpu_bo_reserve(*bo, true);
372375
amdgpu_bo_kunmap(*bo);
373376
amdgpu_bo_unpin(*bo);

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

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ long amdgpu_ctx_mgr_entity_flush(struct amdgpu_ctx_mgr *mgr, long timeout)
919919
return timeout;
920920
}
921921

922-
void amdgpu_ctx_mgr_entity_fini(struct amdgpu_ctx_mgr *mgr)
922+
static void amdgpu_ctx_mgr_entity_fini(struct amdgpu_ctx_mgr *mgr)
923923
{
924924
struct amdgpu_ctx *ctx;
925925
struct idr *idp;
@@ -949,19 +949,7 @@ void amdgpu_ctx_mgr_entity_fini(struct amdgpu_ctx_mgr *mgr)
949949

950950
void amdgpu_ctx_mgr_fini(struct amdgpu_ctx_mgr *mgr)
951951
{
952-
struct amdgpu_ctx *ctx;
953-
struct idr *idp;
954-
uint32_t id;
955-
956952
amdgpu_ctx_mgr_entity_fini(mgr);
957-
958-
idp = &mgr->ctx_handles;
959-
960-
idr_for_each_entry(idp, ctx, id) {
961-
if (kref_put(&ctx->refcount, amdgpu_ctx_fini) != 1)
962-
DRM_ERROR("ctx %p is still alive\n", ctx);
963-
}
964-
965953
idr_destroy(&mgr->ctx_handles);
966954
mutex_destroy(&mgr->lock);
967955
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ int amdgpu_ctx_wait_prev_fence(struct amdgpu_ctx *ctx,
9292

9393
void amdgpu_ctx_mgr_init(struct amdgpu_ctx_mgr *mgr,
9494
struct amdgpu_device *adev);
95-
void amdgpu_ctx_mgr_entity_fini(struct amdgpu_ctx_mgr *mgr);
9695
long amdgpu_ctx_mgr_entity_flush(struct amdgpu_ctx_mgr *mgr, long timeout);
9796
void amdgpu_ctx_mgr_fini(struct amdgpu_ctx_mgr *mgr);
9897
void amdgpu_ctx_mgr_usage(struct amdgpu_ctx_mgr *mgr,

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -512,12 +512,13 @@ void amdgpu_device_detect_runtime_pm_mode(struct amdgpu_device *adev)
512512
break;
513513
case CHIP_VEGA10:
514514
/* enable BACO as runpm mode if noretry=0 */
515-
if (!adev->gmc.noretry)
515+
if (!adev->gmc.noretry && !amdgpu_passthrough(adev))
516516
adev->pm.rpm_mode = AMDGPU_RUNPM_BACO;
517517
break;
518518
default:
519519
/* enable BACO as runpm mode on CI+ */
520-
adev->pm.rpm_mode = AMDGPU_RUNPM_BACO;
520+
if (!amdgpu_passthrough(adev))
521+
adev->pm.rpm_mode = AMDGPU_RUNPM_BACO;
521522
break;
522523
}
523524

@@ -4728,7 +4729,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
47284729

47294730
amdgpu_fru_sysfs_init(adev);
47304731
amdgpu_reg_state_sysfs_init(adev);
4731-
amdgpu_xcp_cfg_sysfs_init(adev);
4732+
amdgpu_xcp_sysfs_init(adev);
47324733

47334734
if (IS_ENABLED(CONFIG_PERF_EVENTS))
47344735
r = amdgpu_pmu_init(adev);
@@ -4858,7 +4859,7 @@ void amdgpu_device_fini_hw(struct amdgpu_device *adev)
48584859
amdgpu_fru_sysfs_fini(adev);
48594860

48604861
amdgpu_reg_state_sysfs_fini(adev);
4861-
amdgpu_xcp_cfg_sysfs_fini(adev);
4862+
amdgpu_xcp_sysfs_fini(adev);
48624863

48634864
/* disable ras feature must before hw fini */
48644865
amdgpu_ras_pre_fini(adev);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2913,8 +2913,8 @@ static int amdgpu_drm_release(struct inode *inode, struct file *filp)
29132913

29142914
if (fpriv) {
29152915
fpriv->evf_mgr.fd_closing = true;
2916-
amdgpu_userq_mgr_fini(&fpriv->userq_mgr);
29172916
amdgpu_eviction_fence_destroy(&fpriv->evf_mgr);
2917+
amdgpu_userq_mgr_fini(&fpriv->userq_mgr);
29182918
}
29192919

29202920
return drm_release(inode, filp);

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,22 @@ amdgpu_eviction_fence_suspend_worker(struct work_struct *work)
108108
struct amdgpu_eviction_fence *ev_fence;
109109

110110
mutex_lock(&uq_mgr->userq_mutex);
111+
spin_lock(&evf_mgr->ev_fence_lock);
111112
ev_fence = evf_mgr->ev_fence;
112-
if (!ev_fence)
113+
if (ev_fence)
114+
dma_fence_get(&ev_fence->base);
115+
else
113116
goto unlock;
117+
spin_unlock(&evf_mgr->ev_fence_lock);
114118

115119
amdgpu_userq_evict(uq_mgr, ev_fence);
116120

121+
mutex_unlock(&uq_mgr->userq_mutex);
122+
dma_fence_put(&ev_fence->base);
123+
return;
124+
117125
unlock:
126+
spin_unlock(&evf_mgr->ev_fence_lock);
118127
mutex_unlock(&uq_mgr->userq_mutex);
119128
}
120129

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,11 +1502,6 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev,
15021502
amdgpu_bo_unreserve(pd);
15031503
}
15041504

1505-
if (!fpriv->evf_mgr.fd_closing) {
1506-
fpriv->evf_mgr.fd_closing = true;
1507-
amdgpu_userq_mgr_fini(&fpriv->userq_mgr);
1508-
amdgpu_eviction_fence_destroy(&fpriv->evf_mgr);
1509-
}
15101505
amdgpu_ctx_mgr_fini(&fpriv->ctx_mgr);
15111506
amdgpu_vm_fini(adev, &fpriv->vm);
15121507

0 commit comments

Comments
 (0)