aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2018-07-29 20:39:22 -0400
committerDave Airlie <airlied@redhat.com>2018-07-29 20:39:22 -0400
commit3fce4618279373efc59a91adb16c11da46cd69e5 (patch)
tree086fad6c9f260a0bcc9b6a3532c6cddc387dd907 /drivers/gpu/drm/amd
parentecd7963f7cf967009882fd56eaee1e87a229bea2 (diff)
parentacb1872577b346bd15ab3a3f8dff780d6cca4b70 (diff)
BackMerge v4.18-rc7 into drm-next
rmk requested this for armada and I think we've had a few conflicts build up. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c47
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c1
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c3
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c1
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c8
-rw-r--r--drivers/gpu/drm/amd/display/dc/dc.h1
-rw-r--r--drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c2
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/vega12_processpptables.c2
8 files changed, 49 insertions, 16 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
index f4c474a95875..71efcf38f11b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
@@ -57,6 +57,10 @@
57#define ACP_I2S_COMP2_CAP_REG_OFFSET 0xa8 57#define ACP_I2S_COMP2_CAP_REG_OFFSET 0xa8
58#define ACP_I2S_COMP1_PLAY_REG_OFFSET 0x6c 58#define ACP_I2S_COMP1_PLAY_REG_OFFSET 0x6c
59#define ACP_I2S_COMP2_PLAY_REG_OFFSET 0x68 59#define ACP_I2S_COMP2_PLAY_REG_OFFSET 0x68
60#define ACP_BT_PLAY_REGS_START 0x14970
61#define ACP_BT_PLAY_REGS_END 0x14a24
62#define ACP_BT_COMP1_REG_OFFSET 0xac
63#define ACP_BT_COMP2_REG_OFFSET 0xa8
60 64
61#define mmACP_PGFSM_RETAIN_REG 0x51c9 65#define mmACP_PGFSM_RETAIN_REG 0x51c9
62#define mmACP_PGFSM_CONFIG_REG 0x51ca 66#define mmACP_PGFSM_CONFIG_REG 0x51ca
@@ -77,7 +81,7 @@
77#define ACP_SOFT_RESET_DONE_TIME_OUT_VALUE 0x000000FF 81#define ACP_SOFT_RESET_DONE_TIME_OUT_VALUE 0x000000FF
78 82
79#define ACP_TIMEOUT_LOOP 0x000000FF 83#define ACP_TIMEOUT_LOOP 0x000000FF
80#define ACP_DEVS 3 84#define ACP_DEVS 4
81#define ACP_SRC_ID 162 85#define ACP_SRC_ID 162
82 86
83enum { 87enum {
@@ -316,14 +320,13 @@ static int acp_hw_init(void *handle)
316 if (adev->acp.acp_cell == NULL) 320 if (adev->acp.acp_cell == NULL)
317 return -ENOMEM; 321 return -ENOMEM;
318 322
319 adev->acp.acp_res = kcalloc(4, sizeof(struct resource), GFP_KERNEL); 323 adev->acp.acp_res = kcalloc(5, sizeof(struct resource), GFP_KERNEL);
320
321 if (adev->acp.acp_res == NULL) { 324 if (adev->acp.acp_res == NULL) {
322 kfree(adev->acp.acp_cell); 325 kfree(adev->acp.acp_cell);
323 return -ENOMEM; 326 return -ENOMEM;
324 } 327 }
325 328
326 i2s_pdata = kcalloc(2, sizeof(struct i2s_platform_data), GFP_KERNEL); 329 i2s_pdata = kcalloc(3, sizeof(struct i2s_platform_data), GFP_KERNEL);
327 if (i2s_pdata == NULL) { 330 if (i2s_pdata == NULL) {
328 kfree(adev->acp.acp_res); 331 kfree(adev->acp.acp_res);
329 kfree(adev->acp.acp_cell); 332 kfree(adev->acp.acp_cell);
@@ -358,6 +361,20 @@ static int acp_hw_init(void *handle)
358 i2s_pdata[1].i2s_reg_comp1 = ACP_I2S_COMP1_CAP_REG_OFFSET; 361 i2s_pdata[1].i2s_reg_comp1 = ACP_I2S_COMP1_CAP_REG_OFFSET;
359 i2s_pdata[1].i2s_reg_comp2 = ACP_I2S_COMP2_CAP_REG_OFFSET; 362 i2s_pdata[1].i2s_reg_comp2 = ACP_I2S_COMP2_CAP_REG_OFFSET;
360 363
364 i2s_pdata[2].quirks = DW_I2S_QUIRK_COMP_REG_OFFSET;
365 switch (adev->asic_type) {
366 case CHIP_STONEY:
367 i2s_pdata[2].quirks |= DW_I2S_QUIRK_16BIT_IDX_OVERRIDE;
368 break;
369 default:
370 break;
371 }
372
373 i2s_pdata[2].cap = DWC_I2S_PLAY | DWC_I2S_RECORD;
374 i2s_pdata[2].snd_rates = SNDRV_PCM_RATE_8000_96000;
375 i2s_pdata[2].i2s_reg_comp1 = ACP_BT_COMP1_REG_OFFSET;
376 i2s_pdata[2].i2s_reg_comp2 = ACP_BT_COMP2_REG_OFFSET;
377
361 adev->acp.acp_res[0].name = "acp2x_dma"; 378 adev->acp.acp_res[0].name = "acp2x_dma";
362 adev->acp.acp_res[0].flags = IORESOURCE_MEM; 379 adev->acp.acp_res[0].flags = IORESOURCE_MEM;
363 adev->acp.acp_res[0].start = acp_base; 380 adev->acp.acp_res[0].start = acp_base;
@@ -373,13 +390,18 @@ static int acp_hw_init(void *handle)
373 adev->acp.acp_res[2].start = acp_base + ACP_I2S_CAP_REGS_START; 390 adev->acp.acp_res[2].start = acp_base + ACP_I2S_CAP_REGS_START;
374 adev->acp.acp_res[2].end = acp_base + ACP_I2S_CAP_REGS_END; 391 adev->acp.acp_res[2].end = acp_base + ACP_I2S_CAP_REGS_END;
375 392
376 adev->acp.acp_res[3].name = "acp2x_dma_irq"; 393 adev->acp.acp_res[3].name = "acp2x_dw_bt_i2s_play_cap";
377 adev->acp.acp_res[3].flags = IORESOURCE_IRQ; 394 adev->acp.acp_res[3].flags = IORESOURCE_MEM;
378 adev->acp.acp_res[3].start = amdgpu_irq_create_mapping(adev, 162); 395 adev->acp.acp_res[3].start = acp_base + ACP_BT_PLAY_REGS_START;
379 adev->acp.acp_res[3].end = adev->acp.acp_res[3].start; 396 adev->acp.acp_res[3].end = acp_base + ACP_BT_PLAY_REGS_END;
397
398 adev->acp.acp_res[4].name = "acp2x_dma_irq";
399 adev->acp.acp_res[4].flags = IORESOURCE_IRQ;
400 adev->acp.acp_res[4].start = amdgpu_irq_create_mapping(adev, 162);
401 adev->acp.acp_res[4].end = adev->acp.acp_res[4].start;
380 402
381 adev->acp.acp_cell[0].name = "acp_audio_dma"; 403 adev->acp.acp_cell[0].name = "acp_audio_dma";
382 adev->acp.acp_cell[0].num_resources = 4; 404 adev->acp.acp_cell[0].num_resources = 5;
383 adev->acp.acp_cell[0].resources = &adev->acp.acp_res[0]; 405 adev->acp.acp_cell[0].resources = &adev->acp.acp_res[0];
384 adev->acp.acp_cell[0].platform_data = &adev->asic_type; 406 adev->acp.acp_cell[0].platform_data = &adev->asic_type;
385 adev->acp.acp_cell[0].pdata_size = sizeof(adev->asic_type); 407 adev->acp.acp_cell[0].pdata_size = sizeof(adev->asic_type);
@@ -396,6 +418,12 @@ static int acp_hw_init(void *handle)
396 adev->acp.acp_cell[2].platform_data = &i2s_pdata[1]; 418 adev->acp.acp_cell[2].platform_data = &i2s_pdata[1];
397 adev->acp.acp_cell[2].pdata_size = sizeof(struct i2s_platform_data); 419 adev->acp.acp_cell[2].pdata_size = sizeof(struct i2s_platform_data);
398 420
421 adev->acp.acp_cell[3].name = "designware-i2s";
422 adev->acp.acp_cell[3].num_resources = 1;
423 adev->acp.acp_cell[3].resources = &adev->acp.acp_res[3];
424 adev->acp.acp_cell[3].platform_data = &i2s_pdata[2];
425 adev->acp.acp_cell[3].pdata_size = sizeof(struct i2s_platform_data);
426
399 r = mfd_add_hotplug_devices(adev->acp.parent, adev->acp.acp_cell, 427 r = mfd_add_hotplug_devices(adev->acp.parent, adev->acp.acp_cell,
400 ACP_DEVS); 428 ACP_DEVS);
401 if (r) 429 if (r)
@@ -451,7 +479,6 @@ static int acp_hw_init(void *handle)
451 val = cgs_read_register(adev->acp.cgs_device, mmACP_SOFT_RESET); 479 val = cgs_read_register(adev->acp.cgs_device, mmACP_SOFT_RESET);
452 val &= ~ACP_SOFT_RESET__SoftResetAud_MASK; 480 val &= ~ACP_SOFT_RESET__SoftResetAud_MASK;
453 cgs_write_register(adev->acp.cgs_device, mmACP_SOFT_RESET, val); 481 cgs_write_register(adev->acp.cgs_device, mmACP_SOFT_RESET, val);
454
455 return 0; 482 return 0;
456} 483}
457 484
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
index b33f1680c9a3..a028661d9e20 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
@@ -575,6 +575,7 @@ static const struct amdgpu_px_quirk amdgpu_px_quirk_list[] = {
575 { 0x1002, 0x6900, 0x1002, 0x0124, AMDGPU_PX_QUIRK_FORCE_ATPX }, 575 { 0x1002, 0x6900, 0x1002, 0x0124, AMDGPU_PX_QUIRK_FORCE_ATPX },
576 { 0x1002, 0x6900, 0x1028, 0x0812, AMDGPU_PX_QUIRK_FORCE_ATPX }, 576 { 0x1002, 0x6900, 0x1028, 0x0812, AMDGPU_PX_QUIRK_FORCE_ATPX },
577 { 0x1002, 0x6900, 0x1028, 0x0813, AMDGPU_PX_QUIRK_FORCE_ATPX }, 577 { 0x1002, 0x6900, 0x1028, 0x0813, AMDGPU_PX_QUIRK_FORCE_ATPX },
578 { 0x1002, 0x6900, 0x1025, 0x125A, AMDGPU_PX_QUIRK_FORCE_ATPX },
578 { 0, 0, 0, 0, 0 }, 579 { 0, 0, 0, 0, 0 },
579}; 580};
580 581
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 13acef526c5b..e839470880d7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2843,6 +2843,9 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon)
2843 if (r) 2843 if (r)
2844 return r; 2844 return r;
2845 2845
2846 /* Make sure IB tests flushed */
2847 flush_delayed_work(&adev->late_init_work);
2848
2846 /* blat the mode back in */ 2849 /* blat the mode back in */
2847 if (fbcon) { 2850 if (fbcon) {
2848 if (!amdgpu_device_has_dc_support(adev)) { 2851 if (!amdgpu_device_has_dc_support(adev)) {
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c
index 9f0a217603ad..516795342dd2 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c
@@ -74,4 +74,3 @@ bool dm_read_persistent_data(struct dc_context *ctx,
74 74
75/**** power component interfaces ****/ 75/**** power component interfaces ****/
76 76
77
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
index 9d901ca70588..af9386ee5a93 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
@@ -1781,12 +1781,10 @@ static void dp_test_send_link_training(struct dc_link *link)
1781 dp_retrain_link_dp_test(link, &link_settings, false); 1781 dp_retrain_link_dp_test(link, &link_settings, false);
1782} 1782}
1783 1783
1784/* TODO hbr2 compliance eye output is unstable 1784/* TODO Raven hbr2 compliance eye output is unstable
1785 * (toggling on and off) with debugger break 1785 * (toggling on and off) with debugger break
1786 * This caueses intermittent PHY automation failure 1786 * This caueses intermittent PHY automation failure
1787 * Need to look into the root cause */ 1787 * Need to look into the root cause */
1788static uint8_t force_tps4_for_cp2520 = 1;
1789
1790static void dp_test_send_phy_test_pattern(struct dc_link *link) 1788static void dp_test_send_phy_test_pattern(struct dc_link *link)
1791{ 1789{
1792 union phy_test_pattern dpcd_test_pattern; 1790 union phy_test_pattern dpcd_test_pattern;
@@ -1846,13 +1844,13 @@ static void dp_test_send_phy_test_pattern(struct dc_link *link)
1846 break; 1844 break;
1847 case PHY_TEST_PATTERN_CP2520_1: 1845 case PHY_TEST_PATTERN_CP2520_1:
1848 /* CP2520 pattern is unstable, temporarily use TPS4 instead */ 1846 /* CP2520 pattern is unstable, temporarily use TPS4 instead */
1849 test_pattern = (force_tps4_for_cp2520 == 1) ? 1847 test_pattern = (link->dc->caps.force_dp_tps4_for_cp2520 == 1) ?
1850 DP_TEST_PATTERN_TRAINING_PATTERN4 : 1848 DP_TEST_PATTERN_TRAINING_PATTERN4 :
1851 DP_TEST_PATTERN_HBR2_COMPLIANCE_EYE; 1849 DP_TEST_PATTERN_HBR2_COMPLIANCE_EYE;
1852 break; 1850 break;
1853 case PHY_TEST_PATTERN_CP2520_2: 1851 case PHY_TEST_PATTERN_CP2520_2:
1854 /* CP2520 pattern is unstable, temporarily use TPS4 instead */ 1852 /* CP2520 pattern is unstable, temporarily use TPS4 instead */
1855 test_pattern = (force_tps4_for_cp2520 == 1) ? 1853 test_pattern = (link->dc->caps.force_dp_tps4_for_cp2520 == 1) ?
1856 DP_TEST_PATTERN_TRAINING_PATTERN4 : 1854 DP_TEST_PATTERN_TRAINING_PATTERN4 :
1857 DP_TEST_PATTERN_HBR2_COMPLIANCE_EYE; 1855 DP_TEST_PATTERN_HBR2_COMPLIANCE_EYE;
1858 break; 1856 break;
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index 7515c0dcbdd2..b91f14989aef 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -77,6 +77,7 @@ struct dc_caps {
77 bool is_apu; 77 bool is_apu;
78 bool dual_link_dvi; 78 bool dual_link_dvi;
79 bool post_blend_color_processing; 79 bool post_blend_color_processing;
80 bool force_dp_tps4_for_cp2520;
80}; 81};
81 82
82struct dc_dcc_surface_param { 83struct dc_dcc_surface_param {
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
index cd8c22839227..c39934f8677f 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
@@ -1127,6 +1127,8 @@ static bool construct(
1127 dc->caps.max_slave_planes = 1; 1127 dc->caps.max_slave_planes = 1;
1128 dc->caps.is_apu = true; 1128 dc->caps.is_apu = true;
1129 dc->caps.post_blend_color_processing = false; 1129 dc->caps.post_blend_color_processing = false;
1130 /* Raven DP PHY HBR2 eye diagram pattern is not stable. Use TP4 */
1131 dc->caps.force_dp_tps4_for_cp2520 = true;
1130 1132
1131 if (dc->ctx->dce_environment == DCE_ENV_PRODUCTION_DRV) 1133 if (dc->ctx->dce_environment == DCE_ENV_PRODUCTION_DRV)
1132 dc->debug = debug_defaults_drv; 1134 dc->debug = debug_defaults_drv;
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_processpptables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_processpptables.c
index f4f366b26fd1..cb3a5b1737c8 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_processpptables.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_processpptables.c
@@ -226,6 +226,8 @@ static int append_vbios_pptable(struct pp_hwmgr *hwmgr, PPTable_t *ppsmc_pptable
226 226
227 ppsmc_pptable->Vr2_I2C_address = smc_dpm_table.Vr2_I2C_address; 227 ppsmc_pptable->Vr2_I2C_address = smc_dpm_table.Vr2_I2C_address;
228 228
229 ppsmc_pptable->Vr2_I2C_address = smc_dpm_table.Vr2_I2C_address;
230
229 return 0; 231 return 0;
230} 232}
231 233