69 lines · c
1// SPDX-License-Identifier: MIT2//3// Copyright 2024 Advanced Micro Devices, Inc.4 5 6#ifndef _DML21_WRAPPER_H_7#define _DML21_WRAPPER_H_8 9#include "os_types.h"10#include "dml_top_soc_parameter_types.h"11 12struct dc;13struct dc_state;14struct dml2_configuration_options;15struct dml2_context;16 17/**18 * dml2_create - Creates dml21_context.19 * @in_dc: dc.20 * @dml2: Created dml21 context.21 * @config: dml21 configuration options.22 *23 * Create of DML21 is done as part of dc_state creation.24 * DML21 IP, SOC and STATES are initialized at25 * creation time.26 *27 * Return: True if dml2 is successfully created, false otherwise.28 */29bool dml21_create(const struct dc *in_dc, struct dml2_context **dml_ctx, const struct dml2_configuration_options *config);30void dml21_destroy(struct dml2_context *dml2);31void dml21_copy(struct dml2_context *dst_dml_ctx,32 struct dml2_context *src_dml_ctx);33bool dml21_create_copy(struct dml2_context **dst_dml_ctx,34 struct dml2_context *src_dml_ctx);35void dml21_reinit(const struct dc *in_dc, struct dml2_context **dml_ctx, const struct dml2_configuration_options *config);36 37/**38 * dml21_validate - Determines if a display configuration is supported or not.39 * @in_dc: dc.40 * @context: dc_state to be validated.41 * @fast_validate: Fast validate will not populate context.res_ctx.42 *43 * Based on fast_validate option internally would call:44 *45 * -dml21_mode_check_and_programming - for non fast_validate option46 * Calculates if dc_state can be supported on the input display47 * configuration. If supported, generates the necessary HW48 * programming for the new dc_state.49 *50 * -dml21_check_mode_support - for fast_validate option51 * Calculates if dc_state can be supported for the input display52 * config.53 54 * Context: Two threads may not invoke this function concurrently unless they reference55 * separate dc_states for validation.56 * Return: True if mode is supported, false otherwise.57 */58bool dml21_validate(const struct dc *in_dc, struct dc_state *context, struct dml2_context *dml_ctx, bool fast_validate);59 60/* Prepare hubp mcache_regs for hubp mcache ID and split coordinate programming */61void dml21_prepare_mcache_programming(struct dc *in_dc, struct dc_state *context, struct dml2_context *dml_ctx);62 63/* Structure for inputting external SOCBB and DCNIP values for tool based debugging. */64struct socbb_ip_params_external {65 struct dml2_ip_capabilities ip_params;66 struct dml2_soc_bb soc_bb;67};68#endif69