Skip to contentSkip to conversation

linux-next: manual merge of the drm tree with Linus' tree

DISCUSSION Stephen Rothwell 3 participants 3 messages Sep 16, 2024 – Sep 17, 2024 Linux-next tree

lore
Share & tools
lore
#0 lore raw

Hi all,

Today's linux-next merge of the drm tree got a conflict in:

drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c

between commit:

e835d5144f5e ("drm/amd/display: Avoid race between dcn35_set_drr() and dc_state_destruct()")

from Linus' tree and commit:

be7a6a517164 ("drm/amd/display: Check stream pointer is initialized before accessing")

from the drm tree.

I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

Signature · 29 lines
Cheers,
Stephen Rothwell

diff --cc drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c
index d5e9aec52a05,a4c6decee0f8..000000000000
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c
@@@ -1462,17 -1414,10 +1414,17 @@@ void dcn35_set_drr(struct pipe_ctx **pi
  	params.vertical_total_mid_frame_num = adjust.v_total_mid_frame_num;
  
  	for (i = 0; i < num_pipes; i++) {
 -		if ((pipe_ctx[i]->stream_res.tg != NULL) && pipe_ctx[i]->stream_res.tg->funcs) {
 +		/* dc_state_destruct() might null the stream resources, so fetch tg
 +		 * here first to avoid a race condition. The lifetime of the pointee
 +		 * itself (the timing_generator object) is not a problem here.
 +		 */
 +		struct timing_generator *tg = pipe_ctx[i]->stream_res.tg;
 +
 +		if ((tg != NULL) && tg->funcs) {
- 			struct dc_crtc_timing *timing = &pipe_ctx[i]->stream->timing;
- 			struct dc *dc = pipe_ctx[i]->stream->ctx->dc;
 +
- 			if (dc->debug.static_screen_wait_frames) {
+ 			if (pipe_ctx[i]->stream && pipe_ctx[i]->stream->ctx->dc->debug.static_screen_wait_frames) {
+ 				struct dc_crtc_timing *timing = &pipe_ctx[i]->stream->timing;
+ 				struct dc *dc = pipe_ctx[i]->stream->ctx->dc;
  				unsigned int frame_rate = timing->pix_clk_100hz / (timing->h_total * timing->v_total);
  
  				if (frame_rate >= 120 && dc->caps.ips_support &&
#1 lore raw
Quoted 14 lines · Stephen Rothwell

Hi all,

Today's linux-next merge of the drm tree got a conflict in:

   drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c

between commit:

   e835d5144f5e ("drm/amd/display: Avoid race between dcn35_set_drr() and dc_state_destruct()")

from Linus' tree and commit:

be7a6a517164 ("drm/amd/display: Check stream pointer is initialized before accessing")

Quoted 9 lines

from the drm tree.

I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

On close inspection it might be worthwhile to take the same precautions that we now take with tg, also with pipe_ctx[i]->stream.

@Alex: What do you think?

With best wishes,
Tobias

#2 lore raw

+ Harry

Quoted 26 lines · Tobias Jakobi
Quoted 14 lines · Stephen Rothwell

Hi all,

Today's linux-next merge of the drm tree got a conflict in:

   drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c

between commit:

   e835d5144f5e ("drm/amd/display: Avoid race between dcn35_set_drr() and dc_state_destruct()")

from Linus' tree and commit:

be7a6a517164 ("drm/amd/display: Check stream pointer is initialized before accessing")

Quoted 9 lines

from the drm tree.

I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

Quoted 4 lines

On close inspection it might be worthwhile to take the same precautions that we now take with tg, also with pipe_ctx[i]->stream.

@Alex: What do you think?

@Wentland, Harry can stream be NULL here?

Alex

Quoted 4 lines

With best wishes,
Tobias