From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Alvin Lee <Alvin.Lee2@amd.com>, Samson Tam <samson.tam@amd.com>,
Stylon Wang <stylon.wang@amd.com>,
Daniel Wheeler <daniel.wheeler@amd.com>,
Alex Deucher <alexander.deucher@amd.com>,
Sasha Levin <sashal@kernel.org>,
harry.wentland@amd.com, sunpeng.li@amd.com,
Rodrigo.Siqueira@amd.com, christian.koenig@amd.com,
Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch,
alvin.lee2@amd.com, jun.lei@amd.com, Qingqing.Zhuo@amd.com,
wenjing.liu@amd.com, aric.cyr@amd.com, chiawen.huang@amd.com,
hamza.mahfooz@amd.com, Wesley.Chalmers@amd.com,
mdaenzer@redhat.com, Ilya.Bakoulin@amd.com, moadhuri@amd.com,
syedsaaem.rizvi@amd.com, dillon.varone@amd.com,
dmytro.laktyushkin@amd.com, chiahsuan.chung@amd.com,
george.shen@amd.com, danny.wang@amd.com, mwen@igalia.com,
hanghong.ma@amd.com, arthurgrillo@riseup.net,
aurabindo.pillai@amd.com, duncan.ma@amd.com,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [PATCH AUTOSEL 6.5 04/37] drm/amd/display: Blank phantom OTG before enabling
Date: Tue, 7 Nov 2023 07:21:15 -0500 [thread overview]
Message-ID: <20231107122407.3760584-4-sashal@kernel.org> (raw)
In-Reply-To: <20231107122407.3760584-1-sashal@kernel.org>
From: Alvin Lee <Alvin.Lee2@amd.com>
[ Upstream commit e87a6c5b7780b5f423797351eb586ed96cc6d151 ]
[Description]
Before enabling the phantom OTG for an update we
must enable DPG to avoid underflow.
Reviewed-by: Samson Tam <samson.tam@amd.com>
Acked-by: Stylon Wang <stylon.wang@amd.com>
Signed-off-by: Alvin Lee <Alvin.Lee2@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/display/dc/core/dc.c | 50 +------------------
.../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 10 +++-
.../drm/amd/display/dc/dcn32/dcn32_hwseq.c | 46 +++++++++++++++++
.../drm/amd/display/dc/dcn32/dcn32_hwseq.h | 5 ++
.../gpu/drm/amd/display/dc/dcn32/dcn32_init.c | 1 +
.../gpu/drm/amd/display/dc/inc/hw_sequencer.h | 5 ++
6 files changed, 68 insertions(+), 49 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 609048160aa20..ab79bcd264164 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -1070,53 +1070,6 @@ static void apply_ctx_interdependent_lock(struct dc *dc, struct dc_state *contex
}
}
-static void phantom_pipe_blank(
- struct dc *dc,
- struct timing_generator *tg,
- int width,
- int height)
-{
- struct dce_hwseq *hws = dc->hwseq;
- enum dc_color_space color_space;
- struct tg_color black_color = {0};
- struct output_pixel_processor *opp = NULL;
- uint32_t num_opps, opp_id_src0, opp_id_src1;
- uint32_t otg_active_width, otg_active_height;
- uint32_t i;
-
- /* program opp dpg blank color */
- color_space = COLOR_SPACE_SRGB;
- color_space_to_black_color(dc, color_space, &black_color);
-
- otg_active_width = width;
- otg_active_height = height;
-
- /* get the OPTC source */
- tg->funcs->get_optc_source(tg, &num_opps, &opp_id_src0, &opp_id_src1);
- ASSERT(opp_id_src0 < dc->res_pool->res_cap->num_opp);
-
- for (i = 0; i < dc->res_pool->res_cap->num_opp; i++) {
- if (dc->res_pool->opps[i] != NULL && dc->res_pool->opps[i]->inst == opp_id_src0) {
- opp = dc->res_pool->opps[i];
- break;
- }
- }
-
- if (opp && opp->funcs->opp_set_disp_pattern_generator)
- opp->funcs->opp_set_disp_pattern_generator(
- opp,
- CONTROLLER_DP_TEST_PATTERN_SOLID_COLOR,
- CONTROLLER_DP_COLOR_SPACE_UDEFINED,
- COLOR_DEPTH_UNDEFINED,
- &black_color,
- otg_active_width,
- otg_active_height,
- 0);
-
- if (tg->funcs->is_tg_enabled(tg))
- hws->funcs.wait_for_blank_complete(opp);
-}
-
static void dc_update_viusal_confirm_color(struct dc *dc, struct dc_state *context, struct pipe_ctx *pipe_ctx)
{
if (dc->ctx->dce_version >= DCN_VERSION_1_0) {
@@ -1207,7 +1160,8 @@ static void disable_dangling_plane(struct dc *dc, struct dc_state *context)
main_pipe_width = old_stream->mall_stream_config.paired_stream->dst.width;
main_pipe_height = old_stream->mall_stream_config.paired_stream->dst.height;
- phantom_pipe_blank(dc, tg, main_pipe_width, main_pipe_height);
+ if (dc->hwss.blank_phantom)
+ dc->hwss.blank_phantom(dc, tg, main_pipe_width, main_pipe_height);
tg->funcs->enable_crtc(tg);
}
}
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 62a077adcdbfa..84fe449a2c7ed 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
@@ -1846,8 +1846,16 @@ void dcn20_program_front_end_for_ctx(
dc->current_state->res_ctx.pipe_ctx[i].stream->mall_stream_config.type == SUBVP_PHANTOM) {
struct timing_generator *tg = dc->current_state->res_ctx.pipe_ctx[i].stream_res.tg;
- if (tg->funcs->enable_crtc)
+ if (tg->funcs->enable_crtc) {
+ if (dc->hwss.blank_phantom) {
+ int main_pipe_width, main_pipe_height;
+
+ main_pipe_width = dc->current_state->res_ctx.pipe_ctx[i].stream->mall_stream_config.paired_stream->dst.width;
+ main_pipe_height = dc->current_state->res_ctx.pipe_ctx[i].stream->mall_stream_config.paired_stream->dst.height;
+ dc->hwss.blank_phantom(dc, tg, main_pipe_width, main_pipe_height);
+ }
tg->funcs->enable_crtc(tg);
+ }
}
}
/* OTG blank before disabling all front ends */
diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
index d52d5feeb311b..b6608d7ab4450 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
@@ -1575,3 +1575,49 @@ void dcn32_init_blank(
if (opp)
hws->funcs.wait_for_blank_complete(opp);
}
+
+void dcn32_blank_phantom(struct dc *dc,
+ struct timing_generator *tg,
+ int width,
+ int height)
+{
+ struct dce_hwseq *hws = dc->hwseq;
+ enum dc_color_space color_space;
+ struct tg_color black_color = {0};
+ struct output_pixel_processor *opp = NULL;
+ uint32_t num_opps, opp_id_src0, opp_id_src1;
+ uint32_t otg_active_width, otg_active_height;
+ uint32_t i;
+
+ /* program opp dpg blank color */
+ color_space = COLOR_SPACE_SRGB;
+ color_space_to_black_color(dc, color_space, &black_color);
+
+ otg_active_width = width;
+ otg_active_height = height;
+
+ /* get the OPTC source */
+ tg->funcs->get_optc_source(tg, &num_opps, &opp_id_src0, &opp_id_src1);
+ ASSERT(opp_id_src0 < dc->res_pool->res_cap->num_opp);
+
+ for (i = 0; i < dc->res_pool->res_cap->num_opp; i++) {
+ if (dc->res_pool->opps[i] != NULL && dc->res_pool->opps[i]->inst == opp_id_src0) {
+ opp = dc->res_pool->opps[i];
+ break;
+ }
+ }
+
+ if (opp && opp->funcs->opp_set_disp_pattern_generator)
+ opp->funcs->opp_set_disp_pattern_generator(
+ opp,
+ CONTROLLER_DP_TEST_PATTERN_SOLID_COLOR,
+ CONTROLLER_DP_COLOR_SPACE_UDEFINED,
+ COLOR_DEPTH_UNDEFINED,
+ &black_color,
+ otg_active_width,
+ otg_active_height,
+ 0);
+
+ if (tg->funcs->is_tg_enabled(tg))
+ hws->funcs.wait_for_blank_complete(opp);
+}
diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.h b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.h
index 2d2628f31bed7..616d5219119e9 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.h
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.h
@@ -115,4 +115,9 @@ void dcn32_init_blank(
struct dc *dc,
struct timing_generator *tg);
+void dcn32_blank_phantom(struct dc *dc,
+ struct timing_generator *tg,
+ int width,
+ int height);
+
#endif /* __DC_HWSS_DCN32_H__ */
diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c
index 777b2fac20c4e..279f312f74076 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c
@@ -115,6 +115,7 @@ static const struct hw_sequencer_funcs dcn32_funcs = {
.update_phantom_vp_position = dcn32_update_phantom_vp_position,
.update_dsc_pg = dcn32_update_dsc_pg,
.apply_update_flags_for_phantom = dcn32_apply_update_flags_for_phantom,
+ .blank_phantom = dcn32_blank_phantom,
};
static const struct hwseq_private_funcs dcn32_private_funcs = {
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h b/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h
index 02ff99f7bec2b..7a702e216e530 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h
@@ -388,6 +388,11 @@ struct hw_sequencer_funcs {
void (*z10_restore)(const struct dc *dc);
void (*z10_save_init)(struct dc *dc);
+ void (*blank_phantom)(struct dc *dc,
+ struct timing_generator *tg,
+ int width,
+ int height);
+
void (*update_visual_confirm_color)(struct dc *dc,
struct pipe_ctx *pipe_ctx,
int mpcc_id);
--
2.42.0
next prev parent reply other threads:[~2023-11-07 12:35 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-07 12:21 [PATCH AUTOSEL 6.5 01/37] drm/gma500: Fix call trace when psb_gem_mm_init() fails Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 02/37] drm/amdkfd: ratelimited SQ interrupt messages Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 03/37] drm/komeda: drop all currently held locks if deadlock happens Sasha Levin
2023-11-07 12:21 ` Sasha Levin [this message]
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 05/37] drm/amd/display: Don't lock phantom pipe on disabling Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 06/37] drm/amd/display: add seamless pipe topology transition check Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 07/37] drm/edid: Fixup h/vsync_end instead of h/vtotal Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 08/37] md: don't rely on 'mddev->pers' to be set in mddev_suspend() Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 09/37] drm/amdgpu: not to save bo in the case of RAS err_event_athub Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 10/37] drm/amdkfd: Fix a race condition of vram buffer unref in svm code Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 11/37] drm/amd: Update `update_pcie_parameters` functions to use uint8_t arguments Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 12/37] drm/amd/display: use full update for clip size increase of large plane source Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 13/37] string.h: add array-wrappers for (v)memdup_user() Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 14/37] kernel: kexec: copy user-array safely Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 15/37] kernel: watch_queue: " Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 16/37] drm_lease.c: " Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 17/37] drm: vmwgfx_surface.c: " Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 18/37] drm/msm/dp: skip validity check for DP CTS EDID checksum Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 19/37] drm/amd: Fix UBSAN array-index-out-of-bounds for SMU7 Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 20/37] drm/radeon: Fix UBSAN array-index-out-of-bounds for Radeon HD 5430 Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 21/37] drm/amd: Fix UBSAN array-index-out-of-bounds for Polaris and Tonga Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 22/37] drm/amdgpu: Fix potential null pointer derefernce Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 23/37] drm/panel: fix a possible null pointer dereference Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 24/37] drm/panel/panel-tpo-tpg110: " Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 25/37] drm/radeon: " Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 26/37] drm/amdgpu/vkms: " Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 27/37] drm/panel: st7703: Pick different reset sequence Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 28/37] drm/amdkfd: Fix shift out-of-bounds issue Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 29/37] drm/amdgpu: Fix a null pointer access when the smc_rreg pointer is NULL Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 30/37] drm/amd: Disable PP_PCIE_DPM_MASK when dynamic speed switching not supported Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 31/37] drm/amd/display: fix num_ways overflow error Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 32/37] drm/amd: check num of link levels when update pcie param Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 33/37] arm64: dts: renesas: r8a779f0: spider: Enable PCIe Host ch0 Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 34/37] arm64: dts: rockchip: add PCIe to rk3588s-indiedroid-nova Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 35/37] arm64: dts: rockchip: add USB2 to rk3588s-indiedroid Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 36/37] arm64: dts: ls208xa: use a pseudo-bus to constrain usb dma size Sasha Levin
2023-11-07 12:21 ` [PATCH AUTOSEL 6.5 37/37] selftests/efivarfs: create-read: fix a resource leak Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231107122407.3760584-4-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=Alvin.Lee2@amd.com \
--cc=Ilya.Bakoulin@amd.com \
--cc=Qingqing.Zhuo@amd.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=Wesley.Chalmers@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=aric.cyr@amd.com \
--cc=arthurgrillo@riseup.net \
--cc=aurabindo.pillai@amd.com \
--cc=chiahsuan.chung@amd.com \
--cc=chiawen.huang@amd.com \
--cc=christian.koenig@amd.com \
--cc=daniel.wheeler@amd.com \
--cc=daniel@ffwll.ch \
--cc=danny.wang@amd.com \
--cc=dillon.varone@amd.com \
--cc=dmytro.laktyushkin@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=duncan.ma@amd.com \
--cc=george.shen@amd.com \
--cc=hamza.mahfooz@amd.com \
--cc=hanghong.ma@amd.com \
--cc=harry.wentland@amd.com \
--cc=jun.lei@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mdaenzer@redhat.com \
--cc=moadhuri@amd.com \
--cc=mwen@igalia.com \
--cc=samson.tam@amd.com \
--cc=stable@vger.kernel.org \
--cc=stylon.wang@amd.com \
--cc=sunpeng.li@amd.com \
--cc=syedsaaem.rizvi@amd.com \
--cc=wenjing.liu@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox