Skip to content

Commit

Permalink
Merge branch 'drm-fixes-5.0' of git://people.freedesktop.org/~agd5f/l…
Browse files Browse the repository at this point in the history
…inux 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
  • Loading branch information
Dave Airlie committed Feb 15, 2019
2 parents 5016bd2 + 1d69511 commit 7abbb35
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 20 deletions.
9 changes: 7 additions & 2 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@ static int psp_sw_fini(void *handle)
adev->psp.sos_fw = NULL;
release_firmware(adev->psp.asd_fw);
adev->psp.asd_fw = NULL;
release_firmware(adev->psp.ta_fw);
adev->psp.ta_fw = NULL;
if (adev->psp.ta_fw) {
release_firmware(adev->psp.ta_fw);
adev->psp.ta_fw = NULL;
}
return 0;
}

Expand Down Expand Up @@ -435,6 +437,9 @@ static int psp_xgmi_initialize(struct psp_context *psp)
struct ta_xgmi_shared_memory *xgmi_cmd;
int ret;

if (!psp->adev->psp.ta_fw)
return -ENOENT;

if (!psp->xgmi_context.initialized) {
ret = psp_xgmi_init_shared_buf(psp);
if (ret)
Expand Down
28 changes: 16 additions & 12 deletions drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,22 @@ static int psp_v11_0_init_microcode(struct psp_context *psp)

snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_ta.bin", chip_name);
err = request_firmware(&adev->psp.ta_fw, fw_name, adev->dev);
if (err)
goto out2;

err = amdgpu_ucode_validate(adev->psp.ta_fw);
if (err)
goto out2;

ta_hdr = (const struct ta_firmware_header_v1_0 *)adev->psp.ta_fw->data;
adev->psp.ta_xgmi_ucode_version = le32_to_cpu(ta_hdr->ta_xgmi_ucode_version);
adev->psp.ta_xgmi_ucode_size = le32_to_cpu(ta_hdr->ta_xgmi_size_bytes);
adev->psp.ta_xgmi_start_addr = (uint8_t *)ta_hdr +
le32_to_cpu(ta_hdr->header.ucode_array_offset_bytes);
if (err) {
release_firmware(adev->psp.ta_fw);
adev->psp.ta_fw = NULL;
dev_info(adev->dev,
"psp v11.0: Failed to load firmware \"%s\"\n", fw_name);
} else {
err = amdgpu_ucode_validate(adev->psp.ta_fw);
if (err)
goto out2;

ta_hdr = (const struct ta_firmware_header_v1_0 *)adev->psp.ta_fw->data;
adev->psp.ta_xgmi_ucode_version = le32_to_cpu(ta_hdr->ta_xgmi_ucode_version);
adev->psp.ta_xgmi_ucode_size = le32_to_cpu(ta_hdr->ta_xgmi_size_bytes);
adev->psp.ta_xgmi_start_addr = (uint8_t *)ta_hdr +
le32_to_cpu(ta_hdr->header.ucode_array_offset_bytes);
}

return 0;

Expand Down
22 changes: 21 additions & 1 deletion drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,25 @@ static ssize_t dp_phy_test_pattern_debugfs_write(struct file *f, const char __us
return bytes_from_user;
}

/*
* Returns the min and max vrr vfreq through the connector's debugfs file.
* Example usage: cat /sys/kernel/debug/dri/0/DP-1/vrr_range
*/
static int vrr_range_show(struct seq_file *m, void *data)
{
struct drm_connector *connector = m->private;
struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);

if (connector->status != connector_status_connected)
return -ENODEV;

seq_printf(m, "Min: %u\n", (unsigned int)aconnector->min_vfreq);
seq_printf(m, "Max: %u\n", (unsigned int)aconnector->max_vfreq);

return 0;
}
DEFINE_SHOW_ATTRIBUTE(vrr_range);

static const struct file_operations dp_link_settings_debugfs_fops = {
.owner = THIS_MODULE,
.read = dp_link_settings_read,
Expand All @@ -697,7 +716,8 @@ static const struct {
} dp_debugfs_entries[] = {
{"link_settings", &dp_link_settings_debugfs_fops},
{"phy_settings", &dp_phy_settings_debugfs_fop},
{"test_pattern", &dp_phy_test_pattern_fops}
{"test_pattern", &dp_phy_test_pattern_fops},
{"vrr_range", &vrr_range_fops}
};

int connector_debugfs_init(struct amdgpu_dm_connector *connector)
Expand Down
7 changes: 2 additions & 5 deletions drivers/gpu/drm/scheduler/sched_entity.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,13 +440,10 @@ struct drm_sched_job *drm_sched_entity_pop_job(struct drm_sched_entity *entity)

while ((entity->dependency =
sched->ops->dependency(sched_job, entity))) {
trace_drm_sched_job_wait_dep(sched_job, entity->dependency);

if (drm_sched_entity_add_dependency_cb(entity)) {

trace_drm_sched_job_wait_dep(sched_job,
entity->dependency);
if (drm_sched_entity_add_dependency_cb(entity))
return NULL;
}
}

/* skip jobs from entity that marked guilty */
Expand Down

0 comments on commit 7abbb35

Please sign in to comment.