[PATCH AUTOSEL 5.19 11/29] drm/amdgpu/mes: zero the sdma_hqd_mask of 2nd SDMA engine for SDMA 6.0.1

2022-10-02 Thread Sasha Levin
From: Yifan Zhang 

[ Upstream commit 0af4ed0c329ebb4cef95fda4fcdbfcdea0255442 ]

there is only one SDMA engine in SDMA 6.0.1, the sdma_hqd_mask has to be
zeroed for the 2nd engine, otherwise MES scheduler will consider 2nd
engine exists and map/unmap SDMA queues to the non-existent engine.

Signed-off-by: Yifan Zhang 
Reviewed-by: Tim Huang 
Signed-off-by: Alex Deucher 
Signed-off-by: Sasha Levin 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
index 69a70a0aaed9..6ab062c63da1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
@@ -169,6 +169,9 @@ int amdgpu_mes_init(struct amdgpu_device *adev)
for (i = 0; i < AMDGPU_MES_MAX_SDMA_PIPES; i++) {
if (adev->ip_versions[SDMA0_HWIP][0] < IP_VERSION(6, 0, 0))
adev->mes.sdma_hqd_mask[i] = i ? 0 : 0x3fc;
+   /* zero sdma_hqd_mask for non-existent engine */
+   else if (adev->sdma.num_instances == 1)
+   adev->mes.sdma_hqd_mask[i] = i ? 0 : 0xfc;
else
adev->mes.sdma_hqd_mask[i] = 0xfc;
}
-- 
2.35.1



[PATCH AUTOSEL 5.19 23/29] drm/amd/display: Fix double cursor on non-video RGB MPO

2022-10-02 Thread Sasha Levin
From: Leo Li 

[ Upstream commit b261509952bc19d1012cf732f853659be6ebc61e ]

[Why]

DC makes use of layer_index (zpos) when picking the HW plane to enable
HW cursor on. However, some compositors will not attach zpos information
to each DRM plane. Consequently, in amdgpu, we default layer_index to 0
and do not update it.

This causes said DC logic to enable HW cursor on all planes of the same
layer_index, which manifests as a double cursor issue if one of the
planes is scaled (and hence scaling the cursor as well).

[How]

Use DRM core helpers to calculate a normalized_zpos value for each
drm_plane_state under each crtc, within the atomic state.

This helper will first consider existing zpos values, and if
identical/unset, fallback to plane ID ordering.

The normalized_zpos is then passed to dc_plane_info during atomic check
for later use by the cursor logic.

Reviewed-by: Bhawanpreet Lakha 
Acked-by: Wayne Lin 
Signed-off-by: Leo Li 
Tested-by: Daniel Wheeler 
Signed-off-by: Alex Deucher 
Signed-off-by: Sasha Levin 
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 0424570c736f..c781f92db959 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -5629,7 +5629,7 @@ fill_dc_plane_info_and_addr(struct amdgpu_device *adev,
plane_info->visible = true;
plane_info->stereo_format = PLANE_STEREO_FORMAT_NONE;
 
-   plane_info->layer_index = 0;
+   plane_info->layer_index = plane_state->normalized_zpos;
 
ret = fill_plane_color_attributes(plane_state, plane_info->format,
  &plane_info->color_space);
@@ -5697,7 +5697,7 @@ static int fill_dc_plane_attributes(struct amdgpu_device 
*adev,
dc_plane_state->global_alpha = plane_info.global_alpha;
dc_plane_state->global_alpha_value = plane_info.global_alpha_value;
dc_plane_state->dcc = plane_info.dcc;
-   dc_plane_state->layer_index = plane_info.layer_index; // Always returns 0
+   dc_plane_state->layer_index = plane_info.layer_index;
dc_plane_state->flip_int_enabled = true;
 
/*
@@ -11147,6 +11147,14 @@ static int amdgpu_dm_atomic_check(struct drm_device 
*dev,
}
}
 
+   /*
+* DC consults the zpos (layer_index in DC terminology) to determine the
+* hw plane on which to enable the hw cursor (see
+* `dcn10_can_pipe_disable_cursor`). By now, all modified planes are in
+* atomic state, so call drm helper to normalize zpos.
+*/
+   drm_atomic_normalize_zpos(dev, state);
+
/* Remove exiting planes if they are modified */
for_each_oldnew_plane_in_state_reverse(state, plane, old_plane_state, 
new_plane_state, i) {
ret = dm_update_plane_state(dc, state, plane,
-- 
2.35.1



[PATCH AUTOSEL 5.19 25/29] drm/amd/display: update gamut remap if plane has changed

2022-10-02 Thread Sasha Levin
From: Hugo Hu 

[ Upstream commit 52bb21499cf54fa65b56d97cd0d68579c90207dd ]

[Why]
The desktop plane and full-screen game plane may have different
gamut remap coefficients, if switching between desktop and
full-screen game without updating the gamut remap will cause
incorrect color.

[How]
Update gamut remap if planes change.

Reviewed-by: Dmytro Laktyushkin 
Acked-by: Wayne Lin 
Signed-off-by: Hugo Hu 
Tested-by: Daniel Wheeler 
Signed-off-by: Alex Deucher 
Signed-off-by: Sasha Levin 
---
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c 
b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
index ec6aa8d8b251..213a02a769d4 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
@@ -1520,6 +1520,7 @@ static void dcn20_update_dchubp_dpp(
/* Any updates are handled in dc interface, just need
 * to apply existing for plane enable / opp change */
if (pipe_ctx->update_flags.bits.enable || 
pipe_ctx->update_flags.bits.opp_changed
+   || pipe_ctx->update_flags.bits.plane_changed
|| pipe_ctx->stream->update_flags.bits.gamut_remap
|| pipe_ctx->stream->update_flags.bits.out_csc) {
/* dpp/cm gamut remap*/
-- 
2.35.1



[PATCH AUTOSEL 5.19 26/29] drm/amd/display: skip audio setup when audio stream is enabled

2022-10-02 Thread Sasha Levin
From: zhikzhai 

[ Upstream commit 65fbfb02c2734cacffec5e3f492e1b4f1dabcf98 ]

[why]
We have minimal pipe split transition method to avoid pipe
allocation outage.However, this method will invoke audio setup
which cause audio output stuck once pipe reallocate.

[how]
skip audio setup for pipelines which audio stream has been enabled

Reviewed-by: Charlene Liu 
Acked-by: Wayne Lin 
Signed-off-by: zhikzhai 
Tested-by: Daniel Wheeler 
Signed-off-by: Alex Deucher 
Signed-off-by: Sasha Levin 
---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c 
b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
index aee31c785aa9..4f0ea50eaa83 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
@@ -2165,7 +2165,8 @@ static void dce110_setup_audio_dto(
continue;
if (pipe_ctx->stream->signal != SIGNAL_TYPE_HDMI_TYPE_A)
continue;
-   if (pipe_ctx->stream_res.audio != NULL) {
+   if (pipe_ctx->stream_res.audio != NULL &&
+   pipe_ctx->stream_res.audio->enabled == false) {
struct audio_output audio_output;
 
build_audio_output(context, pipe_ctx, &audio_output);
@@ -2207,7 +2208,8 @@ static void dce110_setup_audio_dto(
if (!dc_is_dp_signal(pipe_ctx->stream->signal))
continue;
 
-   if (pipe_ctx->stream_res.audio != NULL) {
+   if (pipe_ctx->stream_res.audio != NULL &&
+   pipe_ctx->stream_res.audio->enabled == false) {
struct audio_output audio_output;
 
build_audio_output(context, pipe_ctx, 
&audio_output);
-- 
2.35.1



[PATCH AUTOSEL 5.19 24/29] drm/amd/display: Assume an LTTPR is always present on fixed_vs links

2022-10-02 Thread Sasha Levin
From: Michael Strauss 

[ Upstream commit 29956d0fded036a570bd8e7d4ea4b1a1730307d2 ]

[WHY]
LTTPRs can in very rare instsances fail to increment DPCD LTTPR count.
This results in aux-i LTTPR requests to be sent to the wrong DPCD
address, which causes link training failure.

[HOW]
Override internal repeater count if fixed_vs flag is set for a given link

Reviewed-by: George Shen 
Acked-by: Wayne Lin 
Signed-off-by: Michael Strauss 
Tested-by: Daniel Wheeler 
Signed-off-by: Alex Deucher 
Signed-off-by: Sasha Levin 
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 8 
 1 file changed, 8 insertions(+)

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 a4fc9a6c850e..0c52506b367d 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
@@ -5211,6 +5211,14 @@ bool dp_retrieve_lttpr_cap(struct dc_link *link)
lttpr_dpcd_data[DP_PHY_REPEATER_128B132B_RATES -

DP_LT_TUNABLE_PHY_REPEATER_FIELD_DATA_STRUCTURE_REV];
 
+   /* If this chip cap is set, at least one retimer must exist in 
the chain
+* Override count to 1 if we receive a known bad count (0 or an 
invalid value) */
+   if (link->chip_caps & EXT_DISPLAY_PATH_CAPS__DP_FIXED_VS_EN &&
+   
(dp_convert_to_count(link->dpcd_caps.lttpr_caps.phy_repeater_cnt) == 0)) {
+   ASSERT(0);
+   link->dpcd_caps.lttpr_caps.phy_repeater_cnt = 0x80;
+   }
+
/* Attempt to train in LTTPR transparent mode if repeater count 
exceeds 8. */
is_lttpr_present = (link->dpcd_caps.lttpr_caps.max_lane_count > 
0 &&
link->dpcd_caps.lttpr_caps.max_lane_count <= 4 
&&
-- 
2.35.1



[PATCH AUTOSEL 5.19 27/29] drm/amd/display: Fix DP MST timeslot issue when fallback happened

2022-10-02 Thread Sasha Levin
From: Cruise Hung 

[ Upstream commit 20c6168b3c8aadef7d2853c925d99eb546bd5e1c ]

[Why]
When USB4 DP link training failed and fell back to lower link rate,
the time slot calculation uses the verified_link_cap.
And the verified_link_cap was not updated to the new one.
It caused the wrong VC payload time-slot was allocated.

[How]
Updated verified_link_cap with the new one from cur_link_settings
after the LT completes successfully.

Reviewed-by: Jun Lei 
Acked-by: Wayne Lin 
Signed-off-by: Cruise Hung 
Tested-by: Daniel Wheeler 
Signed-off-by: Alex Deucher 
Signed-off-by: Sasha Levin 
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

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 0c52506b367d..b4203a812c4b 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
@@ -2857,8 +2857,14 @@ bool perform_link_training_with_retries(
skip_video_pattern);
 
/* Transmit idle pattern once training 
successful. */
-   if (status == LINK_TRAINING_SUCCESS && 
!is_link_bw_low)
+   if (status == LINK_TRAINING_SUCCESS && 
!is_link_bw_low) {
dp_set_hw_test_pattern(link, 
&pipe_ctx->link_res, DP_TEST_PATTERN_VIDEO_MODE, NULL, 0);
+   /* Update verified link settings to 
current one
+* Because DPIA LT might fallback to 
lower link setting.
+*/
+   link->verified_link_cap.link_rate = 
link->cur_link_settings.link_rate;
+   link->verified_link_cap.lane_count = 
link->cur_link_settings.lane_count;
+   }
} else {
status = dc_link_dp_perform_link_training(link,
&pipe_ctx->link_res,
-- 
2.35.1



[PATCH AUTOSEL 5.19 28/29] drm/amd/display: increase dcn315 pstate change latency

2022-10-02 Thread Sasha Levin
From: Dmytro Laktyushkin 

[ Upstream commit dcc2527df918edfe297c5074ccc1f05eae361ca6 ]

[Why & How]
Update after new measurment came in

Reviewed-by: Jun Lei 
Acked-by: Wayne Lin 
Signed-off-by: Dmytro Laktyushkin 
Tested-by: Daniel Wheeler 
Signed-off-by: Alex Deucher 
Signed-off-by: Sasha Levin 
---
 .../dc/clk_mgr/dcn315/dcn315_clk_mgr.c| 22 ---
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c 
b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c
index f4381725b210..c3d7712e9fd0 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c
@@ -46,6 +46,9 @@
 #define TO_CLK_MGR_DCN315(clk_mgr)\
container_of(clk_mgr, struct clk_mgr_dcn315, base)
 
+#define UNSUPPORTED_DCFCLK 1000
+#define MIN_DPP_DISP_CLK 10
+
 static int dcn315_get_active_display_cnt_wa(
struct dc *dc,
struct dc_state *context)
@@ -146,6 +149,9 @@ static void dcn315_update_clocks(struct clk_mgr 
*clk_mgr_base,
}
}
 
+   /* Lock pstate by requesting unsupported dcfclk if change is 
unsupported */
+   if (!new_clocks->p_state_change_support)
+   new_clocks->dcfclk_khz = UNSUPPORTED_DCFCLK;
if (should_set_clock(safe_to_lower, new_clocks->dcfclk_khz, 
clk_mgr_base->clks.dcfclk_khz)) {
clk_mgr_base->clks.dcfclk_khz = new_clocks->dcfclk_khz;
dcn315_smu_set_hard_min_dcfclk(clk_mgr, 
clk_mgr_base->clks.dcfclk_khz);
@@ -159,10 +165,10 @@ static void dcn315_update_clocks(struct clk_mgr 
*clk_mgr_base,
 
// workaround: Limit dppclk to 100Mhz to avoid lower eDP panel switch 
to plus 4K monitor underflow.
if (!IS_DIAG_DC(dc->ctx->dce_environment)) {
-   if (new_clocks->dppclk_khz < 10)
-   new_clocks->dppclk_khz = 10;
-   if (new_clocks->dispclk_khz < 10)
-   new_clocks->dispclk_khz = 10;
+   if (new_clocks->dppclk_khz < MIN_DPP_DISP_CLK)
+   new_clocks->dppclk_khz = MIN_DPP_DISP_CLK;
+   if (new_clocks->dispclk_khz < MIN_DPP_DISP_CLK)
+   new_clocks->dispclk_khz = MIN_DPP_DISP_CLK;
}
 
if (should_set_clock(safe_to_lower, new_clocks->dppclk_khz, 
clk_mgr->base.clks.dppclk_khz)) {
@@ -272,7 +278,7 @@ static struct wm_table ddr5_wm_table = {
{
.wm_inst = WM_A,
.wm_type = WM_TYPE_PSTATE_CHG,
-   .pstate_latency_us = 64.0,
+   .pstate_latency_us = 129.0,
.sr_exit_time_us = 11.5,
.sr_enter_plus_exit_time_us = 14.5,
.valid = true,
@@ -280,7 +286,7 @@ static struct wm_table ddr5_wm_table = {
{
.wm_inst = WM_B,
.wm_type = WM_TYPE_PSTATE_CHG,
-   .pstate_latency_us = 64.0,
+   .pstate_latency_us = 129.0,
.sr_exit_time_us = 11.5,
.sr_enter_plus_exit_time_us = 14.5,
.valid = true,
@@ -288,7 +294,7 @@ static struct wm_table ddr5_wm_table = {
{
.wm_inst = WM_C,
.wm_type = WM_TYPE_PSTATE_CHG,
-   .pstate_latency_us = 64.0,
+   .pstate_latency_us = 129.0,
.sr_exit_time_us = 11.5,
.sr_enter_plus_exit_time_us = 14.5,
.valid = true,
@@ -296,7 +302,7 @@ static struct wm_table ddr5_wm_table = {
{
.wm_inst = WM_D,
.wm_type = WM_TYPE_PSTATE_CHG,
-   .pstate_latency_us = 64.0,
+   .pstate_latency_us = 129.0,
.sr_exit_time_us = 11.5,
.sr_enter_plus_exit_time_us = 14.5,
.valid = true,
-- 
2.35.1



[PATCH AUTOSEL 5.15 17/20] drm/amd/display: Fix double cursor on non-video RGB MPO

2022-10-02 Thread Sasha Levin
From: Leo Li 

[ Upstream commit b261509952bc19d1012cf732f853659be6ebc61e ]

[Why]

DC makes use of layer_index (zpos) when picking the HW plane to enable
HW cursor on. However, some compositors will not attach zpos information
to each DRM plane. Consequently, in amdgpu, we default layer_index to 0
and do not update it.

This causes said DC logic to enable HW cursor on all planes of the same
layer_index, which manifests as a double cursor issue if one of the
planes is scaled (and hence scaling the cursor as well).

[How]

Use DRM core helpers to calculate a normalized_zpos value for each
drm_plane_state under each crtc, within the atomic state.

This helper will first consider existing zpos values, and if
identical/unset, fallback to plane ID ordering.

The normalized_zpos is then passed to dc_plane_info during atomic check
for later use by the cursor logic.

Reviewed-by: Bhawanpreet Lakha 
Acked-by: Wayne Lin 
Signed-off-by: Leo Li 
Tested-by: Daniel Wheeler 
Signed-off-by: Alex Deucher 
Signed-off-by: Sasha Levin 
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index e3dfea3d44a4..c826fc493e0f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -5442,7 +5442,7 @@ fill_dc_plane_info_and_addr(struct amdgpu_device *adev,
plane_info->visible = true;
plane_info->stereo_format = PLANE_STEREO_FORMAT_NONE;
 
-   plane_info->layer_index = 0;
+   plane_info->layer_index = plane_state->normalized_zpos;
 
ret = fill_plane_color_attributes(plane_state, plane_info->format,
  &plane_info->color_space);
@@ -5509,7 +5509,7 @@ static int fill_dc_plane_attributes(struct amdgpu_device 
*adev,
dc_plane_state->global_alpha = plane_info.global_alpha;
dc_plane_state->global_alpha_value = plane_info.global_alpha_value;
dc_plane_state->dcc = plane_info.dcc;
-   dc_plane_state->layer_index = plane_info.layer_index; // Always returns 0
+   dc_plane_state->layer_index = plane_info.layer_index;
dc_plane_state->flip_int_enabled = true;
 
/*
@@ -10828,6 +10828,14 @@ static int amdgpu_dm_atomic_check(struct drm_device 
*dev,
}
}
 
+   /*
+* DC consults the zpos (layer_index in DC terminology) to determine the
+* hw plane on which to enable the hw cursor (see
+* `dcn10_can_pipe_disable_cursor`). By now, all modified planes are in
+* atomic state, so call drm helper to normalize zpos.
+*/
+   drm_atomic_normalize_zpos(dev, state);
+
/* Remove exiting planes if they are modified */
for_each_oldnew_plane_in_state_reverse(state, plane, old_plane_state, 
new_plane_state, i) {
ret = dm_update_plane_state(dc, state, plane,
-- 
2.35.1



[PATCH AUTOSEL 5.15 18/20] drm/amd/display: Assume an LTTPR is always present on fixed_vs links

2022-10-02 Thread Sasha Levin
From: Michael Strauss 

[ Upstream commit 29956d0fded036a570bd8e7d4ea4b1a1730307d2 ]

[WHY]
LTTPRs can in very rare instsances fail to increment DPCD LTTPR count.
This results in aux-i LTTPR requests to be sent to the wrong DPCD
address, which causes link training failure.

[HOW]
Override internal repeater count if fixed_vs flag is set for a given link

Reviewed-by: George Shen 
Acked-by: Wayne Lin 
Signed-off-by: Michael Strauss 
Tested-by: Daniel Wheeler 
Signed-off-by: Alex Deucher 
Signed-off-by: Sasha Levin 
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 8 
 1 file changed, 8 insertions(+)

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 6d5dc5ab3d8c..a6ff1b17fd22 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
@@ -3703,6 +3703,14 @@ bool dp_retrieve_lttpr_cap(struct dc_link *link)

lttpr_dpcd_data[DP_PHY_REPEATER_EXTENDED_WAIT_TIMEOUT -

DP_LT_TUNABLE_PHY_REPEATER_FIELD_DATA_STRUCTURE_REV];
 
+   /* If this chip cap is set, at least one retimer must exist in 
the chain
+* Override count to 1 if we receive a known bad count (0 or an 
invalid value) */
+   if (link->chip_caps & EXT_DISPLAY_PATH_CAPS__DP_FIXED_VS_EN &&
+   
(dp_convert_to_count(link->dpcd_caps.lttpr_caps.phy_repeater_cnt) == 0)) {
+   ASSERT(0);
+   link->dpcd_caps.lttpr_caps.phy_repeater_cnt = 0x80;
+   }
+
/* Attempt to train in LTTPR transparent mode if repeater count 
exceeds 8. */
is_lttpr_present = 
(dp_convert_to_count(link->dpcd_caps.lttpr_caps.phy_repeater_cnt) != 0 &&
link->dpcd_caps.lttpr_caps.max_lane_count > 0 &&
-- 
2.35.1



[PATCH AUTOSEL 5.15 20/20] drm/amd/display: skip audio setup when audio stream is enabled

2022-10-02 Thread Sasha Levin
From: zhikzhai 

[ Upstream commit 65fbfb02c2734cacffec5e3f492e1b4f1dabcf98 ]

[why]
We have minimal pipe split transition method to avoid pipe
allocation outage.However, this method will invoke audio setup
which cause audio output stuck once pipe reallocate.

[how]
skip audio setup for pipelines which audio stream has been enabled

Reviewed-by: Charlene Liu 
Acked-by: Wayne Lin 
Signed-off-by: zhikzhai 
Tested-by: Daniel Wheeler 
Signed-off-by: Alex Deucher 
Signed-off-by: Sasha Levin 
---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c 
b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
index 62d595ded866..46d7e75e4553 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
@@ -2108,7 +2108,8 @@ static void dce110_setup_audio_dto(
continue;
if (pipe_ctx->stream->signal != SIGNAL_TYPE_HDMI_TYPE_A)
continue;
-   if (pipe_ctx->stream_res.audio != NULL) {
+   if (pipe_ctx->stream_res.audio != NULL &&
+   pipe_ctx->stream_res.audio->enabled == false) {
struct audio_output audio_output;
 
build_audio_output(context, pipe_ctx, &audio_output);
@@ -2156,7 +2157,8 @@ static void dce110_setup_audio_dto(
if (!dc_is_dp_signal(pipe_ctx->stream->signal))
continue;
 
-   if (pipe_ctx->stream_res.audio != NULL) {
+   if (pipe_ctx->stream_res.audio != NULL &&
+   pipe_ctx->stream_res.audio->enabled == false) {
struct audio_output audio_output;
 
build_audio_output(context, pipe_ctx, 
&audio_output);
-- 
2.35.1



[PATCH AUTOSEL 5.15 19/20] drm/amd/display: update gamut remap if plane has changed

2022-10-02 Thread Sasha Levin
From: Hugo Hu 

[ Upstream commit 52bb21499cf54fa65b56d97cd0d68579c90207dd ]

[Why]
The desktop plane and full-screen game plane may have different
gamut remap coefficients, if switching between desktop and
full-screen game without updating the gamut remap will cause
incorrect color.

[How]
Update gamut remap if planes change.

Reviewed-by: Dmytro Laktyushkin 
Acked-by: Wayne Lin 
Signed-off-by: Hugo Hu 
Tested-by: Daniel Wheeler 
Signed-off-by: Alex Deucher 
Signed-off-by: Sasha Levin 
---
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c 
b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
index 9f8d7f92300b..0de1bbbabf9a 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
@@ -1513,6 +1513,7 @@ static void dcn20_update_dchubp_dpp(
/* Any updates are handled in dc interface, just need
 * to apply existing for plane enable / opp change */
if (pipe_ctx->update_flags.bits.enable || 
pipe_ctx->update_flags.bits.opp_changed
+   || pipe_ctx->update_flags.bits.plane_changed
|| pipe_ctx->stream->update_flags.bits.gamut_remap
|| pipe_ctx->stream->update_flags.bits.out_csc) {
/* dpp/cm gamut remap*/
-- 
2.35.1



[PATCH AUTOSEL 5.10 13/14] drm/amd/display: update gamut remap if plane has changed

2022-10-02 Thread Sasha Levin
From: Hugo Hu 

[ Upstream commit 52bb21499cf54fa65b56d97cd0d68579c90207dd ]

[Why]
The desktop plane and full-screen game plane may have different
gamut remap coefficients, if switching between desktop and
full-screen game without updating the gamut remap will cause
incorrect color.

[How]
Update gamut remap if planes change.

Reviewed-by: Dmytro Laktyushkin 
Acked-by: Wayne Lin 
Signed-off-by: Hugo Hu 
Tested-by: Daniel Wheeler 
Signed-off-by: Alex Deucher 
Signed-off-by: Sasha Levin 
---
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c 
b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
index 3d778760a3b5..8f66eef0c683 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
@@ -1481,6 +1481,7 @@ static void dcn20_update_dchubp_dpp(
/* Any updates are handled in dc interface, just need
 * to apply existing for plane enable / opp change */
if (pipe_ctx->update_flags.bits.enable || 
pipe_ctx->update_flags.bits.opp_changed
+   || pipe_ctx->update_flags.bits.plane_changed
|| pipe_ctx->stream->update_flags.bits.gamut_remap
|| pipe_ctx->stream->update_flags.bits.out_csc) {
 #if defined(CONFIG_DRM_AMD_DC_DCN3_0)
-- 
2.35.1



[PATCH AUTOSEL 5.10 14/14] drm/amd/display: skip audio setup when audio stream is enabled

2022-10-02 Thread Sasha Levin
From: zhikzhai 

[ Upstream commit 65fbfb02c2734cacffec5e3f492e1b4f1dabcf98 ]

[why]
We have minimal pipe split transition method to avoid pipe
allocation outage.However, this method will invoke audio setup
which cause audio output stuck once pipe reallocate.

[how]
skip audio setup for pipelines which audio stream has been enabled

Reviewed-by: Charlene Liu 
Acked-by: Wayne Lin 
Signed-off-by: zhikzhai 
Tested-by: Daniel Wheeler 
Signed-off-by: Alex Deucher 
Signed-off-by: Sasha Levin 
---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c 
b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
index 3ac6c7b65a45..e33fe0207b9e 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
@@ -2047,7 +2047,8 @@ static void dce110_setup_audio_dto(
continue;
if (pipe_ctx->stream->signal != SIGNAL_TYPE_HDMI_TYPE_A)
continue;
-   if (pipe_ctx->stream_res.audio != NULL) {
+   if (pipe_ctx->stream_res.audio != NULL &&
+   pipe_ctx->stream_res.audio->enabled == false) {
struct audio_output audio_output;
 
build_audio_output(context, pipe_ctx, &audio_output);
@@ -2075,7 +2076,8 @@ static void dce110_setup_audio_dto(
if (!dc_is_dp_signal(pipe_ctx->stream->signal))
continue;
 
-   if (pipe_ctx->stream_res.audio != NULL) {
+   if (pipe_ctx->stream_res.audio != NULL &&
+   pipe_ctx->stream_res.audio->enabled == false) {
struct audio_output audio_output;
 
build_audio_output(context, pipe_ctx, 
&audio_output);
-- 
2.35.1