From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Wesley Chalmers <Wesley.Chalmers@amd.com>,
Jun Lei <Jun.Lei@amd.com>, Qingqing Zhuo <qingqing.zhuo@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, aurabindo.pillai@amd.com, samson.tam@amd.com,
Dillon.Varone@amd.com, HaoPing.Liu@amd.com, aric.cyr@amd.com,
Josip.Pavic@amd.com, jdhillon@amd.com,
jiapeng.chong@linux.alibaba.com, harry.vanzylldejong@amd.com,
Wayne.Lin@amd.com, Duncan.Ma@amd.com,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [PATCH AUTOSEL 6.1 45/58] drm/amd/display: Do not commit pipe when updating DRR
Date: Sun, 26 Feb 2023 21:04:43 -0500 [thread overview]
Message-ID: <20230227020457.1048737-45-sashal@kernel.org> (raw)
In-Reply-To: <20230227020457.1048737-1-sashal@kernel.org>
From: Wesley Chalmers <Wesley.Chalmers@amd.com>
[ Upstream commit 8f0d304d21b351d65e8c434c5399a40231876ba1 ]
[WHY]
DRR and Pipe cannot be updated on
the same frame, or else underflow will
occur.
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Wesley Chalmers <Wesley.Chalmers@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 | 15 +++++++++++++++
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h | 3 ++-
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_optc.c | 9 +++++++++
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_optc.h | 2 ++
.../drm/amd/display/dc/inc/hw/timing_generator.h | 1 +
5 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 24015f8cac75a..af7aefe285ffd 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -3222,6 +3222,21 @@ static void commit_planes_for_stream(struct dc *dc,
dc_z10_restore(dc);
+ if (update_type == UPDATE_TYPE_FULL) {
+ /* wait for all double-buffer activity to clear on all pipes */
+ int pipe_idx;
+
+ for (pipe_idx = 0; pipe_idx < dc->res_pool->pipe_count; pipe_idx++) {
+ struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[pipe_idx];
+
+ if (!pipe_ctx->stream)
+ continue;
+
+ if (pipe_ctx->stream_res.tg->funcs->wait_drr_doublebuffer_pending_clear)
+ pipe_ctx->stream_res.tg->funcs->wait_drr_doublebuffer_pending_clear(pipe_ctx->stream_res.tg);
+ }
+ }
+
if (get_seamless_boot_stream_count(context) > 0 && surface_count > 0) {
/* Optimize seamless boot flag keeps clocks and watermarks high until
* first flip. After first flip, optimization is required to lower
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h
index 88ac5f6f4c96c..0b37bb0e184b2 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h
@@ -519,7 +519,8 @@ struct dcn_optc_registers {
type OTG_CRC_DATA_STREAM_COMBINE_MODE;\
type OTG_CRC_DATA_STREAM_SPLIT_MODE;\
type OTG_CRC_DATA_FORMAT;\
- type OTG_V_TOTAL_LAST_USED_BY_DRR;
+ type OTG_V_TOTAL_LAST_USED_BY_DRR;\
+ type OTG_DRR_TIMING_DBUF_UPDATE_PENDING;
#define TG_REG_FIELD_LIST_DCN3_2(type) \
type OTG_H_TIMING_DIV_MODE_MANUAL;
diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_optc.c b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_optc.c
index 892d3c4d01a1e..25749f7d88366 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_optc.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_optc.c
@@ -282,6 +282,14 @@ static void optc3_set_timing_double_buffer(struct timing_generator *optc, bool e
OTG_DRR_TIMING_DBUF_UPDATE_MODE, mode);
}
+void optc3_wait_drr_doublebuffer_pending_clear(struct timing_generator *optc)
+{
+ struct optc *optc1 = DCN10TG_FROM_TG(optc);
+
+ REG_WAIT(OTG_DOUBLE_BUFFER_CONTROL, OTG_DRR_TIMING_DBUF_UPDATE_PENDING, 0, 2, 100000); /* 1 vupdate at 5hz */
+
+}
+
void optc3_set_vtotal_min_max(struct timing_generator *optc, int vtotal_min, int vtotal_max)
{
optc1_set_vtotal_min_max(optc, vtotal_min, vtotal_max);
@@ -351,6 +359,7 @@ static struct timing_generator_funcs dcn30_tg_funcs = {
.program_manual_trigger = optc2_program_manual_trigger,
.setup_manual_trigger = optc2_setup_manual_trigger,
.get_hw_timing = optc1_get_hw_timing,
+ .wait_drr_doublebuffer_pending_clear = optc3_wait_drr_doublebuffer_pending_clear,
};
void dcn30_timing_generator_init(struct optc *optc1)
diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_optc.h b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_optc.h
index dd45a5499b078..fb06dc9a48937 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_optc.h
+++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_optc.h
@@ -279,6 +279,7 @@
SF(OTG0_OTG_DRR_TRIGGER_WINDOW, OTG_DRR_TRIGGER_WINDOW_END_X, mask_sh),\
SF(OTG0_OTG_DRR_V_TOTAL_CHANGE, OTG_DRR_V_TOTAL_CHANGE_LIMIT, mask_sh),\
SF(OTG0_OTG_H_TIMING_CNTL, OTG_H_TIMING_DIV_BY2, mask_sh),\
+ SF(OTG0_OTG_DOUBLE_BUFFER_CONTROL, OTG_DRR_TIMING_DBUF_UPDATE_PENDING, mask_sh),\
SF(OTG0_OTG_DOUBLE_BUFFER_CONTROL, OTG_DRR_TIMING_DBUF_UPDATE_MODE, mask_sh),\
SF(OTG0_OTG_DOUBLE_BUFFER_CONTROL, OTG_BLANK_DATA_DOUBLE_BUFFER_EN, mask_sh)
@@ -317,6 +318,7 @@
SF(OTG0_OTG_DRR_TRIGGER_WINDOW, OTG_DRR_TRIGGER_WINDOW_END_X, mask_sh),\
SF(OTG0_OTG_DRR_V_TOTAL_CHANGE, OTG_DRR_V_TOTAL_CHANGE_LIMIT, mask_sh),\
SF(OTG0_OTG_H_TIMING_CNTL, OTG_H_TIMING_DIV_MODE, mask_sh),\
+ SF(OTG0_OTG_DOUBLE_BUFFER_CONTROL, OTG_DRR_TIMING_DBUF_UPDATE_PENDING, mask_sh),\
SF(OTG0_OTG_DOUBLE_BUFFER_CONTROL, OTG_DRR_TIMING_DBUF_UPDATE_MODE, mask_sh)
void dcn30_timing_generator_init(struct optc *optc1);
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h b/drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h
index 25a1df45b2641..f96fb425345e4 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h
@@ -325,6 +325,7 @@ struct timing_generator_funcs {
uint32_t vtotal_change_limit);
void (*init_odm)(struct timing_generator *tg);
+ void (*wait_drr_doublebuffer_pending_clear)(struct timing_generator *tg);
};
#endif
--
2.39.0
next prev parent reply other threads:[~2023-02-27 2:09 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-27 2:03 [PATCH AUTOSEL 6.1 01/58] drm: panel-orientation-quirks: Add quirk for Lenovo Yoga Tab 3 X90F Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 02/58] drm: panel-orientation-quirks: Add quirk for DynaBook K50 Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 03/58] drm/amd/display: Reduce expected sdp bandwidth for dcn321 Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 04/58] drm/amd/display: Revert Reduce delay when sink device not able to ACK 00340h write Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 05/58] drm/amd/display: Fix potential null-deref in dm_resume Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 06/58] drm/omap: dsi: Fix excessive stack usage Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 07/58] HID: Add Mapping for System Microphone Mute Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 08/58] drm/tiny: ili9486: Do not assume 8-bit only SPI controllers Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 09/58] drm/amd/display: Defer DIG FIFO disable after VID stream enable Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 10/58] drm/radeon: free iio for atombios when driver shutdown Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 11/58] drm/amd: Avoid BUG() for case of SRIOV missing IP version Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 12/58] drm/amdkfd: Page aligned memory reserve size Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 13/58] scsi: lpfc: Fix use-after-free KFENCE violation during sysfs firmware write Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 14/58] Revert "fbcon: don't lose the console font across generic->chip driver switch" Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 15/58] drm/amd: Avoid ASSERT for some message failures Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 16/58] drm: amd: display: Fix memory leakage Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 17/58] drm/amd/display: fix mapping to non-allocated address Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 18/58] drm/msm/dp: Remove INIT_SETUP delay Sasha Levin
2023-02-27 9:12 ` Johan Hovold
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 19/58] HID: uclogic: Add frame type quirk Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 20/58] HID: uclogic: Add battery quirk Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 21/58] HID: uclogic: Add support for XP-PEN Deco Pro SW Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 22/58] HID: uclogic: Add support for XP-PEN Deco Pro MW Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 23/58] HID: multitouch: Add quirks for flipped axes Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 24/58] drm/msm/dsi: Add missing check for alloc_ordered_workqueue Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 25/58] drm: rcar-du: Add quirk for H3 ES1.x pclk workaround Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 26/58] drm: rcar-du: Fix setting a reserved bit in DPLLCR Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 27/58] drm/drm_print: correct format problem Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 28/58] drm/amd/display: Set hvm_enabled flag for S/G mode Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 29/58] habanalabs: extend fatal messages to contain PCI info Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 30/58] habanalabs: fix bug in timestamps registration code Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 31/58] docs/scripts/gdb: add necessary make scripts_gdb step Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 32/58] drm/msm/dpu: Add DSC hardware blocks to register snapshot Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 33/58] ASoC: soc-compress: Reposition and add pcm_mutex Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 34/58] ASoC: kirkwood: Iterate over array indexes instead of using pointer math Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 35/58] regulator: max77802: Bounds check regulator id against opmode Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 36/58] regulator: s5m8767: Bounds check id indexing into arrays Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 37/58] Revert "drm/amdgpu: TA unload messages are not actually sent to psp when amdgpu is uninstalled" Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 38/58] drm/amd/display: fix FCLK pstate change underflow Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 39/58] gfs2: Improve gfs2_make_fs_rw error handling Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 40/58] hwmon: (coretemp) Simplify platform device handling Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 41/58] hwmon: (nct6775) Directly call ASUS ACPI WMI method Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 42/58] hwmon: (nct6775) B650/B660/X670 ASUS boards support Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 43/58] pinctrl: at91: use devm_kasprintf() to avoid potential leaks Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 44/58] drm/amd/display: Do not set DRR on pipe commit Sasha Levin
2023-02-27 2:04 ` Sasha Levin [this message]
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 46/58] scsi: snic: Fix memory leak with using debugfs_lookup() Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 47/58] scsi: ufs: core: Fix device management cmd timeout flow Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 48/58] HID: logitech-hidpp: Don't restart communication if not necessary Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 49/58] drm/amd/display: Move DCN314 DOMAIN power control to DMCUB Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 50/58] drm/amd/display: Enable P-state validation checks for DCN314 Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 51/58] drm: panel-orientation-quirks: Add quirk for Lenovo IdeaPad Duet 3 10IGL5 Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 52/58] drm/amd/display: Disable HUBP/DPP PG on DCN314 for now Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 53/58] dm thin: add cond_resched() to various workqueue loops Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 54/58] dm cache: " Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 55/58] nfsd: zero out pointers after putting nfsd_files on COPY setup error Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 56/58] nfsd: clean up potential nfsd_file refcount leaks in COPY codepath Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 57/58] nfsd: don't hand out delegation on setuid files being opened for write Sasha Levin
2023-02-27 2:04 ` [PATCH AUTOSEL 6.1 58/58] cifs: prevent data race in smb2_reconnect() 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=20230227020457.1048737-45-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=Alvin.Lee2@amd.com \
--cc=Dillon.Varone@amd.com \
--cc=Duncan.Ma@amd.com \
--cc=HaoPing.Liu@amd.com \
--cc=Josip.Pavic@amd.com \
--cc=Jun.Lei@amd.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=Wayne.Lin@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=aurabindo.pillai@amd.com \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.vanzylldejong@amd.com \
--cc=harry.wentland@amd.com \
--cc=jdhillon@amd.com \
--cc=jiapeng.chong@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=qingqing.zhuo@amd.com \
--cc=samson.tam@amd.com \
--cc=stable@vger.kernel.org \
--cc=sunpeng.li@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