Skip to content

Commit 7abbb35

Browse files
committed
Merge branch 'drm-fixes-5.0' of git://people.freedesktop.org/~agd5f/linux into drm-fixes
amdgpu: - Vega20 psp fix - Add vrr range to debugfs for freesync debugging sched: - Scheduler race fix Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexdeucher@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190213202958.3336-1-alexander.deucher@amd.com
2 parents 5016bd2 + 1d69511 commit 7abbb35

File tree

4 files changed

+46
-20
lines changed

4 files changed

+46
-20
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,10 @@ static int psp_sw_fini(void *handle)
9090
adev->psp.sos_fw = NULL;
9191
release_firmware(adev->psp.asd_fw);
9292
adev->psp.asd_fw = NULL;
93-
release_firmware(adev->psp.ta_fw);
94-
adev->psp.ta_fw = NULL;
93+
if (adev->psp.ta_fw) {
94+
release_firmware(adev->psp.ta_fw);
95+
adev->psp.ta_fw = NULL;
96+
}
9597
return 0;
9698
}
9799

@@ -435,6 +437,9 @@ static int psp_xgmi_initialize(struct psp_context *psp)
435437
struct ta_xgmi_shared_memory *xgmi_cmd;
436438
int ret;
437439

440+
if (!psp->adev->psp.ta_fw)
441+
return -ENOENT;
442+
438443
if (!psp->xgmi_context.initialized) {
439444
ret = psp_xgmi_init_shared_buf(psp);
440445
if (ret)

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

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -152,18 +152,22 @@ static int psp_v11_0_init_microcode(struct psp_context *psp)
152152

153153
snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_ta.bin", chip_name);
154154
err = request_firmware(&adev->psp.ta_fw, fw_name, adev->dev);
155-
if (err)
156-
goto out2;
157-
158-
err = amdgpu_ucode_validate(adev->psp.ta_fw);
159-
if (err)
160-
goto out2;
161-
162-
ta_hdr = (const struct ta_firmware_header_v1_0 *)adev->psp.ta_fw->data;
163-
adev->psp.ta_xgmi_ucode_version = le32_to_cpu(ta_hdr->ta_xgmi_ucode_version);
164-
adev->psp.ta_xgmi_ucode_size = le32_to_cpu(ta_hdr->ta_xgmi_size_bytes);
165-
adev->psp.ta_xgmi_start_addr = (uint8_t *)ta_hdr +
166-
le32_to_cpu(ta_hdr->header.ucode_array_offset_bytes);
155+
if (err) {
156+
release_firmware(adev->psp.ta_fw);
157+
adev->psp.ta_fw = NULL;
158+
dev_info(adev->dev,
159+
"psp v11.0: Failed to load firmware \"%s\"\n", fw_name);
160+
} else {
161+
err = amdgpu_ucode_validate(adev->psp.ta_fw);
162+
if (err)
163+
goto out2;
164+
165+
ta_hdr = (const struct ta_firmware_header_v1_0 *)adev->psp.ta_fw->data;
166+
adev->psp.ta_xgmi_ucode_version = le32_to_cpu(ta_hdr->ta_xgmi_ucode_version);
167+
adev->psp.ta_xgmi_ucode_size = le32_to_cpu(ta_hdr->ta_xgmi_size_bytes);
168+
adev->psp.ta_xgmi_start_addr = (uint8_t *)ta_hdr +
169+
le32_to_cpu(ta_hdr->header.ucode_array_offset_bytes);
170+
}
167171

168172
return 0;
169173

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

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,25 @@ static ssize_t dp_phy_test_pattern_debugfs_write(struct file *f, const char __us
671671
return bytes_from_user;
672672
}
673673

674+
/*
675+
* Returns the min and max vrr vfreq through the connector's debugfs file.
676+
* Example usage: cat /sys/kernel/debug/dri/0/DP-1/vrr_range
677+
*/
678+
static int vrr_range_show(struct seq_file *m, void *data)
679+
{
680+
struct drm_connector *connector = m->private;
681+
struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
682+
683+
if (connector->status != connector_status_connected)
684+
return -ENODEV;
685+
686+
seq_printf(m, "Min: %u\n", (unsigned int)aconnector->min_vfreq);
687+
seq_printf(m, "Max: %u\n", (unsigned int)aconnector->max_vfreq);
688+
689+
return 0;
690+
}
691+
DEFINE_SHOW_ATTRIBUTE(vrr_range);
692+
674693
static const struct file_operations dp_link_settings_debugfs_fops = {
675694
.owner = THIS_MODULE,
676695
.read = dp_link_settings_read,
@@ -697,7 +716,8 @@ static const struct {
697716
} dp_debugfs_entries[] = {
698717
{"link_settings", &dp_link_settings_debugfs_fops},
699718
{"phy_settings", &dp_phy_settings_debugfs_fop},
700-
{"test_pattern", &dp_phy_test_pattern_fops}
719+
{"test_pattern", &dp_phy_test_pattern_fops},
720+
{"vrr_range", &vrr_range_fops}
701721
};
702722

703723
int connector_debugfs_init(struct amdgpu_dm_connector *connector)

drivers/gpu/drm/scheduler/sched_entity.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -440,13 +440,10 @@ struct drm_sched_job *drm_sched_entity_pop_job(struct drm_sched_entity *entity)
440440

441441
while ((entity->dependency =
442442
sched->ops->dependency(sched_job, entity))) {
443+
trace_drm_sched_job_wait_dep(sched_job, entity->dependency);
443444

444-
if (drm_sched_entity_add_dependency_cb(entity)) {
445-
446-
trace_drm_sched_job_wait_dep(sched_job,
447-
entity->dependency);
445+
if (drm_sched_entity_add_dependency_cb(entity))
448446
return NULL;
449-
}
450447
}
451448

452449
/* skip jobs from entity that marked guilty */

0 commit comments

Comments
 (0)