From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Alex Deucher <alexdeucher@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Next Mailing List <linux-next@vger.kernel.org>,
Dave Airlie <airlied@linux.ie>
Subject: Re: linux-next: build failure after merge of the amdgpu tree
Date: Sat, 15 Jan 2022 10:25:01 +1100 [thread overview]
Message-ID: <20220115102501.70c416c9@canb.auug.org.au> (raw)
In-Reply-To: <20220114113639.2e2cc115@canb.auug.org.au>
[-- Attachment #1: Type: text/plain, Size: 7965 bytes --]
Hi all,
On Fri, 14 Jan 2022 11:36:39 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> After merging the amdgpu tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
>
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c: In function 'program_timing_sync':
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:1409:17: error: 'struct dc_config' has no member named 'use_pipe_ctx_sync_logic'
> 1409 | if (dc->config.use_pipe_ctx_sync_logic) {
> | ^
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:1412:20: error: 'struct pipe_ctx' has no member named 'pipe_idx_syncd'
> 1412 | if (pipe_set[j]->pipe_idx_syncd == pipe_set[0]->pipe_idx_syncd) {
> | ^~
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:1412:51: error: 'struct pipe_ctx' has no member named 'pipe_idx_syncd'
> 1412 | if (pipe_set[j]->pipe_idx_syncd == pipe_set[0]->pipe_idx_syncd) {
> | ^~
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:1418:17: error: 'struct pipe_ctx' has no member named 'pipe_idx_syncd'
> 1418 | pipe_set[j]->pipe_idx_syncd = pipe_set[0]->pipe_idx_syncd;
> | ^~
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:1418:47: error: 'struct pipe_ctx' has no member named 'pipe_idx_syncd'
> 1418 | pipe_set[j]->pipe_idx_syncd = pipe_set[0]->pipe_idx_syncd;
> | ^~
>
> Caused by git doing a bad automatic merge with Linus' tree because commit
>
> 75b950ef6166 ("Revert "drm/amd/display: Fix for otg synchronization logic"")
>
> has been cherry-picked into the amdgpu tree and then a fixed version of
> the reverted commit applied on top. It would be easier if just a
> fix up for the oriingal commit was added to the amdgpu tree, or Linus'
> tree was merged into the amdgpu tree and then the fixed version applied.
>
> I have used the amdgpu tree from next-20220113 for today.
This is what I have had to apply as a merge fix up to make this work:
(This is basically all the files that were not changed by the revert and
fix pair of patches)
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Sat, 15 Jan 2022 10:01:47 +1100
Subject: [PATCH] fix up for bad merge due to cherry-picked and fixed commit
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
.../gpu/drm/amd/display/dc/core/dc_resource.c | 54 +++++++++++++++++++
drivers/gpu/drm/amd/display/dc/dc.h | 1 +
.../display/dc/dce110/dce110_hw_sequencer.c | 8 +++
.../drm/amd/display/dc/dcn31/dcn31_resource.c | 3 ++
.../gpu/drm/amd/display/dc/inc/core_types.h | 1 +
5 files changed, 67 insertions(+)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index d4ff6cc6b8d9..b3912ff9dc91 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -3217,6 +3217,60 @@ struct hpo_dp_link_encoder *resource_get_hpo_dp_link_enc_for_det_lt(
}
#endif
+void reset_syncd_pipes_from_disabled_pipes(struct dc *dc,
+ struct dc_state *context)
+{
+ int i, j;
+ struct pipe_ctx *pipe_ctx_old, *pipe_ctx, *pipe_ctx_syncd;
+
+ /* If pipe backend is reset, need to reset pipe syncd status */
+ for (i = 0; i < dc->res_pool->pipe_count; i++) {
+ pipe_ctx_old = &dc->current_state->res_ctx.pipe_ctx[i];
+ pipe_ctx = &context->res_ctx.pipe_ctx[i];
+
+ if (!pipe_ctx_old->stream)
+ continue;
+
+ if (pipe_ctx_old->top_pipe || pipe_ctx_old->prev_odm_pipe)
+ continue;
+
+ if (!pipe_ctx->stream ||
+ pipe_need_reprogram(pipe_ctx_old, pipe_ctx)) {
+
+ /* Reset all the syncd pipes from the disabled pipe */
+ for (j = 0; j < dc->res_pool->pipe_count; j++) {
+ pipe_ctx_syncd = &context->res_ctx.pipe_ctx[j];
+ if ((GET_PIPE_SYNCD_FROM_PIPE(pipe_ctx_syncd) == pipe_ctx_old->pipe_idx) ||
+ !IS_PIPE_SYNCD_VALID(pipe_ctx_syncd))
+ SET_PIPE_SYNCD_TO_PIPE(pipe_ctx_syncd, j);
+ }
+ }
+ }
+}
+
+void check_syncd_pipes_for_disabled_master_pipe(struct dc *dc,
+ struct dc_state *context,
+ uint8_t disabled_master_pipe_idx)
+{
+ int i;
+ struct pipe_ctx *pipe_ctx, *pipe_ctx_check;
+
+ pipe_ctx = &context->res_ctx.pipe_ctx[disabled_master_pipe_idx];
+ if ((GET_PIPE_SYNCD_FROM_PIPE(pipe_ctx) != disabled_master_pipe_idx) ||
+ !IS_PIPE_SYNCD_VALID(pipe_ctx))
+ SET_PIPE_SYNCD_TO_PIPE(pipe_ctx, disabled_master_pipe_idx);
+
+ /* for the pipe disabled, check if any slave pipe exists and assert */
+ for (i = 0; i < dc->res_pool->pipe_count; i++) {
+ pipe_ctx_check = &context->res_ctx.pipe_ctx[i];
+
+ if ((GET_PIPE_SYNCD_FROM_PIPE(pipe_ctx_check) == disabled_master_pipe_idx) &&
+ IS_PIPE_SYNCD_VALID(pipe_ctx_check) && (i != disabled_master_pipe_idx))
+ DC_ERR("DC: Failure: pipe_idx[%d] syncd with disabled master pipe_idx[%d]\n",
+ i, disabled_master_pipe_idx);
+ }
+}
+
uint8_t resource_transmitter_to_phy_idx(const struct dc *dc, enum transmitter transmitter)
{
/* TODO - get transmitter to phy idx mapping from DMUB */
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index da2c78ce14d6..288e7b01f561 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -344,6 +344,7 @@ struct dc_config {
uint8_t vblank_alignment_max_frame_time_diff;
bool is_asymmetric_memory;
bool is_single_rank_dimm;
+ bool use_pipe_ctx_sync_logic;
};
enum visual_confirm {
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 78192ecba102..f1593186e964 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
@@ -1566,6 +1566,10 @@ static enum dc_status apply_single_controller_ctx_to_hw(
&pipe_ctx->stream->audio_info);
}
+ /* make sure no pipes syncd to the pipe being enabled */
+ if (!pipe_ctx->stream->apply_seamless_boot_optimization && dc->config.use_pipe_ctx_sync_logic)
+ check_syncd_pipes_for_disabled_master_pipe(dc, context, pipe_ctx->pipe_idx);
+
#if defined(CONFIG_DRM_AMD_DC_DCN)
/* DCN3.1 FPGA Workaround
* Need to enable HPO DP Stream Encoder before setting OTG master enable.
@@ -2297,6 +2301,10 @@ enum dc_status dce110_apply_ctx_to_hw(
enum dc_status status;
int i;
+ /* reset syncd pipes from disabled pipes */
+ if (dc->config.use_pipe_ctx_sync_logic)
+ reset_syncd_pipes_from_disabled_pipes(dc, context);
+
/* Reset old context */
/* look up the targets that have been removed since last commit */
hws->funcs.reset_hw_ctx_wrap(dc, context);
diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c b/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c
index 42ed47e8133d..8d64187478e4 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c
@@ -2260,6 +2260,9 @@ static bool dcn31_resource_construct(
dc->caps.color.mpc.ogam_rom_caps.hlg = 0;
dc->caps.color.mpc.ocsc = 1;
+ /* Use pipe context based otg sync logic */
+ dc->config.use_pipe_ctx_sync_logic = true;
+
/* read VBIOS LTTPR caps */
{
if (ctx->dc_bios->funcs->get_lttpr_caps) {
diff --git a/drivers/gpu/drm/amd/display/dc/inc/core_types.h b/drivers/gpu/drm/amd/display/dc/inc/core_types.h
index 890280026e69..943240e2809e 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/core_types.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/core_types.h
@@ -382,6 +382,7 @@ struct pipe_ctx {
struct pll_settings pll_settings;
uint8_t pipe_idx;
+ uint8_t pipe_idx_syncd;
struct pipe_ctx *top_pipe;
struct pipe_ctx *bottom_pipe;
--
2.33.0
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2022-01-14 23:25 UTC|newest]
Thread overview: 138+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-14 0:36 linux-next: build failure after merge of the amdgpu tree Stephen Rothwell
2022-01-14 23:25 ` Stephen Rothwell [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-02-13 4:00 Stephen Rothwell
2024-02-13 14:00 ` Alex Deucher
2023-10-10 1:43 Stephen Rothwell
2023-10-10 21:14 ` Rodrigo Siqueira Jordao
2023-10-16 0:39 ` Stephen Rothwell
2023-10-16 14:53 ` Rodrigo Siqueira Jordao
2023-10-16 20:59 ` Stephen Rothwell
2023-10-17 1:08 ` Stephen Rothwell
2023-10-16 0:18 ` Stephen Rothwell
2023-10-19 1:06 ` Stephen Rothwell
2023-10-24 0:59 ` Stephen Rothwell
2023-10-24 12:57 ` Alex Deucher
2023-10-24 19:52 ` Alex Deucher
2023-10-24 21:47 ` Stephen Rothwell
2023-05-22 7:15 Stephen Rothwell
2023-05-22 16:29 ` Nick Desaulniers
2023-05-22 16:35 ` Alex Deucher
2023-05-22 16:47 ` Nick Desaulniers
2023-05-22 19:14 ` Alex Deucher
2023-05-22 7:11 Stephen Rothwell
2023-05-22 7:24 ` Lazar, Lijo
2023-05-22 7:00 Stephen Rothwell
2023-05-22 7:04 ` Zhang, Hawking
2023-05-19 0:06 Stephen Rothwell
2023-05-19 3:10 ` James Zhu
2023-05-19 13:38 ` Alex Deucher
2023-01-30 1:20 Stephen Rothwell
2022-10-31 0:13 Stephen Rothwell
2022-08-30 1:41 Stephen Rothwell
2022-07-25 11:16 Stephen Rothwell
2022-07-27 16:21 ` Rodrigo Siqueira Jordao
2022-07-27 16:23 ` Alex Deucher
2022-07-19 2:36 Stephen Rothwell
2022-07-20 2:47 ` Stephen Rothwell
2022-07-21 2:16 ` Stephen Rothwell
2022-07-22 2:52 ` Stephen Rothwell
2022-07-22 13:30 ` Alex Deucher
2022-06-23 6:07 Stephen Rothwell
2022-06-23 11:01 ` Greg KH
2022-06-27 14:40 ` Greg KH
2022-06-15 4:37 Stephen Rothwell
2022-06-15 18:17 ` Alex Deucher
2022-06-14 4:51 Stephen Rothwell
2022-06-03 4:43 Stephen Rothwell
2022-06-09 3:14 ` Stephen Rothwell
2022-06-15 5:00 ` Stephen Rothwell
2022-06-21 8:15 ` Stephen Rothwell
2022-06-21 15:02 ` Alex Deucher
2022-06-21 22:07 ` Stephen Rothwell
2022-06-22 14:48 ` Alex Deucher
2022-06-23 7:47 ` Stephen Rothwell
2022-06-02 0:30 Stephen Rothwell
2022-05-06 1:06 Stephen Rothwell
2022-05-05 9:47 Stephen Rothwell
2022-05-05 18:12 ` Nathan Chancellor
2022-05-05 18:46 ` Alex Deucher
2022-05-06 1:05 ` Stephen Rothwell
[not found] <BN9PR12MB5145ECB75120FF9AC1AA4CFB8DEC9@BN9PR12MB5145.namprd12.prod.outlook.com>
2022-04-13 14:18 ` Alex Deucher
[not found] ` <BN9PR12MB5145D81F9978B656E9BB67C78DEF9@BN9PR12MB5145.namprd12.prod.outlook.com>
2022-04-14 14:23 ` Rodrigo Siqueira Jordao
2022-04-14 14:27 ` Alex Deucher
2022-04-14 14:31 ` Rodrigo Siqueira Jordao
2022-04-13 2:32 Stephen Rothwell
2022-04-08 4:46 Stephen Rothwell
2022-03-07 0:13 Stephen Rothwell
2022-03-07 7:16 ` Uwe Kleine-König
2022-03-07 13:04 ` Mark Brown
2022-03-08 11:15 ` Noralf Trønnes
2022-02-15 0:57 Stephen Rothwell
2022-02-01 3:32 Stephen Rothwell
2022-02-01 18:32 ` Limonciello, Mario
2022-02-01 18:53 ` Alex Deucher
2022-01-26 23:42 Stephen Rothwell
2021-12-03 1:11 Stephen Rothwell
2021-11-18 4:23 Stephen Rothwell
2021-10-08 0:31 Stephen Rothwell
2021-10-08 6:27 ` Simon Ser
2021-10-08 8:29 ` Stephen Rothwell
2021-10-08 9:22 ` Simon Ser
2021-10-08 14:11 ` Alex Deucher
2021-10-08 18:07 ` Simon Ser
2021-10-11 7:33 ` Christoph Hellwig
2021-10-11 7:39 ` Simon Ser
2021-10-11 7:43 ` Christoph Hellwig
2021-10-11 7:49 ` Simon Ser
2021-10-11 7:51 ` Christoph Hellwig
2021-10-11 7:57 ` Simon Ser
2021-10-11 8:01 ` Christoph Hellwig
2021-10-11 8:21 ` Simon Ser
2021-10-09 4:57 ` Stephen Rothwell
2021-10-12 2:25 ` Stephen Rothwell
2021-10-12 13:32 ` Alex Deucher
2021-09-29 1:20 Stephen Rothwell
2021-09-17 0:57 Stephen Rothwell
2021-08-02 15:55 linux-next: Build " Mark Brown
2021-07-28 12:34 linux-next: build " Mark Brown
2021-05-27 5:58 Stephen Rothwell
2021-05-04 23:34 Stephen Rothwell
2021-05-09 22:46 ` Stephen Rothwell
2021-05-10 14:24 ` Alex Deucher
2021-05-10 22:18 ` Stephen Rothwell
2021-05-10 22:23 ` Alex Deucher
2021-05-10 23:02 ` Stephen Rothwell
2021-03-30 2:18 Stephen Rothwell
2021-03-19 1:21 Stephen Rothwell
2021-02-23 1:11 Stephen Rothwell
2021-02-05 2:12 Stephen Rothwell
2021-01-15 5:35 Stephen Rothwell
2021-01-15 5:57 ` Huang Rui
2021-01-15 8:46 ` Huang, Ray
2021-01-15 14:56 ` Alex Deucher
2021-01-08 1:17 Stephen Rothwell
2020-10-27 1:08 Stephen Rothwell
2020-06-17 0:26 Stephen Rothwell
2020-06-12 0:25 Stephen Rothwell
2020-06-26 1:47 ` Stephen Rothwell
2020-02-11 22:48 Stephen Rothwell
2020-02-12 16:14 ` Rodrigo Siqueira
2020-01-28 4:42 Stephen Rothwell
2020-01-28 21:18 ` Alex Deucher
2020-01-08 2:18 Stephen Rothwell
2019-11-08 5:31 Stephen Rothwell
2019-11-08 15:50 ` Grodzovsky, Andrey
2019-11-08 15:59 ` Alex Deucher
2019-11-07 0:46 Stephen Rothwell
2019-08-13 8:10 Stephen Rothwell
2019-08-13 8:21 ` Huang, Ray
2019-08-13 14:01 ` Alex Deucher
2019-08-16 0:21 ` Stephen Rothwell
2019-08-16 1:52 ` Alex Deucher
2019-08-16 2:43 ` Stephen Rothwell
2019-06-26 11:22 Stephen Rothwell
2019-06-27 3:35 ` Stephen Rothwell
2019-06-27 14:18 ` Alex Deucher
2019-06-27 22:01 ` Stephen Rothwell
2019-06-24 4:24 Stephen Rothwell
2019-03-19 0:04 Stephen Rothwell
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=20220115102501.70c416c9@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=airlied@linux.ie \
--cc=alexdeucher@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/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;
as well as URLs for NNTP newsgroup(s).