Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd/display: Revert inbox0 lock for cursor due to deadlock

[Why]
A deadlock occurs when using inbox0 lock for cursor operations on
PSR-SU and Replays that does not when using the inbox1 locking path.

This is because of a priority inversion issue where inbox1 work
cannot be serviced while holding the HW lock from driver and sending
cursor notifications to DMUB.

Typically the lower priority of inbox1 for the lock command would
allow the PSR and Replay FSMs to complete their transition prior
to giving driver the lock but this is no longer the case with inbox0
having the highest priority in servicing.

[How]
This will reintroduce any synchronization bugs that were there
with Replay or PSR-SU touching the cursor at the same time as driver.

Reviewed-by: Charlene Liu <charlene.liu@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Chuanyu Tseng <chuanyu.tseng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Nicholas Kazlauskas and committed by
Alex Deucher
3cf49608 7d59465d

+4 -26
+4 -26
drivers/gpu/drm/amd/display/dc/core/dc_stream.c
··· 33 33 #include "dc_dmub_srv.h" 34 34 #include "dc_state_priv.h" 35 35 #include "dc_stream_priv.h" 36 - #include "dce/dmub_hw_lock_mgr.h" 37 36 38 37 #define DC_LOGGER dc->ctx->logger 39 38 #ifndef MIN ··· 258 259 struct resource_context *res_ctx; 259 260 struct pipe_ctx *pipe_to_program = NULL; 260 261 bool enable_cursor_offload = dc_dmub_srv_is_cursor_offload_enabled(dc); 261 - bool unlock_dmub = false; 262 262 263 263 if (!stream) 264 264 return; ··· 276 278 if (enable_cursor_offload && dc->hwss.begin_cursor_offload_update) { 277 279 dc->hwss.begin_cursor_offload_update(dc, pipe_ctx); 278 280 } else { 279 - if (dc->hwss.dmub_hw_control_lock && pipe_ctx->stream && 280 - should_use_dmub_inbox0_lock_for_link(dc, pipe_ctx->stream->link)) { 281 - dc->hwss.dmub_hw_control_lock(dc, dc->current_state, true); 282 - unlock_dmub = true; 283 - } 284 - 285 281 dc->hwss.cursor_lock(dc, pipe_to_program, true); 286 282 if (pipe_to_program->next_odm_pipe) 287 283 dc->hwss.cursor_lock(dc, pipe_to_program->next_odm_pipe, true); ··· 298 306 dc->hwss.cursor_lock(dc, pipe_to_program, false); 299 307 if (pipe_to_program->next_odm_pipe) 300 308 dc->hwss.cursor_lock(dc, pipe_to_program->next_odm_pipe, false); 301 - 302 - if (unlock_dmub) 303 - dc->hwss.dmub_hw_control_lock(dc, dc->current_state, false); 304 309 } 305 310 } 306 311 } ··· 405 416 struct resource_context *res_ctx; 406 417 struct pipe_ctx *pipe_to_program = NULL; 407 418 bool enable_cursor_offload = dc_dmub_srv_is_cursor_offload_enabled(dc); 408 - bool unlock_dmub = false; 409 419 410 420 if (!stream) 411 421 return; ··· 424 436 if (!pipe_to_program) { 425 437 pipe_to_program = pipe_ctx; 426 438 427 - if (enable_cursor_offload && dc->hwss.begin_cursor_offload_update) { 439 + if (enable_cursor_offload && dc->hwss.begin_cursor_offload_update) 428 440 dc->hwss.begin_cursor_offload_update(dc, pipe_ctx); 429 - } else { 430 - if (dc->hwss.dmub_hw_control_lock && pipe_ctx->stream && 431 - should_use_dmub_inbox0_lock_for_link(dc, pipe_ctx->stream->link)) { 432 - dc->hwss.dmub_hw_control_lock(dc, dc->current_state, true); 433 - unlock_dmub = true; 434 - } 441 + else 435 442 dc->hwss.cursor_lock(dc, pipe_to_program, true); 436 - } 437 443 } 438 444 439 445 dc->hwss.set_cursor_position(pipe_ctx); ··· 439 457 } 440 458 441 459 if (pipe_to_program) { 442 - if (enable_cursor_offload && dc->hwss.commit_cursor_offload_update) { 460 + if (enable_cursor_offload && dc->hwss.commit_cursor_offload_update) 443 461 dc->hwss.commit_cursor_offload_update(dc, pipe_to_program); 444 - } else { 462 + else 445 463 dc->hwss.cursor_lock(dc, pipe_to_program, false); 446 - 447 - if (unlock_dmub) 448 - dc->hwss.dmub_hw_control_lock(dc, dc->current_state, false); 449 - } 450 464 } 451 465 } 452 466