Skip to content

Commit af8caa0

Browse files
committed
Merge DRM changes from upstream v6.17-rc6..v6.17-rc7
NOTE: This commit does not compile due to missing RHEL-specific fix-ups, which are split out into separate Git commits following this one. If git bisect selected this commit, run "git bisect skip" and try again. Repeat this until it selects a commit which compiles. This commit was generated using: rhdrm-merge-drm v6.17-rc7 RHEL-113577 JIRA: https://issues.redhat.com/browse/RHEL-113577 Conflicts: drivers/gpu/drm/xe/xe_nvm.c Conflict resolution: Commit list: commit 07c2494 commit 013e484 commit fef8b64 commit dcfd151 commit 7926ba2 commit a10f910 commit c1b6b8c commit 29a2f43 commit 35e5263 commit 288dac9 commit cbc7f3b commit f9b8051 commit ff89a4d commit ae5fbbd commit 26caeae commit 2ade36e commit 9272bb3 commit f5a9c2b commit b55caa6 commit feb96cc Signed-off-by: José Expósito <jexposit@redhat.com>
1 parent c2702cb commit af8caa0

27 files changed

+337
-99
lines changed

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,16 +250,24 @@ void amdgpu_amdkfd_interrupt(struct amdgpu_device *adev,
250250

251251
void amdgpu_amdkfd_suspend(struct amdgpu_device *adev, bool suspend_proc)
252252
{
253-
if (adev->kfd.dev)
254-
kgd2kfd_suspend(adev->kfd.dev, suspend_proc);
253+
if (adev->kfd.dev) {
254+
if (adev->in_s0ix)
255+
kgd2kfd_stop_sched_all_nodes(adev->kfd.dev);
256+
else
257+
kgd2kfd_suspend(adev->kfd.dev, suspend_proc);
258+
}
255259
}
256260

257261
int amdgpu_amdkfd_resume(struct amdgpu_device *adev, bool resume_proc)
258262
{
259263
int r = 0;
260264

261-
if (adev->kfd.dev)
262-
r = kgd2kfd_resume(adev->kfd.dev, resume_proc);
265+
if (adev->kfd.dev) {
266+
if (adev->in_s0ix)
267+
r = kgd2kfd_start_sched_all_nodes(adev->kfd.dev);
268+
else
269+
r = kgd2kfd_resume(adev->kfd.dev, resume_proc);
270+
}
263271

264272
return r;
265273
}

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,9 @@ void kgd2kfd_smi_event_throttle(struct kfd_dev *kfd, uint64_t throttle_bitmask);
426426
int kgd2kfd_check_and_lock_kfd(struct kfd_dev *kfd);
427427
void kgd2kfd_unlock_kfd(struct kfd_dev *kfd);
428428
int kgd2kfd_start_sched(struct kfd_dev *kfd, uint32_t node_id);
429+
int kgd2kfd_start_sched_all_nodes(struct kfd_dev *kfd);
429430
int kgd2kfd_stop_sched(struct kfd_dev *kfd, uint32_t node_id);
431+
int kgd2kfd_stop_sched_all_nodes(struct kfd_dev *kfd);
430432
bool kgd2kfd_compute_active(struct kfd_dev *kfd, uint32_t node_id);
431433
bool kgd2kfd_vmfault_fast_path(struct amdgpu_device *adev, struct amdgpu_iv_entry *entry,
432434
bool retry_fault);
@@ -516,11 +518,21 @@ static inline int kgd2kfd_start_sched(struct kfd_dev *kfd, uint32_t node_id)
516518
return 0;
517519
}
518520

521+
static inline int kgd2kfd_start_sched_all_nodes(struct kfd_dev *kfd)
522+
{
523+
return 0;
524+
}
525+
519526
static inline int kgd2kfd_stop_sched(struct kfd_dev *kfd, uint32_t node_id)
520527
{
521528
return 0;
522529
}
523530

531+
static inline int kgd2kfd_stop_sched_all_nodes(struct kfd_dev *kfd)
532+
{
533+
return 0;
534+
}
535+
524536
static inline bool kgd2kfd_compute_active(struct kfd_dev *kfd, uint32_t node_id)
525537
{
526538
return false;

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

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5136,7 +5136,7 @@ int amdgpu_device_suspend(struct drm_device *dev, bool notify_clients)
51365136
adev->in_suspend = true;
51375137

51385138
if (amdgpu_sriov_vf(adev)) {
5139-
if (!adev->in_s0ix && !adev->in_runpm)
5139+
if (!adev->in_runpm)
51405140
amdgpu_amdkfd_suspend_process(adev);
51415141
amdgpu_virt_fini_data_exchange(adev);
51425142
r = amdgpu_virt_request_full_gpu(adev, false);
@@ -5156,10 +5156,8 @@ int amdgpu_device_suspend(struct drm_device *dev, bool notify_clients)
51565156

51575157
amdgpu_device_ip_suspend_phase1(adev);
51585158

5159-
if (!adev->in_s0ix) {
5160-
amdgpu_amdkfd_suspend(adev, !amdgpu_sriov_vf(adev) && !adev->in_runpm);
5161-
amdgpu_userq_suspend(adev);
5162-
}
5159+
amdgpu_amdkfd_suspend(adev, !amdgpu_sriov_vf(adev) && !adev->in_runpm);
5160+
amdgpu_userq_suspend(adev);
51635161

51645162
r = amdgpu_device_evict_resources(adev);
51655163
if (r)
@@ -5254,15 +5252,13 @@ int amdgpu_device_resume(struct drm_device *dev, bool notify_clients)
52545252
goto exit;
52555253
}
52565254

5257-
if (!adev->in_s0ix) {
5258-
r = amdgpu_amdkfd_resume(adev, !amdgpu_sriov_vf(adev) && !adev->in_runpm);
5259-
if (r)
5260-
goto exit;
5255+
r = amdgpu_amdkfd_resume(adev, !amdgpu_sriov_vf(adev) && !adev->in_runpm);
5256+
if (r)
5257+
goto exit;
52615258

5262-
r = amdgpu_userq_resume(adev);
5263-
if (r)
5264-
goto exit;
5265-
}
5259+
r = amdgpu_userq_resume(adev);
5260+
if (r)
5261+
goto exit;
52665262

52675263
r = amdgpu_device_ip_late_init(adev);
52685264
if (r)
@@ -5275,7 +5271,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool notify_clients)
52755271
amdgpu_virt_init_data_exchange(adev);
52765272
amdgpu_virt_release_full_gpu(adev, true);
52775273

5278-
if (!adev->in_s0ix && !r && !adev->in_runpm)
5274+
if (!r && !adev->in_runpm)
52795275
r = amdgpu_amdkfd_resume_process(adev);
52805276
}
52815277

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,6 +1654,21 @@ static int gfx_v11_0_sw_init(struct amdgpu_ip_block *ip_block)
16541654
}
16551655
}
16561656
break;
1657+
case IP_VERSION(11, 0, 1):
1658+
case IP_VERSION(11, 0, 4):
1659+
adev->gfx.cleaner_shader_ptr = gfx_11_0_3_cleaner_shader_hex;
1660+
adev->gfx.cleaner_shader_size = sizeof(gfx_11_0_3_cleaner_shader_hex);
1661+
if (adev->gfx.pfp_fw_version >= 102 &&
1662+
adev->gfx.mec_fw_version >= 66 &&
1663+
adev->mes.fw_version[0] >= 128) {
1664+
adev->gfx.enable_cleaner_shader = true;
1665+
r = amdgpu_gfx_cleaner_shader_sw_init(adev, adev->gfx.cleaner_shader_size);
1666+
if (r) {
1667+
adev->gfx.enable_cleaner_shader = false;
1668+
dev_err(adev->dev, "Failed to initialize cleaner shader\n");
1669+
}
1670+
}
1671+
break;
16571672
case IP_VERSION(11, 5, 0):
16581673
case IP_VERSION(11, 5, 1):
16591674
adev->gfx.cleaner_shader_ptr = gfx_11_0_3_cleaner_shader_hex;

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,6 +1550,25 @@ int kgd2kfd_start_sched(struct kfd_dev *kfd, uint32_t node_id)
15501550
return ret;
15511551
}
15521552

1553+
int kgd2kfd_start_sched_all_nodes(struct kfd_dev *kfd)
1554+
{
1555+
struct kfd_node *node;
1556+
int i, r;
1557+
1558+
if (!kfd->init_complete)
1559+
return 0;
1560+
1561+
for (i = 0; i < kfd->num_nodes; i++) {
1562+
node = kfd->nodes[i];
1563+
r = node->dqm->ops.unhalt(node->dqm);
1564+
if (r) {
1565+
dev_err(kfd_device, "Error in starting scheduler\n");
1566+
return r;
1567+
}
1568+
}
1569+
return 0;
1570+
}
1571+
15531572
int kgd2kfd_stop_sched(struct kfd_dev *kfd, uint32_t node_id)
15541573
{
15551574
struct kfd_node *node;
@@ -1567,6 +1586,23 @@ int kgd2kfd_stop_sched(struct kfd_dev *kfd, uint32_t node_id)
15671586
return node->dqm->ops.halt(node->dqm);
15681587
}
15691588

1589+
int kgd2kfd_stop_sched_all_nodes(struct kfd_dev *kfd)
1590+
{
1591+
struct kfd_node *node;
1592+
int i, r;
1593+
1594+
if (!kfd->init_complete)
1595+
return 0;
1596+
1597+
for (i = 0; i < kfd->num_nodes; i++) {
1598+
node = kfd->nodes[i];
1599+
r = node->dqm->ops.halt(node->dqm);
1600+
if (r)
1601+
return r;
1602+
}
1603+
return 0;
1604+
}
1605+
15701606
bool kgd2kfd_compute_active(struct kfd_dev *kfd, uint32_t node_id)
15711607
{
15721608
struct kfd_node *node;

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

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8717,7 +8717,16 @@ static int amdgpu_dm_encoder_init(struct drm_device *dev,
87178717
static void manage_dm_interrupts(struct amdgpu_device *adev,
87188718
struct amdgpu_crtc *acrtc,
87198719
struct dm_crtc_state *acrtc_state)
8720-
{
8720+
{ /*
8721+
* We cannot be sure that the frontend index maps to the same
8722+
* backend index - some even map to more than one.
8723+
* So we have to go through the CRTC to find the right IRQ.
8724+
*/
8725+
int irq_type = amdgpu_display_crtc_idx_to_irq_type(
8726+
adev,
8727+
acrtc->crtc_id);
8728+
struct drm_device *dev = adev_to_drm(adev);
8729+
87218730
struct drm_vblank_crtc_config config = {0};
87228731
struct dc_crtc_timing *timing;
87238732
int offdelay;
@@ -8770,7 +8779,35 @@ static void manage_dm_interrupts(struct amdgpu_device *adev,
87708779

87718780
drm_crtc_vblank_on_config(&acrtc->base,
87728781
&config);
8782+
/* Allow RX6xxx, RX7700, RX7800 GPUs to call amdgpu_irq_get.*/
8783+
switch (amdgpu_ip_version(adev, DCE_HWIP, 0)) {
8784+
case IP_VERSION(3, 0, 0):
8785+
case IP_VERSION(3, 0, 2):
8786+
case IP_VERSION(3, 0, 3):
8787+
case IP_VERSION(3, 2, 0):
8788+
if (amdgpu_irq_get(adev, &adev->pageflip_irq, irq_type))
8789+
drm_err(dev, "DM_IRQ: Cannot get pageflip irq!\n");
8790+
#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
8791+
if (amdgpu_irq_get(adev, &adev->vline0_irq, irq_type))
8792+
drm_err(dev, "DM_IRQ: Cannot get vline0 irq!\n");
8793+
#endif
8794+
}
8795+
87738796
} else {
8797+
/* Allow RX6xxx, RX7700, RX7800 GPUs to call amdgpu_irq_put.*/
8798+
switch (amdgpu_ip_version(adev, DCE_HWIP, 0)) {
8799+
case IP_VERSION(3, 0, 0):
8800+
case IP_VERSION(3, 0, 2):
8801+
case IP_VERSION(3, 0, 3):
8802+
case IP_VERSION(3, 2, 0):
8803+
#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
8804+
if (amdgpu_irq_put(adev, &adev->vline0_irq, irq_type))
8805+
drm_err(dev, "DM_IRQ: Cannot put vline0 irq!\n");
8806+
#endif
8807+
if (amdgpu_irq_put(adev, &adev->pageflip_irq, irq_type))
8808+
drm_err(dev, "DM_IRQ: Cannot put pageflip irq!\n");
8809+
}
8810+
87748811
drm_crtc_vblank_off(&acrtc->base);
87758812
}
87768813
}

drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2236,7 +2236,7 @@ static int smu_resume(struct amdgpu_ip_block *ip_block)
22362236
return ret;
22372237
}
22382238

2239-
if (smu_dpm_ctx->dpm_level == AMD_DPM_FORCED_LEVEL_MANUAL) {
2239+
if (smu_dpm_ctx->dpm_level == AMD_DPM_FORCED_LEVEL_MANUAL && smu->od_enabled) {
22402240
ret = smu_od_edit_dpm_table(smu, PP_OD_COMMIT_DPM_TABLE, NULL, 0);
22412241
if (ret)
22422242
return ret;

drivers/gpu/drm/bridge/analogix/anx7625.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2677,7 +2677,7 @@ static int anx7625_i2c_probe(struct i2c_client *client)
26772677
ret = devm_request_threaded_irq(dev, platform->pdata.intp_irq,
26782678
NULL, anx7625_intr_hpd_isr,
26792679
IRQF_TRIGGER_FALLING |
2680-
IRQF_ONESHOT,
2680+
IRQF_ONESHOT | IRQF_NO_AUTOEN,
26812681
"anx7625-intp", platform);
26822682
if (ret) {
26832683
DRM_DEV_ERROR(dev, "fail to request irq\n");
@@ -2746,8 +2746,10 @@ static int anx7625_i2c_probe(struct i2c_client *client)
27462746
}
27472747

27482748
/* Add work function */
2749-
if (platform->pdata.intp_irq)
2749+
if (platform->pdata.intp_irq) {
2750+
enable_irq(platform->pdata.intp_irq);
27502751
queue_work(platform->workqueue, &platform->work);
2752+
}
27512753

27522754
if (platform->pdata.audio_en)
27532755
anx7625_register_audio(dev, platform);

drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1985,8 +1985,10 @@ static void cdns_mhdp_atomic_enable(struct drm_bridge *bridge,
19851985
mhdp_state = to_cdns_mhdp_bridge_state(new_state);
19861986

19871987
mhdp_state->current_mode = drm_mode_duplicate(bridge->dev, mode);
1988-
if (!mhdp_state->current_mode)
1989-
return;
1988+
if (!mhdp_state->current_mode) {
1989+
ret = -EINVAL;
1990+
goto out;
1991+
}
19901992

19911993
drm_mode_set_name(mhdp_state->current_mode);
19921994

drivers/gpu/drm/drm_gpuvm.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2432,8 +2432,6 @@ static const struct drm_gpuvm_ops lock_ops = {
24322432
*
24332433
* The expected usage is::
24342434
*
2435-
* .. code-block:: c
2436-
*
24372435
* vm_bind {
24382436
* struct drm_exec exec;
24392437
*

0 commit comments

Comments
 (0)