Skip to content

Commit 92be423

Browse files
committed
Merge tag 'amd-drm-next-5.9-2020-07-24' of git://people.freedesktop.org/~agd5f/linux into drm-next
amd-drm-next-5.9-2020-07-24: amdgpu: - Misc sienna cichlid fixes - Final bits of swSMU cleanup - Misc display fixes - Misc VCN fixes - Eeprom i2c cleanup - Drop amd vrr_range debugfs in favor of core drm Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents fc01d1f + 922e745 commit 92be423

Some content is hidden

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

53 files changed

+3002
-1950
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2036,3 +2036,20 @@ int amdgpu_atombios_init(struct amdgpu_device *adev)
20362036
return 0;
20372037
}
20382038

2039+
int amdgpu_atombios_get_data_table(struct amdgpu_device *adev,
2040+
uint32_t table,
2041+
uint16_t *size,
2042+
uint8_t *frev,
2043+
uint8_t *crev,
2044+
uint8_t **addr)
2045+
{
2046+
uint16_t data_start;
2047+
2048+
if (!amdgpu_atom_parse_data_header(adev->mode_info.atom_context, table,
2049+
size, frev, crev, &data_start))
2050+
return -EINVAL;
2051+
2052+
*addr = (uint8_t *)adev->mode_info.atom_context->bios + data_start;
2053+
2054+
return 0;
2055+
}

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,13 @@ int amdgpu_atombios_get_svi2_info(struct amdgpu_device *adev,
216216
u8 voltage_type,
217217
u8 *svd_gpio_id, u8 *svc_gpio_id);
218218

219+
int amdgpu_atombios_get_data_table(struct amdgpu_device *adev,
220+
uint32_t table,
221+
uint16_t *size,
222+
uint8_t *frev,
223+
uint8_t *crev,
224+
uint8_t **addr);
225+
219226
void amdgpu_atombios_fini(struct amdgpu_device *adev);
220227
int amdgpu_atombios_init(struct amdgpu_device *adev);
221228

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

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,57 @@ static ssize_t amdgpu_debugfs_gfxoff_write(struct file *f, const char __user *bu
10731073
}
10741074

10751075

1076+
/**
1077+
* amdgpu_debugfs_regs_gfxoff_status - read gfxoff status
1078+
*
1079+
* @f: open file handle
1080+
* @buf: User buffer to store read data in
1081+
* @size: Number of bytes to read
1082+
* @pos: Offset to seek to
1083+
*/
1084+
static ssize_t amdgpu_debugfs_gfxoff_read(struct file *f, char __user *buf,
1085+
size_t size, loff_t *pos)
1086+
{
1087+
struct amdgpu_device *adev = file_inode(f)->i_private;
1088+
ssize_t result = 0;
1089+
int r;
1090+
1091+
if (size & 0x3 || *pos & 0x3)
1092+
return -EINVAL;
1093+
1094+
r = pm_runtime_get_sync(adev->ddev->dev);
1095+
if (r < 0)
1096+
return r;
1097+
1098+
while (size) {
1099+
uint32_t value;
1100+
1101+
r = amdgpu_get_gfx_off_status(adev, &value);
1102+
if (r) {
1103+
pm_runtime_mark_last_busy(adev->ddev->dev);
1104+
pm_runtime_put_autosuspend(adev->ddev->dev);
1105+
return r;
1106+
}
1107+
1108+
r = put_user(value, (uint32_t *)buf);
1109+
if (r) {
1110+
pm_runtime_mark_last_busy(adev->ddev->dev);
1111+
pm_runtime_put_autosuspend(adev->ddev->dev);
1112+
return r;
1113+
}
1114+
1115+
result += 4;
1116+
buf += 4;
1117+
*pos += 4;
1118+
size -= 4;
1119+
}
1120+
1121+
pm_runtime_mark_last_busy(adev->ddev->dev);
1122+
pm_runtime_put_autosuspend(adev->ddev->dev);
1123+
1124+
return result;
1125+
}
1126+
10761127
static const struct file_operations amdgpu_debugfs_regs_fops = {
10771128
.owner = THIS_MODULE,
10781129
.read = amdgpu_debugfs_regs_read,
@@ -1123,7 +1174,9 @@ static const struct file_operations amdgpu_debugfs_gpr_fops = {
11231174

11241175
static const struct file_operations amdgpu_debugfs_gfxoff_fops = {
11251176
.owner = THIS_MODULE,
1177+
.read = amdgpu_debugfs_gfxoff_read,
11261178
.write = amdgpu_debugfs_gfxoff_write,
1179+
.llseek = default_llseek
11271180
};
11281181

11291182
static const struct file_operations *debugfs_regs[] = {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ struct amdgpu_pm {
425425
u32 default_sclk;
426426
u32 default_mclk;
427427
struct amdgpu_i2c_chan *i2c_bus;
428+
bool bus_locked;
428429
/* internal thermal controller on rv6xx+ */
429430
enum amdgpu_int_thermal_type int_thermal_type;
430431
struct device *int_hwmon_dev;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,8 @@ amdgpu_pci_shutdown(struct pci_dev *pdev)
11861186
* unfortunately we can't detect certain
11871187
* hypervisors so just do this all the time.
11881188
*/
1189-
adev->mp1_state = PP_MP1_STATE_UNLOAD;
1189+
if (!amdgpu_passthrough(adev))
1190+
adev->mp1_state = PP_MP1_STATE_UNLOAD;
11901191
amdgpu_device_ip_suspend(adev);
11911192
adev->mp1_state = PP_MP1_STATE_NONE;
11921193
}

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,20 @@ void amdgpu_gfx_off_ctrl(struct amdgpu_device *adev, bool enable)
578578
mutex_unlock(&adev->gfx.gfx_off_mutex);
579579
}
580580

581+
int amdgpu_get_gfx_off_status(struct amdgpu_device *adev, uint32_t *value)
582+
{
583+
584+
int r = 0;
585+
586+
mutex_lock(&adev->gfx.gfx_off_mutex);
587+
588+
r = smu_get_status_gfxoff(adev, value);
589+
590+
mutex_unlock(&adev->gfx.gfx_off_mutex);
591+
592+
return r;
593+
}
594+
581595
int amdgpu_gfx_ras_late_init(struct amdgpu_device *adev)
582596
{
583597
int r;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ void amdgpu_gfx_bit_to_me_queue(struct amdgpu_device *adev, int bit,
378378
bool amdgpu_gfx_is_me_queue_enabled(struct amdgpu_device *adev, int me,
379379
int pipe, int queue);
380380
void amdgpu_gfx_off_ctrl(struct amdgpu_device *adev, bool enable);
381+
int amdgpu_get_gfx_off_status(struct amdgpu_device *adev, uint32_t *value);
381382
int amdgpu_gfx_ras_late_init(struct amdgpu_device *adev);
382383
void amdgpu_gfx_ras_fini(struct amdgpu_device *adev);
383384
int amdgpu_gfx_process_ras_data_cb(struct amdgpu_device *adev,

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -796,8 +796,7 @@ static ssize_t amdgpu_set_pp_od_clk_voltage(struct device *dev,
796796
tmp_str++;
797797
while (isspace(*++tmp_str));
798798

799-
while (tmp_str[0]) {
800-
sub_str = strsep(&tmp_str, delimiter);
799+
while ((sub_str = strsep(&tmp_str, delimiter)) != NULL) {
801800
ret = kstrtol(sub_str, 0, &parameter[parameter_size]);
802801
if (ret)
803802
return -EINVAL;
@@ -1067,8 +1066,7 @@ static ssize_t amdgpu_read_mask(const char *buf, size_t count, uint32_t *mask)
10671066
memcpy(buf_cpy, buf, bytes);
10681067
buf_cpy[bytes] = '\0';
10691068
tmp = buf_cpy;
1070-
while (tmp[0]) {
1071-
sub_str = strsep(&tmp, delimiter);
1069+
while ((sub_str = strsep(&tmp, delimiter)) != NULL) {
10721070
if (strlen(sub_str)) {
10731071
ret = kstrtol(sub_str, 0, &level);
10741072
if (ret)
@@ -1697,8 +1695,7 @@ static ssize_t amdgpu_set_pp_power_profile_mode(struct device *dev,
16971695
i++;
16981696
memcpy(buf_cpy, buf, count-i);
16991697
tmp_str = buf_cpy;
1700-
while (tmp_str[0]) {
1701-
sub_str = strsep(&tmp_str, delimiter);
1698+
while ((sub_str = strsep(&tmp_str, delimiter)) != NULL) {
17021699
ret = kstrtol(sub_str, 0, &parameter[parameter_size]);
17031700
if (ret)
17041701
return -EINVAL;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,6 @@ static int psp_asd_load(struct psp_context *psp)
500500
* TODO: add version check to make it common
501501
*/
502502
if (amdgpu_sriov_vf(psp->adev) ||
503-
(psp->adev->asic_type == CHIP_SIENNA_CICHLID) ||
504503
(psp->adev->asic_type == CHIP_NAVY_FLOUNDER))
505504
return 0;
506505

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ struct amdgpu_ras_eeprom_control {
4747
uint32_t next_addr;
4848
unsigned int num_recs;
4949
struct mutex tbl_mutex;
50-
bool bus_locked;
5150
uint32_t tbl_byte_sum;
5251
uint16_t i2c_address; // 8-bit represented address
5352
};

0 commit comments

Comments
 (0)