Skip to content

Commit 7eb3848

Browse files
committed
Merge tag 'amd-drm-fixes-5.17-2022-02-02' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
amd-drm-fixes-5.17-2022-02-02: amdgpu: - mGPU fan boost fix for beige goby - S0ix fixes - Cyan skillfish hang fix - DCN fixes for DCN 3.1 - DCN fixes for DCN 3.01 - Apple retina panel fix - ttm logic inversion fix Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 26291c5 + e8ae387 commit 7eb3848

File tree

15 files changed

+94
-62
lines changed

15 files changed

+94
-62
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,12 +1408,10 @@ int amdgpu_acpi_smart_shift_update(struct drm_device *dev, enum amdgpu_ss ss_sta
14081408
int amdgpu_acpi_pcie_notify_device_ready(struct amdgpu_device *adev);
14091409

14101410
void amdgpu_acpi_get_backlight_caps(struct amdgpu_dm_backlight_caps *caps);
1411-
bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev);
14121411
void amdgpu_acpi_detect(void);
14131412
#else
14141413
static inline int amdgpu_acpi_init(struct amdgpu_device *adev) { return 0; }
14151414
static inline void amdgpu_acpi_fini(struct amdgpu_device *adev) { }
1416-
static inline bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) { return false; }
14171415
static inline void amdgpu_acpi_detect(void) { }
14181416
static inline bool amdgpu_acpi_is_power_shift_control_supported(void) { return false; }
14191417
static inline int amdgpu_acpi_power_shift_control(struct amdgpu_device *adev,
@@ -1422,6 +1420,14 @@ static inline int amdgpu_acpi_smart_shift_update(struct drm_device *dev,
14221420
enum amdgpu_ss ss_state) { return 0; }
14231421
#endif
14241422

1423+
#if defined(CONFIG_ACPI) && defined(CONFIG_SUSPEND)
1424+
bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev);
1425+
bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev);
1426+
#else
1427+
static inline bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) { return false; }
1428+
static inline bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev) { return false; }
1429+
#endif
1430+
14251431
int amdgpu_cs_find_mapping(struct amdgpu_cs_parser *parser,
14261432
uint64_t addr, struct amdgpu_bo **bo,
14271433
struct amdgpu_bo_va_mapping **mapping);

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

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,6 +1031,20 @@ void amdgpu_acpi_detect(void)
10311031
}
10321032
}
10331033

1034+
#if IS_ENABLED(CONFIG_SUSPEND)
1035+
/**
1036+
* amdgpu_acpi_is_s3_active
1037+
*
1038+
* @adev: amdgpu_device_pointer
1039+
*
1040+
* returns true if supported, false if not.
1041+
*/
1042+
bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev)
1043+
{
1044+
return !(adev->flags & AMD_IS_APU) ||
1045+
(pm_suspend_target_state == PM_SUSPEND_MEM);
1046+
}
1047+
10341048
/**
10351049
* amdgpu_acpi_is_s0ix_active
10361050
*
@@ -1040,11 +1054,24 @@ void amdgpu_acpi_detect(void)
10401054
*/
10411055
bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev)
10421056
{
1043-
#if IS_ENABLED(CONFIG_AMD_PMC) && IS_ENABLED(CONFIG_SUSPEND)
1044-
if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) {
1045-
if (adev->flags & AMD_IS_APU)
1046-
return pm_suspend_target_state == PM_SUSPEND_TO_IDLE;
1057+
if (!(adev->flags & AMD_IS_APU) ||
1058+
(pm_suspend_target_state != PM_SUSPEND_TO_IDLE))
1059+
return false;
1060+
1061+
if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)) {
1062+
dev_warn_once(adev->dev,
1063+
"Power consumption will be higher as BIOS has not been configured for suspend-to-idle.\n"
1064+
"To use suspend-to-idle change the sleep mode in BIOS setup.\n");
1065+
return false;
10471066
}
1048-
#endif
1067+
1068+
#if !IS_ENABLED(CONFIG_AMD_PMC)
1069+
dev_warn_once(adev->dev,
1070+
"Power consumption will be higher as the kernel has not been compiled with CONFIG_AMD_PMC.\n");
10491071
return false;
1072+
#else
1073+
return true;
1074+
#endif /* CONFIG_AMD_PMC */
10501075
}
1076+
1077+
#endif /* CONFIG_SUSPEND */

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2246,13 +2246,20 @@ static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work)
22462246
static int amdgpu_pmops_prepare(struct device *dev)
22472247
{
22482248
struct drm_device *drm_dev = dev_get_drvdata(dev);
2249+
struct amdgpu_device *adev = drm_to_adev(drm_dev);
22492250

22502251
/* Return a positive number here so
22512252
* DPM_FLAG_SMART_SUSPEND works properly
22522253
*/
22532254
if (amdgpu_device_supports_boco(drm_dev))
2254-
return pm_runtime_suspended(dev) &&
2255-
pm_suspend_via_firmware();
2255+
return pm_runtime_suspended(dev);
2256+
2257+
/* if we will not support s3 or s2i for the device
2258+
* then skip suspend
2259+
*/
2260+
if (!amdgpu_acpi_is_s0ix_active(adev) &&
2261+
!amdgpu_acpi_is_s3_active(adev))
2262+
return 1;
22562263

22572264
return 0;
22582265
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1904,7 +1904,7 @@ int amdgpu_copy_buffer(struct amdgpu_ring *ring, uint64_t src_offset,
19041904
unsigned i;
19051905
int r;
19061906

1907-
if (direct_submit && !ring->sched.ready) {
1907+
if (!direct_submit && !ring->sched.ready) {
19081908
DRM_ERROR("Trying to move memory with ring turned off.\n");
19091909
return -EINVAL;
19101910
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,6 +1140,9 @@ static void gmc_v10_0_get_clockgating_state(void *handle, u32 *flags)
11401140
{
11411141
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
11421142

1143+
if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 1, 3))
1144+
return;
1145+
11431146
adev->mmhub.funcs->get_clockgating(adev, flags);
11441147

11451148
if (adev->ip_versions[ATHUB_HWIP][0] >= IP_VERSION(2, 1, 0))

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn301/vg_clk_mgr.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -570,32 +570,32 @@ static struct wm_table lpddr5_wm_table = {
570570
.wm_inst = WM_A,
571571
.wm_type = WM_TYPE_PSTATE_CHG,
572572
.pstate_latency_us = 11.65333,
573-
.sr_exit_time_us = 7.95,
574-
.sr_enter_plus_exit_time_us = 9,
573+
.sr_exit_time_us = 13.5,
574+
.sr_enter_plus_exit_time_us = 16.5,
575575
.valid = true,
576576
},
577577
{
578578
.wm_inst = WM_B,
579579
.wm_type = WM_TYPE_PSTATE_CHG,
580580
.pstate_latency_us = 11.65333,
581-
.sr_exit_time_us = 9.82,
582-
.sr_enter_plus_exit_time_us = 11.196,
581+
.sr_exit_time_us = 13.5,
582+
.sr_enter_plus_exit_time_us = 16.5,
583583
.valid = true,
584584
},
585585
{
586586
.wm_inst = WM_C,
587587
.wm_type = WM_TYPE_PSTATE_CHG,
588588
.pstate_latency_us = 11.65333,
589-
.sr_exit_time_us = 9.89,
590-
.sr_enter_plus_exit_time_us = 11.24,
589+
.sr_exit_time_us = 13.5,
590+
.sr_enter_plus_exit_time_us = 16.5,
591591
.valid = true,
592592
},
593593
{
594594
.wm_inst = WM_D,
595595
.wm_type = WM_TYPE_PSTATE_CHG,
596596
.pstate_latency_us = 11.65333,
597-
.sr_exit_time_us = 9.748,
598-
.sr_enter_plus_exit_time_us = 11.102,
597+
.sr_exit_time_us = 13.5,
598+
.sr_enter_plus_exit_time_us = 16.5,
599599
.valid = true,
600600
},
601601
}

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -329,38 +329,38 @@ static struct clk_bw_params dcn31_bw_params = {
329329

330330
};
331331

332-
static struct wm_table ddr4_wm_table = {
332+
static struct wm_table ddr5_wm_table = {
333333
.entries = {
334334
{
335335
.wm_inst = WM_A,
336336
.wm_type = WM_TYPE_PSTATE_CHG,
337337
.pstate_latency_us = 11.72,
338-
.sr_exit_time_us = 6.09,
339-
.sr_enter_plus_exit_time_us = 7.14,
338+
.sr_exit_time_us = 9,
339+
.sr_enter_plus_exit_time_us = 11,
340340
.valid = true,
341341
},
342342
{
343343
.wm_inst = WM_B,
344344
.wm_type = WM_TYPE_PSTATE_CHG,
345345
.pstate_latency_us = 11.72,
346-
.sr_exit_time_us = 10.12,
347-
.sr_enter_plus_exit_time_us = 11.48,
346+
.sr_exit_time_us = 9,
347+
.sr_enter_plus_exit_time_us = 11,
348348
.valid = true,
349349
},
350350
{
351351
.wm_inst = WM_C,
352352
.wm_type = WM_TYPE_PSTATE_CHG,
353353
.pstate_latency_us = 11.72,
354-
.sr_exit_time_us = 10.12,
355-
.sr_enter_plus_exit_time_us = 11.48,
354+
.sr_exit_time_us = 9,
355+
.sr_enter_plus_exit_time_us = 11,
356356
.valid = true,
357357
},
358358
{
359359
.wm_inst = WM_D,
360360
.wm_type = WM_TYPE_PSTATE_CHG,
361361
.pstate_latency_us = 11.72,
362-
.sr_exit_time_us = 10.12,
363-
.sr_enter_plus_exit_time_us = 11.48,
362+
.sr_exit_time_us = 9,
363+
.sr_enter_plus_exit_time_us = 11,
364364
.valid = true,
365365
},
366366
}
@@ -687,7 +687,7 @@ void dcn31_clk_mgr_construct(
687687
if (ctx->dc_bios->integrated_info->memory_type == LpDdr5MemType) {
688688
dcn31_bw_params.wm_table = lpddr5_wm_table;
689689
} else {
690-
dcn31_bw_params.wm_table = ddr4_wm_table;
690+
dcn31_bw_params.wm_table = ddr5_wm_table;
691691
}
692692
/* Saved clocks configured at boot for debug purposes */
693693
dcn31_dump_clk_registers(&clk_mgr->base.base.boot_snapshot, &clk_mgr->base.base, &log_info);

drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5597,6 +5597,26 @@ static bool retrieve_link_cap(struct dc_link *link)
55975597
dp_hw_fw_revision.ieee_fw_rev,
55985598
sizeof(dp_hw_fw_revision.ieee_fw_rev));
55995599

5600+
/* Quirk for Apple MBP 2018 15" Retina panels: wrong DP_MAX_LINK_RATE */
5601+
{
5602+
uint8_t str_mbp_2018[] = { 101, 68, 21, 103, 98, 97 };
5603+
uint8_t fwrev_mbp_2018[] = { 7, 4 };
5604+
uint8_t fwrev_mbp_2018_vega[] = { 8, 4 };
5605+
5606+
/* We also check for the firmware revision as 16,1 models have an
5607+
* identical device id and are incorrectly quirked otherwise.
5608+
*/
5609+
if ((link->dpcd_caps.sink_dev_id == 0x0010fa) &&
5610+
!memcmp(link->dpcd_caps.sink_dev_id_str, str_mbp_2018,
5611+
sizeof(str_mbp_2018)) &&
5612+
(!memcmp(link->dpcd_caps.sink_fw_revision, fwrev_mbp_2018,
5613+
sizeof(fwrev_mbp_2018)) ||
5614+
!memcmp(link->dpcd_caps.sink_fw_revision, fwrev_mbp_2018_vega,
5615+
sizeof(fwrev_mbp_2018_vega)))) {
5616+
link->reported_link_cap.link_rate = LINK_RATE_RBR2;
5617+
}
5618+
}
5619+
56005620
memset(&link->dpcd_caps.dsc_caps, '\0',
56015621
sizeof(link->dpcd_caps.dsc_caps));
56025622
memset(&link->dpcd_caps.fec_cap, '\0', sizeof(link->dpcd_caps.fec_cap));

drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,11 +1608,6 @@ static enum dc_status apply_single_controller_ctx_to_hw(
16081608
pipe_ctx->stream_res.stream_enc,
16091609
pipe_ctx->stream_res.tg->inst);
16101610

1611-
if (dc_is_embedded_signal(pipe_ctx->stream->signal) &&
1612-
pipe_ctx->stream_res.stream_enc->funcs->reset_fifo)
1613-
pipe_ctx->stream_res.stream_enc->funcs->reset_fifo(
1614-
pipe_ctx->stream_res.stream_enc);
1615-
16161611
if (dc_is_dp_signal(pipe_ctx->stream->signal))
16171612
dp_source_sequence_trace(link, DPCD_SOURCE_SEQ_AFTER_CONNECT_DIG_FE_OTG);
16181613

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -902,19 +902,6 @@ void enc1_stream_encoder_stop_dp_info_packets(
902902

903903
}
904904

905-
void enc1_stream_encoder_reset_fifo(
906-
struct stream_encoder *enc)
907-
{
908-
struct dcn10_stream_encoder *enc1 = DCN10STRENC_FROM_STRENC(enc);
909-
910-
/* set DIG_START to 0x1 to reset FIFO */
911-
REG_UPDATE(DIG_FE_CNTL, DIG_START, 1);
912-
udelay(100);
913-
914-
/* write 0 to take the FIFO out of reset */
915-
REG_UPDATE(DIG_FE_CNTL, DIG_START, 0);
916-
}
917-
918905
void enc1_stream_encoder_dp_blank(
919906
struct dc_link *link,
920907
struct stream_encoder *enc)
@@ -1600,8 +1587,6 @@ static const struct stream_encoder_funcs dcn10_str_enc_funcs = {
16001587
enc1_stream_encoder_send_immediate_sdp_message,
16011588
.stop_dp_info_packets =
16021589
enc1_stream_encoder_stop_dp_info_packets,
1603-
.reset_fifo =
1604-
enc1_stream_encoder_reset_fifo,
16051590
.dp_blank =
16061591
enc1_stream_encoder_dp_blank,
16071592
.dp_unblank =

0 commit comments

Comments
 (0)