Skip to content

Commit ea6ec77

Browse files
committed
Merge tag 'drm-next-2020-08-12' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "This has a few vmwgfx regression fixes we hit from the merge window (one in TTM), it also has a bunch of amdgpu fixes along with a scattering everywhere else. core: - Fix drm_dp_mst_port refcount leaks in drm_dp_mst_allocate_vcpi - Remove null check for kfree in drm_dev_release. - Fix DRM_FORMAT_MOD_AMLOGIC_FBC definition. - re-added docs for drm_gem_flink_ioctl() - add orientation quirk for ASUS T103HAF ttm: - ttm: fix page-offset calculation within TTM - revert patch causing vmwgfx regressions fbcon: - Fix a fbcon OOB read in fbdev, found by syzbot. vga: - Mark vga_tryget static as it's not used elsewhere. amdgpu: - Re-add spelling typo fix - Sienna Cichlid fixes - Navy Flounder fixes - DC fixes - SMU i2c fix - Power fixes vmwgfx: - regression fixes for modesetting crashes - misc fixes xlnx: - Small fixes to xlnx. omap: - Fix mode initialization in omap_connector_mode_valid(). - force runtime PM suspend on system suspend tidss: - fix modeset init for DPI panels" * tag 'drm-next-2020-08-12' of git://anongit.freedesktop.org/drm/drm: (70 commits) drm/ttm: revert "drm/ttm: make TT creation purely optional v3" drm/vmwgfx: fix spelling mistake "Cant" -> "Can't" drm/vmwgfx: fix spelling mistake "Cound" -> "Could" drm/vmwgfx/ldu: Use drm_mode_config_reset drm/vmwgfx/sou: Use drm_mode_config_reset drm/vmwgfx/stdu: Use drm_mode_config_reset drm/vmwgfx: Fix two list_for_each loop exit tests drm/vmwgfx: Use correct vmw_legacy_display_unit pointer drm/vmwgfx: Use struct_size() helper drm/amdgpu: Fix bug where DPM is not enabled after hibernate and resume drm/amd/powerplay: put VCN/JPEG into PG ungate state before dpm table setup(V3) drm/amd/powerplay: update swSMU VCN/JPEG PG logics drm/amdgpu: use mode1 reset by default for sienna_cichlid drm/amdgpu/smu: rework i2c adpater registration drm/amd/display: Display goes blank after inst drm/amd/display: Change null plane state swizzle mode to 4kb_s drm/amd/display: Use helper function to check for HDMI signal drm/amd/display: AMD OUI (DPCD 0x00300) skipped on some sink drm/amd/display: Fix logger context drm/amd/display: populate new dml variable ...
2 parents 9ad57f6 + 62975d2 commit ea6ec77

Some content is hidden

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

84 files changed

+903
-382
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2574,14 +2574,16 @@ static int amdgpu_device_ip_reinit_early_sriov(struct amdgpu_device *adev)
25742574
AMD_IP_BLOCK_TYPE_IH,
25752575
};
25762576

2577+
for (i = 0; i < adev->num_ip_blocks; i++)
2578+
adev->ip_blocks[i].status.hw = false;
2579+
25772580
for (i = 0; i < ARRAY_SIZE(ip_order); i++) {
25782581
int j;
25792582
struct amdgpu_ip_block *block;
25802583

25812584
for (j = 0; j < adev->num_ip_blocks; j++) {
25822585
block = &adev->ip_blocks[j];
25832586

2584-
block->status.hw = false;
25852587
if (block->version->type != ip_order[i] ||
25862588
!block->status.valid)
25872589
continue;

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3212,6 +3212,12 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj,
32123212
attr == &sensor_dev_attr_fan1_enable.dev_attr.attr))
32133213
return 0;
32143214

3215+
/* Skip crit temp on APU */
3216+
if ((adev->flags & AMD_IS_APU) && (adev->family >= AMDGPU_FAMILY_CZ) &&
3217+
(attr == &sensor_dev_attr_temp1_crit.dev_attr.attr ||
3218+
attr == &sensor_dev_attr_temp1_crit_hyst.dev_attr.attr))
3219+
return 0;
3220+
32153221
/* Skip limit attributes if DPM is not enabled */
32163222
if (!adev->pm.dpm_enabled &&
32173223
(attr == &sensor_dev_attr_temp1_crit.dev_attr.attr ||

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

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,18 @@ static int psp_sw_fini(void *handle)
193193
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
194194

195195
psp_memory_training_fini(&adev->psp);
196-
release_firmware(adev->psp.sos_fw);
197-
adev->psp.sos_fw = NULL;
198-
release_firmware(adev->psp.asd_fw);
199-
adev->psp.asd_fw = NULL;
200-
release_firmware(adev->psp.ta_fw);
201-
adev->psp.ta_fw = NULL;
196+
if (adev->psp.sos_fw) {
197+
release_firmware(adev->psp.sos_fw);
198+
adev->psp.sos_fw = NULL;
199+
}
200+
if (adev->psp.asd_fw) {
201+
release_firmware(adev->psp.asd_fw);
202+
adev->psp.asd_fw = NULL;
203+
}
204+
if (adev->psp.ta_fw) {
205+
release_firmware(adev->psp.ta_fw);
206+
adev->psp.ta_fw = NULL;
207+
}
202208

203209
if (adev->asic_type == CHIP_NAVI10)
204210
psp_sysfs_fini(adev);
@@ -409,11 +415,28 @@ static int psp_clear_vf_fw(struct psp_context *psp)
409415
return ret;
410416
}
411417

418+
static bool psp_skip_tmr(struct psp_context *psp)
419+
{
420+
switch (psp->adev->asic_type) {
421+
case CHIP_NAVI12:
422+
case CHIP_SIENNA_CICHLID:
423+
return true;
424+
default:
425+
return false;
426+
}
427+
}
428+
412429
static int psp_tmr_load(struct psp_context *psp)
413430
{
414431
int ret;
415432
struct psp_gfx_cmd_resp *cmd;
416433

434+
/* For Navi12 and CHIP_SIENNA_CICHLID SRIOV, do not set up TMR.
435+
* Already set up by host driver.
436+
*/
437+
if (amdgpu_sriov_vf(psp->adev) && psp_skip_tmr(psp))
438+
return 0;
439+
417440
cmd = kzalloc(sizeof(struct psp_gfx_cmd_resp), GFP_KERNEL);
418441
if (!cmd)
419442
return -ENOMEM;
@@ -1987,7 +2010,7 @@ static int psp_suspend(void *handle)
19872010

19882011
ret = psp_tmr_terminate(psp);
19892012
if (ret) {
1990-
DRM_ERROR("Falied to terminate tmr\n");
2013+
DRM_ERROR("Failed to terminate tmr\n");
19912014
return ret;
19922015
}
19932016

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1618,7 +1618,7 @@ static int amdgpu_ras_save_bad_pages(struct amdgpu_device *adev)
16181618
data = con->eh_data;
16191619
save_count = data->count - control->num_recs;
16201620
/* only new entries are saved */
1621-
if (save_count > 0)
1621+
if (save_count > 0) {
16221622
if (amdgpu_ras_eeprom_process_recods(control,
16231623
&data->bps[control->num_recs],
16241624
true,
@@ -1627,6 +1627,9 @@ static int amdgpu_ras_save_bad_pages(struct amdgpu_device *adev)
16271627
return -EIO;
16281628
}
16291629

1630+
dev_info(adev->dev, "Saved %d pages to EEPROM table.\n", save_count);
1631+
}
1632+
16301633
return 0;
16311634
}
16321635

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3082,7 +3082,7 @@ static const struct soc15_reg_golden golden_settings_gc_10_3[] =
30823082
SOC15_REG_GOLDEN_VALUE(GC, 0, mmCGTT_SPI_RA0_CLK_CTRL, 0xff7f0fff, 0x30000100),
30833083
SOC15_REG_GOLDEN_VALUE(GC, 0, mmCGTT_SPI_RA1_CLK_CTRL, 0xff7f0fff, 0x7e000100),
30843084
SOC15_REG_GOLDEN_VALUE(GC, 0, mmCPF_GCR_CNTL, 0x0007ffff, 0x0000c000),
3085-
SOC15_REG_GOLDEN_VALUE(GC, 0, mmDB_DEBUG3, 0xffffffff, 0x00000200),
3085+
SOC15_REG_GOLDEN_VALUE(GC, 0, mmDB_DEBUG3, 0xffffffff, 0x00000280),
30863086
SOC15_REG_GOLDEN_VALUE(GC, 0, mmDB_DEBUG4, 0xffffffff, 0x00800000),
30873087
SOC15_REG_GOLDEN_VALUE(GC, 0, mmDB_EXCEPTION_CONTROL, 0x7fff0f1f, 0x00b80000),
30883088
SOC15_REG_GOLDEN_VALUE(GC, 0, mmGCR_GENERAL_CNTL_Sienna_Cichlid, 0x1ff1ffff, 0x00000500),
@@ -3127,7 +3127,7 @@ static const struct soc15_reg_golden golden_settings_gc_10_3_2[] =
31273127
SOC15_REG_GOLDEN_VALUE(GC, 0, mmCGTT_SPI_RA0_CLK_CTRL, 0xff7f0fff, 0x30000100),
31283128
SOC15_REG_GOLDEN_VALUE(GC, 0, mmCGTT_SPI_RA1_CLK_CTRL, 0xff7f0fff, 0x7e000100),
31293129
SOC15_REG_GOLDEN_VALUE(GC, 0, mmCPF_GCR_CNTL, 0x0007ffff, 0x0000c000),
3130-
SOC15_REG_GOLDEN_VALUE(GC, 0, mmDB_DEBUG3, 0xffffffff, 0x00000200),
3130+
SOC15_REG_GOLDEN_VALUE(GC, 0, mmDB_DEBUG3, 0xffffffff, 0x00000280),
31313131
SOC15_REG_GOLDEN_VALUE(GC, 0, mmDB_DEBUG4, 0xffffffff, 0x00800000),
31323132
SOC15_REG_GOLDEN_VALUE(GC, 0, mmDB_EXCEPTION_CONTROL, 0x7fff0f1f, 0x00b80000),
31333133
SOC15_REG_GOLDEN_VALUE(GC, 0, mmGCR_GENERAL_CNTL_Sienna_Cichlid, 0x1ff1ffff, 0x00000500),
@@ -3158,7 +3158,7 @@ static const struct soc15_reg_golden golden_settings_gc_10_3_2[] =
31583158
SOC15_REG_GOLDEN_VALUE(GC, 0, mmSQ_PERFCOUNTER7_SELECT, 0xf0f001ff, 0x00000000),
31593159
SOC15_REG_GOLDEN_VALUE(GC, 0, mmSQ_PERFCOUNTER8_SELECT, 0xf0f001ff, 0x00000000),
31603160
SOC15_REG_GOLDEN_VALUE(GC, 0, mmSQ_PERFCOUNTER9_SELECT, 0xf0f001ff, 0x00000000),
3161-
SOC15_REG_GOLDEN_VALUE(GC, 0, mmTA_CNTL_AUX, 0xffffffff, 0x010b0000),
3161+
SOC15_REG_GOLDEN_VALUE(GC, 0, mmTA_CNTL_AUX, 0xfff7ffff, 0x01030000),
31623162
SOC15_REG_GOLDEN_VALUE(GC, 0, mmUTCL1_CTRL, 0xffbfffff, 0x00a00000),
31633163
SOC15_REG_GOLDEN_VALUE(GC, 0, mmVGT_GS_MAX_WAVE_ID, 0x00000fff, 0x000003ff)
31643164
};
@@ -7529,6 +7529,7 @@ static int gfx_v10_0_set_powergating_state(void *handle,
75297529
case CHIP_NAVI14:
75307530
case CHIP_NAVI12:
75317531
case CHIP_SIENNA_CICHLID:
7532+
case CHIP_NAVY_FLOUNDER:
75327533
amdgpu_gfx_off_ctrl(adev, enable);
75337534
break;
75347535
default:

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,11 @@ static int jpeg_v3_0_set_powergating_state(void *handle,
4949
static int jpeg_v3_0_early_init(void *handle)
5050
{
5151
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
52-
if (adev->asic_type == CHIP_SIENNA_CICHLID) {
53-
u32 harvest = RREG32_SOC15(JPEG, 0, mmCC_UVD_HARVESTING);
52+
u32 harvest = RREG32_SOC15(JPEG, 0, mmCC_UVD_HARVESTING);
53+
54+
if (harvest & CC_UVD_HARVESTING__UVD_DISABLE_MASK)
55+
return -ENOENT;
5456

55-
if (harvest & CC_UVD_HARVESTING__UVD_DISABLE_MASK)
56-
return -ENOENT;
57-
}
5857
adev->jpeg.num_jpeg_inst = 1;
5958

6059
jpeg_v3_0_set_dec_ring_funcs(adev);

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

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,49 @@ static void nv_pcie_wreg(struct amdgpu_device *adev, u32 reg, u32 v)
9797
spin_unlock_irqrestore(&adev->pcie_idx_lock, flags);
9898
}
9999

100+
static u64 nv_pcie_rreg64(struct amdgpu_device *adev, u32 reg)
101+
{
102+
unsigned long flags, address, data;
103+
u64 r;
104+
address = adev->nbio.funcs->get_pcie_index_offset(adev);
105+
data = adev->nbio.funcs->get_pcie_data_offset(adev);
106+
107+
spin_lock_irqsave(&adev->pcie_idx_lock, flags);
108+
/* read low 32 bit */
109+
WREG32(address, reg);
110+
(void)RREG32(address);
111+
r = RREG32(data);
112+
113+
/* read high 32 bit*/
114+
WREG32(address, reg + 4);
115+
(void)RREG32(address);
116+
r |= ((u64)RREG32(data) << 32);
117+
spin_unlock_irqrestore(&adev->pcie_idx_lock, flags);
118+
return r;
119+
}
120+
121+
static void nv_pcie_wreg64(struct amdgpu_device *adev, u32 reg, u64 v)
122+
{
123+
unsigned long flags, address, data;
124+
125+
address = adev->nbio.funcs->get_pcie_index_offset(adev);
126+
data = adev->nbio.funcs->get_pcie_data_offset(adev);
127+
128+
spin_lock_irqsave(&adev->pcie_idx_lock, flags);
129+
/* write low 32 bit */
130+
WREG32(address, reg);
131+
(void)RREG32(address);
132+
WREG32(data, (u32)(v & 0xffffffffULL));
133+
(void)RREG32(data);
134+
135+
/* write high 32 bit */
136+
WREG32(address, reg + 4);
137+
(void)RREG32(address);
138+
WREG32(data, (u32)(v >> 32));
139+
(void)RREG32(data);
140+
spin_unlock_irqrestore(&adev->pcie_idx_lock, flags);
141+
}
142+
100143
static u32 nv_didt_rreg(struct amdgpu_device *adev, u32 reg)
101144
{
102145
unsigned long flags, address, data;
@@ -319,10 +362,15 @@ nv_asic_reset_method(struct amdgpu_device *adev)
319362
dev_warn(adev->dev, "Specified reset method:%d isn't supported, using AUTO instead.\n",
320363
amdgpu_reset_method);
321364

322-
if (smu_baco_is_support(smu))
323-
return AMD_RESET_METHOD_BACO;
324-
else
365+
switch (adev->asic_type) {
366+
case CHIP_SIENNA_CICHLID:
325367
return AMD_RESET_METHOD_MODE1;
368+
default:
369+
if (smu_baco_is_support(smu))
370+
return AMD_RESET_METHOD_BACO;
371+
else
372+
return AMD_RESET_METHOD_MODE1;
373+
}
326374
}
327375

328376
static int nv_asic_reset(struct amdgpu_device *adev)
@@ -673,6 +721,8 @@ static int nv_common_early_init(void *handle)
673721
adev->smc_wreg = NULL;
674722
adev->pcie_rreg = &nv_pcie_rreg;
675723
adev->pcie_wreg = &nv_pcie_wreg;
724+
adev->pcie_rreg64 = &nv_pcie_rreg64;
725+
adev->pcie_wreg64 = &nv_pcie_wreg64;
676726

677727
/* TODO: will add them during VCN v2 implementation */
678728
adev->uvd_ctx_rreg = NULL;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1659,7 +1659,7 @@ static const struct amdgpu_ring_funcs vcn_v3_0_dec_ring_vm_funcs = {
16591659
.emit_ib = vcn_v2_0_dec_ring_emit_ib,
16601660
.emit_fence = vcn_v2_0_dec_ring_emit_fence,
16611661
.emit_vm_flush = vcn_v2_0_dec_ring_emit_vm_flush,
1662-
.test_ring = amdgpu_vcn_dec_ring_test_ring,
1662+
.test_ring = vcn_v2_0_dec_ring_test_ring,
16631663
.test_ib = amdgpu_vcn_dec_ring_test_ib,
16641664
.insert_nop = vcn_v2_0_dec_ring_insert_nop,
16651665
.insert_start = vcn_v2_0_dec_ring_insert_start,

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

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ MODULE_FIRMWARE(FIRMWARE_RENOIR_DMUB);
9797
#if defined(CONFIG_DRM_AMD_DC_DCN3_0)
9898
#define FIRMWARE_SIENNA_CICHLID_DMUB "amdgpu/sienna_cichlid_dmcub.bin"
9999
MODULE_FIRMWARE(FIRMWARE_SIENNA_CICHLID_DMUB);
100+
#define FIRMWARE_NAVY_FLOUNDER_DMUB "amdgpu/navy_flounder_dmcub.bin"
101+
MODULE_FIRMWARE(FIRMWARE_NAVY_FLOUNDER_DMUB);
100102
#endif
101103

102104
#define FIRMWARE_RAVEN_DMCU "amdgpu/raven_dmcu.bin"
@@ -1185,10 +1187,13 @@ static int dm_dmub_sw_init(struct amdgpu_device *adev)
11851187
break;
11861188
#if defined(CONFIG_DRM_AMD_DC_DCN3_0)
11871189
case CHIP_SIENNA_CICHLID:
1188-
case CHIP_NAVY_FLOUNDER:
11891190
dmub_asic = DMUB_ASIC_DCN30;
11901191
fw_name_dmub = FIRMWARE_SIENNA_CICHLID_DMUB;
11911192
break;
1193+
case CHIP_NAVY_FLOUNDER:
1194+
dmub_asic = DMUB_ASIC_DCN30;
1195+
fw_name_dmub = FIRMWARE_NAVY_FLOUNDER_DMUB;
1196+
break;
11921197
#endif
11931198

11941199
default:
@@ -8544,6 +8549,29 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
85448549
if (ret)
85458550
goto fail;
85468551

8552+
/* Check connector changes */
8553+
for_each_oldnew_connector_in_state(state, connector, old_con_state, new_con_state, i) {
8554+
struct dm_connector_state *dm_old_con_state = to_dm_connector_state(old_con_state);
8555+
struct dm_connector_state *dm_new_con_state = to_dm_connector_state(new_con_state);
8556+
8557+
/* Skip connectors that are disabled or part of modeset already. */
8558+
if (!old_con_state->crtc && !new_con_state->crtc)
8559+
continue;
8560+
8561+
if (!new_con_state->crtc)
8562+
continue;
8563+
8564+
new_crtc_state = drm_atomic_get_crtc_state(state, new_con_state->crtc);
8565+
if (IS_ERR(new_crtc_state)) {
8566+
ret = PTR_ERR(new_crtc_state);
8567+
goto fail;
8568+
}
8569+
8570+
if (dm_old_con_state->abm_level !=
8571+
dm_new_con_state->abm_level)
8572+
new_crtc_state->connectors_changed = true;
8573+
}
8574+
85478575
#if defined(CONFIG_DRM_AMD_DC_DCN)
85488576
if (adev->asic_type >= CHIP_NAVI10) {
85498577
for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "dmub/dmub_srv.h"
3636
#include "resource.h"
3737
#include "dsc.h"
38+
#include "dc_link_dp.h"
3839

3940
struct dmub_debugfs_trace_header {
4041
uint32_t entry_count;
@@ -1150,7 +1151,7 @@ static ssize_t dp_dsc_slice_height_read(struct file *f, char __user *buf,
11501151
return result;
11511152
}
11521153

1153-
static ssize_t dp_dsc_bytes_per_pixel_read(struct file *f, char __user *buf,
1154+
static ssize_t dp_dsc_bits_per_pixel_read(struct file *f, char __user *buf,
11541155
size_t size, loff_t *pos)
11551156
{
11561157
char *rd_buf = NULL;
@@ -1186,7 +1187,7 @@ static ssize_t dp_dsc_bytes_per_pixel_read(struct file *f, char __user *buf,
11861187

11871188
snprintf(rd_buf_ptr, str_len,
11881189
"%d\n",
1189-
dsc_state.dsc_bytes_per_pixel);
1190+
dsc_state.dsc_bits_per_pixel);
11901191
rd_buf_ptr += str_len;
11911192

11921193
while (size) {
@@ -1460,9 +1461,9 @@ static const struct file_operations dp_dsc_slice_height_debugfs_fops = {
14601461
.llseek = default_llseek
14611462
};
14621463

1463-
static const struct file_operations dp_dsc_bytes_per_pixel_debugfs_fops = {
1464+
static const struct file_operations dp_dsc_bits_per_pixel_debugfs_fops = {
14641465
.owner = THIS_MODULE,
1465-
.read = dp_dsc_bytes_per_pixel_read,
1466+
.read = dp_dsc_bits_per_pixel_read,
14661467
.llseek = default_llseek
14671468
};
14681469

@@ -1552,7 +1553,7 @@ static const struct {
15521553
{"dsc_clock_en", &dp_dsc_clock_en_debugfs_fops},
15531554
{"dsc_slice_width", &dp_dsc_slice_width_debugfs_fops},
15541555
{"dsc_slice_height", &dp_dsc_slice_height_debugfs_fops},
1555-
{"dsc_bytes_per_pixel", &dp_dsc_bytes_per_pixel_debugfs_fops},
1556+
{"dsc_bits_per_pixel", &dp_dsc_bits_per_pixel_debugfs_fops},
15561557
{"dsc_pic_width", &dp_dsc_pic_width_debugfs_fops},
15571558
{"dsc_pic_height", &dp_dsc_pic_height_debugfs_fops},
15581559
{"dsc_chunk_size", &dp_dsc_chunk_size_debugfs_fops},

0 commit comments

Comments
 (0)