17ed4e635SHarry Wentland /* 27ed4e635SHarry Wentland * Copyright 2017 Advanced Micro Devices, Inc. 37ed4e635SHarry Wentland * 47ed4e635SHarry Wentland * Permission is hereby granted, free of charge, to any person obtaining a 57ed4e635SHarry Wentland * copy of this software and associated documentation files (the "Software"), 67ed4e635SHarry Wentland * to deal in the Software without restriction, including without limitation 77ed4e635SHarry Wentland * the rights to use, copy, modify, merge, publish, distribute, sublicense, 87ed4e635SHarry Wentland * and/or sell copies of the Software, and to permit persons to whom the 97ed4e635SHarry Wentland * Software is furnished to do so, subject to the following conditions: 107ed4e635SHarry Wentland * 117ed4e635SHarry Wentland * The above copyright notice and this permission notice shall be included in 127ed4e635SHarry Wentland * all copies or substantial portions of the Software. 137ed4e635SHarry Wentland * 147ed4e635SHarry Wentland * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 157ed4e635SHarry Wentland * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 167ed4e635SHarry Wentland * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 177ed4e635SHarry Wentland * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 187ed4e635SHarry Wentland * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 197ed4e635SHarry Wentland * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 207ed4e635SHarry Wentland * OTHER DEALINGS IN THE SOFTWARE. 217ed4e635SHarry Wentland * 227ed4e635SHarry Wentland * Authors: AMD 237ed4e635SHarry Wentland * 247ed4e635SHarry Wentland */ 257ed4e635SHarry Wentland 267ed4e635SHarry Wentland #ifndef __DC_RESOURCE_DCN20_H__ 277ed4e635SHarry Wentland #define __DC_RESOURCE_DCN20_H__ 287ed4e635SHarry Wentland 297ed4e635SHarry Wentland #include "core_types.h" 307ed4e635SHarry Wentland 317ed4e635SHarry Wentland #define TO_DCN20_RES_POOL(pool)\ 327ed4e635SHarry Wentland container_of(pool, struct dcn20_resource_pool, base) 337ed4e635SHarry Wentland 347ed4e635SHarry Wentland struct dc; 357ed4e635SHarry Wentland struct resource_pool; 367ed4e635SHarry Wentland struct _vcs_dpi_display_pipe_params_st; 377ed4e635SHarry Wentland 387ed4e635SHarry Wentland struct dcn20_resource_pool { 397ed4e635SHarry Wentland struct resource_pool base; 407ed4e635SHarry Wentland }; 417ed4e635SHarry Wentland struct resource_pool *dcn20_create_resource_pool( 427ed4e635SHarry Wentland const struct dc_init_data *init_data, 437ed4e635SHarry Wentland struct dc *dc); 447ed4e635SHarry Wentland 457ed4e635SHarry Wentland struct link_encoder *dcn20_link_encoder_create( 467ed4e635SHarry Wentland const struct encoder_init_data *enc_init_data); 477ed4e635SHarry Wentland 487ed4e635SHarry Wentland unsigned int dcn20_calc_max_scaled_time( 497ed4e635SHarry Wentland unsigned int time_per_pixel, 507ed4e635SHarry Wentland enum mmhubbub_wbif_mode mode, 517ed4e635SHarry Wentland unsigned int urgent_watermark); 527ed4e635SHarry Wentland int dcn20_populate_dml_pipes_from_context( 537ed4e635SHarry Wentland struct dc *dc, struct resource_context *res_ctx, display_e2e_pipe_params_st *pipes); 547ed4e635SHarry Wentland struct pipe_ctx *dcn20_acquire_idle_pipe_for_layer( 557ed4e635SHarry Wentland struct dc_state *state, 567ed4e635SHarry Wentland const struct resource_pool *pool, 577ed4e635SHarry Wentland struct dc_stream_state *stream); 587ed4e635SHarry Wentland void dcn20_populate_dml_writeback_from_context( 597ed4e635SHarry Wentland struct dc *dc, struct resource_context *res_ctx, display_e2e_pipe_params_st *pipes); 607ed4e635SHarry Wentland 617ed4e635SHarry Wentland struct stream_encoder *dcn20_stream_encoder_create( 627ed4e635SHarry Wentland enum engine_id eng_id, 637ed4e635SHarry Wentland struct dc_context *ctx); 647ed4e635SHarry Wentland 657ed4e635SHarry Wentland struct dce_hwseq *dcn20_hwseq_create( 667ed4e635SHarry Wentland struct dc_context *ctx); 677ed4e635SHarry Wentland 687ed4e635SHarry Wentland bool dcn20_get_dcc_compression_cap(const struct dc *dc, 697ed4e635SHarry Wentland const struct dc_dcc_surface_param *input, 707ed4e635SHarry Wentland struct dc_surface_dcc_cap *output); 717ed4e635SHarry Wentland 727ed4e635SHarry Wentland void dcn20_dpp_destroy(struct dpp **dpp); 737ed4e635SHarry Wentland 747ed4e635SHarry Wentland struct dpp *dcn20_dpp_create( 757ed4e635SHarry Wentland struct dc_context *ctx, 767ed4e635SHarry Wentland uint32_t inst); 777ed4e635SHarry Wentland 787ed4e635SHarry Wentland struct input_pixel_processor *dcn20_ipp_create( 797ed4e635SHarry Wentland struct dc_context *ctx, uint32_t inst); 807ed4e635SHarry Wentland 817ed4e635SHarry Wentland 827ed4e635SHarry Wentland struct output_pixel_processor *dcn20_opp_create( 837ed4e635SHarry Wentland struct dc_context *ctx, uint32_t inst); 847ed4e635SHarry Wentland 857ed4e635SHarry Wentland struct dce_aux *dcn20_aux_engine_create( 867ed4e635SHarry Wentland struct dc_context *ctx, uint32_t inst); 877ed4e635SHarry Wentland 887ed4e635SHarry Wentland struct dce_i2c_hw *dcn20_i2c_hw_create( 897ed4e635SHarry Wentland struct dc_context *ctx, 907ed4e635SHarry Wentland uint32_t inst); 917ed4e635SHarry Wentland 927ed4e635SHarry Wentland void dcn20_clock_source_destroy(struct clock_source **clk_src); 937ed4e635SHarry Wentland 947ed4e635SHarry Wentland struct display_stream_compressor *dcn20_dsc_create( 957ed4e635SHarry Wentland struct dc_context *ctx, uint32_t inst); 967ed4e635SHarry Wentland void dcn20_dsc_destroy(struct display_stream_compressor **dsc); 977ed4e635SHarry Wentland 987ed4e635SHarry Wentland struct pp_smu_funcs *dcn20_pp_smu_create(struct dc_context *ctx); 997ed4e635SHarry Wentland void dcn20_pp_smu_destroy(struct pp_smu_funcs **pp_smu); 1007ed4e635SHarry Wentland 1017ed4e635SHarry Wentland struct hubp *dcn20_hubp_create( 1027ed4e635SHarry Wentland struct dc_context *ctx, 1037ed4e635SHarry Wentland uint32_t inst); 1047ed4e635SHarry Wentland struct timing_generator *dcn20_timing_generator_create( 1057ed4e635SHarry Wentland struct dc_context *ctx, 1067ed4e635SHarry Wentland uint32_t instance); 1077ed4e635SHarry Wentland struct mpc *dcn20_mpc_create(struct dc_context *ctx); 1087ed4e635SHarry Wentland struct hubbub *dcn20_hubbub_create(struct dc_context *ctx); 1097ed4e635SHarry Wentland 1107ed4e635SHarry Wentland bool dcn20_dwbc_create(struct dc_context *ctx, struct resource_pool *pool); 1117ed4e635SHarry Wentland bool dcn20_mmhubbub_create(struct dc_context *ctx, struct resource_pool *pool); 1127ed4e635SHarry Wentland 1137ed4e635SHarry Wentland void dcn20_set_mcif_arb_params( 1147ed4e635SHarry Wentland struct dc *dc, 1157ed4e635SHarry Wentland struct dc_state *context, 1167ed4e635SHarry Wentland display_e2e_pipe_params_st *pipes, 1177ed4e635SHarry Wentland int pipe_cnt); 118cb0b554aSAlex Deucher bool dcn20_validate_bandwidth(struct dc *dc, struct dc_state *context, bool fast_validate); 1197ed4e635SHarry Wentland 1207ed4e635SHarry Wentland enum dc_status dcn20_build_mapped_resource(const struct dc *dc, struct dc_state *context, struct dc_stream_state *stream); 1217ed4e635SHarry Wentland enum dc_status dcn20_validate_global(struct dc *dc, struct dc_state *new_ctx); 1227ed4e635SHarry Wentland enum dc_status dcn20_add_stream_to_ctx(struct dc *dc, struct dc_state *new_ctx, struct dc_stream_state *dc_stream); 1237ed4e635SHarry Wentland enum dc_status dcn20_remove_stream_from_ctx(struct dc *dc, struct dc_state *new_ctx, struct dc_stream_state *dc_stream); 1247ed4e635SHarry Wentland enum dc_status dcn20_get_default_swizzle_mode(struct dc_plane_state *plane_state); 1257ed4e635SHarry Wentland 1267ed4e635SHarry Wentland void dcn20_patch_bounding_box( 1277ed4e635SHarry Wentland struct dc *dc, 1287ed4e635SHarry Wentland struct _vcs_dpi_soc_bounding_box_st *bb); 1297ed4e635SHarry Wentland void dcn20_cap_soc_clocks( 1307ed4e635SHarry Wentland struct _vcs_dpi_soc_bounding_box_st *bb, 1317ed4e635SHarry Wentland struct pp_smu_nv_clock_table max_clocks); 1327ed4e635SHarry Wentland 1337ed4e635SHarry Wentland #endif /* __DC_RESOURCE_DCN20_H__ */ 1347ed4e635SHarry Wentland 135