0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030 #ifndef __DM_HELPERS__
0031 #define __DM_HELPERS__
0032
0033 #include "dc_types.h"
0034 #include "dc.h"
0035
0036 struct dp_mst_stream_allocation_table;
0037 struct aux_payload;
0038 enum aux_return_code_type;
0039
0040
0041
0042
0043
0044
0045
0046
0047 void *dm_helpers_allocate_gpu_mem(
0048 struct dc_context *ctx,
0049 enum dc_gpu_mem_alloc_type type,
0050 size_t size,
0051 long long *addr);
0052
0053
0054
0055
0056 void dm_helpers_free_gpu_mem(
0057 struct dc_context *ctx,
0058 enum dc_gpu_mem_alloc_type type,
0059 void *pvMem);
0060
0061 enum dc_edid_status dm_helpers_parse_edid_caps(
0062 struct dc_link *link,
0063 const struct dc_edid *edid,
0064 struct dc_edid_caps *edid_caps);
0065
0066
0067
0068
0069
0070 void dm_helpers_dp_update_branch_info(
0071 struct dc_context *ctx,
0072 const struct dc_link *link);
0073
0074
0075
0076
0077 bool dm_helpers_dp_mst_write_payload_allocation_table(
0078 struct dc_context *ctx,
0079 const struct dc_stream_state *stream,
0080 struct dp_mst_stream_allocation_table *proposed_table,
0081 bool enable);
0082
0083
0084
0085
0086 void dm_helpers_dp_mst_poll_pending_down_reply(
0087 struct dc_context *ctx,
0088 const struct dc_link *link);
0089
0090
0091
0092
0093 void dm_helpers_dp_mst_clear_payload_allocation_table(
0094 struct dc_context *ctx,
0095 const struct dc_link *link);
0096
0097
0098
0099
0100 enum act_return_status dm_helpers_dp_mst_poll_for_allocation_change_trigger(
0101 struct dc_context *ctx,
0102 const struct dc_stream_state *stream);
0103
0104
0105
0106 bool dm_helpers_dp_mst_send_payload_allocation(
0107 struct dc_context *ctx,
0108 const struct dc_stream_state *stream,
0109 bool enable);
0110
0111 bool dm_helpers_dp_mst_start_top_mgr(
0112 struct dc_context *ctx,
0113 const struct dc_link *link,
0114 bool boot);
0115
0116 bool dm_helpers_dp_mst_stop_top_mgr(
0117 struct dc_context *ctx,
0118 struct dc_link *link);
0119
0120
0121
0122 bool dm_helpers_dp_read_dpcd(
0123 struct dc_context *ctx,
0124 const struct dc_link *link,
0125 uint32_t address,
0126 uint8_t *data,
0127 uint32_t size);
0128
0129
0130
0131
0132 bool dm_helpers_dp_write_dpcd(
0133 struct dc_context *ctx,
0134 const struct dc_link *link,
0135 uint32_t address,
0136 const uint8_t *data,
0137 uint32_t size);
0138
0139 bool dm_helpers_submit_i2c(
0140 struct dc_context *ctx,
0141 const struct dc_link *link,
0142 struct i2c_command *cmd);
0143
0144 bool dm_helpers_dp_write_dsc_enable(
0145 struct dc_context *ctx,
0146 const struct dc_stream_state *stream,
0147 bool enable
0148 );
0149 bool dm_helpers_is_dp_sink_present(
0150 struct dc_link *link);
0151
0152 void dm_helpers_mst_enable_stream_features(const struct dc_stream_state *stream);
0153
0154 enum dc_edid_status dm_helpers_read_local_edid(
0155 struct dc_context *ctx,
0156 struct dc_link *link,
0157 struct dc_sink *sink);
0158
0159 void dm_set_dcn_clocks(
0160 struct dc_context *ctx,
0161 struct dc_clocks *clks);
0162
0163 void dm_helpers_enable_periodic_detection(struct dc_context *ctx, bool enable);
0164
0165 void dm_set_phyd32clk(struct dc_context *ctx, int freq_khz);
0166
0167 bool dm_helpers_dmub_outbox_interrupt_control(struct dc_context *ctx, bool enable);
0168
0169 void dm_helpers_smu_timeout(struct dc_context *ctx, unsigned int msg_id, unsigned int param, unsigned int timeout_us);
0170
0171
0172 #define IS_SMU_TIMEOUT(result) \
0173 (result == 0x0)
0174
0175 int dm_helper_dmub_aux_transfer_sync(
0176 struct dc_context *ctx,
0177 const struct dc_link *link,
0178 struct aux_payload *payload,
0179 enum aux_return_code_type *operation_result);
0180 enum set_config_status;
0181 int dm_helpers_dmub_set_config_sync(struct dc_context *ctx,
0182 const struct dc_link *link,
0183 struct set_config_cmd_payload *payload,
0184 enum set_config_status *operation_result);
0185
0186 enum dc_edid_status dm_helpers_get_sbios_edid(struct dc_link *link, struct dc_edid *edid);
0187
0188 #endif