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

drm/amd/display: Add driver support for future FAMS versions

[WHY&HOW]
Changes to support future versions of FAMS.

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Dillon Varone and committed by
Alex Deucher
5324e2b2 19407237

+37 -6
-2
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c
··· 44 44 45 45 #include "bios_parser_common.h" 46 46 47 - #include "dc.h" 48 - 49 47 #define THREE_PERCENT_OF_10000 300 50 48 51 49 #define LAST_RECORD_TYPE 0xff
+4 -1
drivers/gpu/drm/amd/display/dc/core/dc.c
··· 36 36 #include "resource.h" 37 37 #include "dc_state.h" 38 38 #include "dc_state_priv.h" 39 + #include "dc_plane_priv.h" 39 40 40 41 #include "gpio_service_interface.h" 41 42 #include "clk_mgr.h" ··· 3562 3561 int i, j; 3563 3562 struct pipe_ctx *top_pipe_to_program = NULL; 3564 3563 struct dc_stream_status *stream_status = NULL; 3564 + 3565 3565 dc_exit_ips_for_hw_access(dc); 3566 3566 3567 3567 dc_z10_restore(dc); ··· 3620 3618 context->block_sequence, 3621 3619 &(context->block_sequence_steps), 3622 3620 top_pipe_to_program, 3623 - stream_status); 3621 + stream_status, 3622 + context); 3624 3623 hwss_execute_sequence(dc, 3625 3624 context->block_sequence, 3626 3625 context->block_sequence_steps);
+2 -1
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c
··· 560 560 struct block_sequence block_sequence[], 561 561 unsigned int *num_steps, 562 562 struct pipe_ctx *pipe_ctx, 563 - struct dc_stream_status *stream_status) 563 + struct dc_stream_status *stream_status, 564 + struct dc_state *context) 564 565 { 565 566 struct dc_plane_state *plane = pipe_ctx->plane_state; 566 567 struct dc_stream_state *stream = pipe_ctx->stream;
+1
drivers/gpu/drm/amd/display/dc/core/dc_state.c
··· 915 915 916 916 return stream; 917 917 } 918 +
+20
drivers/gpu/drm/amd/display/dc/core/dc_surface.c
··· 60 60 // no more pointers to free within dc_plane_state 61 61 } 62 62 63 + 64 + /* dc_state is passed in separately since it may differ from the current dc state accessible from plane_state e.g. 65 + * if the driver is doing an update from an old context to a new one and the caller wants the pipe mask for the new 66 + * context rather than the existing one 67 + */ 68 + uint8_t dc_plane_get_pipe_mask(struct dc_state *dc_state, const struct dc_plane_state *plane_state) 69 + { 70 + uint8_t pipe_mask = 0; 71 + int i; 72 + 73 + for (i = 0; i < plane_state->ctx->dc->res_pool->pipe_count; i++) { 74 + struct pipe_ctx *pipe_ctx = &dc_state->res_ctx.pipe_ctx[i]; 75 + 76 + if (pipe_ctx->plane_state == plane_state && pipe_ctx->plane_res.hubp) 77 + pipe_mask |= 1 << pipe_ctx->plane_res.hubp->inst; 78 + } 79 + 80 + return pipe_mask; 81 + } 82 + 63 83 /******************************************************************************* 64 84 * Public functions 65 85 ******************************************************************************/
+3
drivers/gpu/drm/amd/display/dc/dc.h
··· 44 44 45 45 #include "dml2/dml2_wrapper.h" 46 46 47 + #include "dmub/inc/dmub_cmd.h" 48 + 47 49 struct abm_save_restore; 48 50 49 51 /* forward declaration */ ··· 221 219 bool mclk_sw; 222 220 bool subvp_psr; 223 221 bool gecc_enable; 222 + uint8_t fams_ver; 224 223 }; 225 224 226 225 struct dc_caps {
+2
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
··· 35 35 #include "resource.h" 36 36 #include "clk_mgr.h" 37 37 #include "dc_state_priv.h" 38 + #include "dc_plane_priv.h" 38 39 39 40 #define CTX dc_dmub_srv->ctx 40 41 #define DC_LOGGER CTX->logger ··· 1594 1593 1595 1594 return result; 1596 1595 } 1596 +
+1
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h
··· 35 35 struct dc_crtc_timing_adjust; 36 36 struct dc_crtc_timing; 37 37 struct dc_state; 38 + struct dc_surface_update; 38 39 39 40 struct dc_reg_helper_state { 40 41 bool gather_in_progress;
+1
drivers/gpu/drm/amd/display/dc/dc_plane_priv.h
··· 30 30 31 31 void dc_plane_construct(struct dc_context *ctx, struct dc_plane_state *plane_state); 32 32 void dc_plane_destruct(struct dc_plane_state *plane_state); 33 + uint8_t dc_plane_get_pipe_mask(struct dc_state *dc_state, const struct dc_plane_state *plane_state); 33 34 34 35 #endif /* _DC_PLANE_PRIV_H_ */
+1 -1
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c
··· 956 956 dc->caps.dmub_caps.mclk_sw = dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch_ver; 957 957 958 958 if (dc->ctx->dmub_srv->dmub->fw_version < 959 - DMUB_FW_VERSION(7, 0, 35)) { 959 + DMUB_FW_VERSION(7, 0, 35)) { 960 960 dc->debug.force_disable_subvp = true; 961 961 dc->debug.disable_fpo_optimizations = true; 962 962 }
+2 -1
drivers/gpu/drm/amd/display/dc/hwss/hw_sequencer.h
··· 482 482 struct block_sequence block_sequence[], 483 483 unsigned int *num_steps, 484 484 struct pipe_ctx *pipe_ctx, 485 - struct dc_stream_status *stream_status); 485 + struct dc_stream_status *stream_status, 486 + struct dc_state *context); 486 487 487 488 void hwss_send_dmcub_cmd(union block_sequence_params *params); 488 489