Skip to contentSkip to conversation

drm/amd/display: Handle NULL dccg in dce110_disable_stream

PATCH In review Michel Dänzer 2 participants 3 messages Sep 11, 2023 – Sep 15, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: Handle NULL dccg in dce110_disable_stream

From: Michel Dänzer <[email protected]>

It can be NULL e.g. with Raven.

Fixes 927e784c180c ("drm/amd/display: Add symclk enable/disable during stream enable/disable")
---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +4 -2
index ad967b58d7be..a9dca69ee8f6 100644
@@ -1179,9 +1179,11 @@ void dce110_disable_stream(struct pipe_ctx *pipe_ctx)
 		dccg->funcs->set_dtbclk_dto(dccg, &dto_params);
 		dccg->funcs->disable_symclk32_se(dccg, dp_hpo_inst);
 		dccg->funcs->set_dpstreamclk(dccg, REFCLK, tg->inst, dp_hpo_inst);
-	} else if (pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST && dccg->funcs->disable_symclk_se)
+	} else if (pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST &&
+		   dccg && dccg->funcs->disable_symclk_se) {
 		dccg->funcs->disable_symclk_se(dccg, stream_enc->stream_enc_inst,
-				link_enc->transmitter - TRANSMITTER_UNIPHY_A);
+					       link_enc->transmitter - TRANSMITTER_UNIPHY_A);
+	}
 
 	if (dc->link_srv->dp_is_128b_132b_signal(pipe_ctx)) {
 		/* TODO: This looks like a bug to me as we are disabling HPO IO when
Signature · 1 line
2.40.1
#1 lore raw
Quoted 7 lines · Michel Dänzer

From: Michel Dänzer <[email protected]>

It can be NULL e.g. with Raven.

Fixes 927e784c180c ("drm/amd/display: Add symclk enable/disable during stream enable/disable")

Looks like this was fixed in:
https://gitlab.freedesktop.org/agd5f/linux/-/commit/7f7925e258288cfcfa2b0e0631fcd91a39744f94
but needs to be applied to 6.6. I'll queue it up for 6.6.

Alex

Quoted 25 lines
---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +4 -3
index ad967b58d7be..a9dca69ee8f6 100644
@@ -1179,9 +1179,11 @@ void dce110_disable_stream(struct pipe_ctx *pipe_ctx)
                dccg->funcs->set_dtbclk_dto(dccg, &dto_params);
                dccg->funcs->disable_symclk32_se(dccg, dp_hpo_inst);
                dccg->funcs->set_dpstreamclk(dccg, REFCLK, tg->inst, dp_hpo_inst);
-       } else if (pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST && dccg->funcs->disable_symclk_se)
+       } else if (pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST &&
+                  dccg && dccg->funcs->disable_symclk_se) {
                dccg->funcs->disable_symclk_se(dccg, stream_enc->stream_enc_inst,
-                               link_enc->transmitter - TRANSMITTER_UNIPHY_A);
+                                              link_enc->transmitter - TRANSMITTER_UNIPHY_A);
+       }
 
        if (dc->link_srv->dp_is_128b_132b_signal(pipe_ctx)) {
                /* TODO: This looks like a bug to me as we are disabling HPO IO when
--

2.40.1

#2 lore raw
Quoted 4 lines · Alex Deucher
Quoted 3 lines · Michel Dänzer

From: Michel Dänzer <[email protected]>

Quoted 8 lines
Quoted 4 lines

It can be NULL e.g. with Raven.

Fixes 927e784c180c ("drm/amd/display: Add symclk enable/disable during stream enable/disable")

Looks like this was fixed in:
https://gitlab.freedesktop.org/agd5f/linux/-/commit/7f7925e258288cfcfa2b0e0631fcd91a39744f94
but needs to be applied to 6.6. I'll queue it up for 6.6.

Thanks.

FWIW, I notice some minor issues in that commit:

The if (dc->link_srv->dp_is_128b_132b_signal(pipe_ctx)) block in dce110_disable_stream still always calculates dto_params & dp_hpo_inst, but doesn't use them if dccg is NULL. (My assumption here was that dccg cannot be NULL in this block, I might be wrong though)

And some cosmetic issues:

The second line of the dccg->funcs->disable_symclk_se call remains incorrectly indented.

The newly guarded dccg->funcs->update_clocks calls lack curly braces around them.

dcn20_enable_stream is left with

	} else {
		}
Signature · 2 lines
Earthling Michel Dänzer            |                  https://redhat.com
Libre software enthusiast          |         Mesa and Xwayland developer