#include <linux/slab.h>
#include "dm_services.h"
#include "atom.h"
#include "dc_bios_types.h"
#include "include/gpio_service_interface.h"
#include "include/grph_object_ctrl_defs.h"
#include "include/bios_parser_interface.h"
#include "include/logger_interface.h"
#include "command_table.h"
#include "bios_parser_helper.h"
#include "command_table_helper.h"
#include "bios_parser.h"
#include "bios_parser_types_internal.h"
#include "bios_parser_interface.h"
#include "bios_parser_common.h"
#define THREE_PERCENT_OF_10000 …
#define LAST_RECORD_TYPE …
#define DC_LOGGER …
#define DATA_TABLES(table) …
static void get_atom_data_table_revision(
ATOM_COMMON_TABLE_HEADER *atom_data_tbl,
struct atom_data_revision *tbl_revision);
static uint32_t get_src_obj_list(struct bios_parser *bp, ATOM_OBJECT *object,
uint16_t **id_list);
static ATOM_OBJECT *get_bios_object(struct bios_parser *bp,
struct graphics_object_id id);
static enum bp_result get_gpio_i2c_info(struct bios_parser *bp,
ATOM_I2C_RECORD *record,
struct graphics_object_i2c_info *info);
static ATOM_HPD_INT_RECORD *get_hpd_record(struct bios_parser *bp,
ATOM_OBJECT *object);
static struct device_id device_type_from_device_id(uint16_t device_id);
static uint32_t signal_to_ss_id(enum as_signal_type signal);
static uint32_t get_support_mask_for_device_id(struct device_id device_id);
static ATOM_ENCODER_CAP_RECORD_V2 *get_encoder_cap_record(
struct bios_parser *bp,
ATOM_OBJECT *object);
#define BIOS_IMAGE_SIZE_OFFSET …
#define BIOS_IMAGE_SIZE_UNIT …
static bool bios_parser_construct(
struct bios_parser *bp,
struct bp_init_data *init,
enum dce_version dce_version);
static uint8_t bios_parser_get_connectors_number(
struct dc_bios *dcb);
static enum bp_result bios_parser_get_embedded_panel_info(
struct dc_bios *dcb,
struct embedded_panel_info *info);
struct dc_bios *bios_parser_create(
struct bp_init_data *init,
enum dce_version dce_version)
{ … }
static void bios_parser_destruct(struct bios_parser *bp)
{ … }
static void bios_parser_destroy(struct dc_bios **dcb)
{ … }
static uint8_t get_number_of_objects(struct bios_parser *bp, uint32_t offset)
{ … }
static uint8_t bios_parser_get_connectors_number(struct dc_bios *dcb)
{ … }
static struct graphics_object_id bios_parser_get_connector_id(
struct dc_bios *dcb,
uint8_t i)
{ … }
static enum bp_result bios_parser_get_src_obj(struct dc_bios *dcb,
struct graphics_object_id object_id, uint32_t index,
struct graphics_object_id *src_object_id)
{ … }
static enum bp_result bios_parser_get_i2c_info(struct dc_bios *dcb,
struct graphics_object_id id,
struct graphics_object_i2c_info *info)
{ … }
static enum bp_result bios_parser_get_hpd_info(struct dc_bios *dcb,
struct graphics_object_id id,
struct graphics_object_hpd_info *info)
{ … }
static enum bp_result bios_parser_get_device_tag_record(
struct bios_parser *bp,
ATOM_OBJECT *object,
ATOM_CONNECTOR_DEVICE_TAG_RECORD **record)
{ … }
static enum bp_result bios_parser_get_device_tag(
struct dc_bios *dcb,
struct graphics_object_id connector_object_id,
uint32_t device_tag_index,
struct connector_device_tag_info *info)
{ … }
static enum bp_result get_firmware_info_v1_4(
struct bios_parser *bp,
struct dc_firmware_info *info);
static enum bp_result get_firmware_info_v2_1(
struct bios_parser *bp,
struct dc_firmware_info *info);
static enum bp_result get_firmware_info_v2_2(
struct bios_parser *bp,
struct dc_firmware_info *info);
static enum bp_result bios_parser_get_firmware_info(
struct dc_bios *dcb,
struct dc_firmware_info *info)
{ … }
static enum bp_result get_firmware_info_v1_4(
struct bios_parser *bp,
struct dc_firmware_info *info)
{ … }
static enum bp_result get_ss_info_v3_1(
struct bios_parser *bp,
uint32_t id,
uint32_t index,
struct spread_spectrum_info *ss_info);
static enum bp_result get_firmware_info_v2_1(
struct bios_parser *bp,
struct dc_firmware_info *info)
{ … }
static enum bp_result get_firmware_info_v2_2(
struct bios_parser *bp,
struct dc_firmware_info *info)
{ … }
static enum bp_result get_ss_info_v3_1(
struct bios_parser *bp,
uint32_t id,
uint32_t index,
struct spread_spectrum_info *ss_info)
{ … }
static enum bp_result bios_parser_transmitter_control(
struct dc_bios *dcb,
struct bp_transmitter_control *cntl)
{ … }
static enum bp_result bios_parser_encoder_control(
struct dc_bios *dcb,
struct bp_encoder_control *cntl)
{ … }
static enum bp_result bios_parser_adjust_pixel_clock(
struct dc_bios *dcb,
struct bp_adjust_pixel_clock_parameters *bp_params)
{ … }
static enum bp_result bios_parser_set_pixel_clock(
struct dc_bios *dcb,
struct bp_pixel_clock_parameters *bp_params)
{ … }
static enum bp_result bios_parser_set_dce_clock(
struct dc_bios *dcb,
struct bp_set_dce_clock_parameters *bp_params)
{ … }
static enum bp_result bios_parser_enable_spread_spectrum_on_ppll(
struct dc_bios *dcb,
struct bp_spread_spectrum_parameters *bp_params,
bool enable)
{ … }
static enum bp_result bios_parser_program_crtc_timing(
struct dc_bios *dcb,
struct bp_hw_crtc_timing_parameters *bp_params)
{ … }
static enum bp_result bios_parser_program_display_engine_pll(
struct dc_bios *dcb,
struct bp_pixel_clock_parameters *bp_params)
{ … }
static enum bp_result bios_parser_enable_crtc(
struct dc_bios *dcb,
enum controller_id id,
bool enable)
{ … }
static enum bp_result bios_parser_enable_disp_power_gating(
struct dc_bios *dcb,
enum controller_id controller_id,
enum bp_pipe_control_action action)
{ … }
static bool bios_parser_is_device_id_supported(
struct dc_bios *dcb,
struct device_id id)
{ … }
static ATOM_HPD_INT_RECORD *get_hpd_record(struct bios_parser *bp,
ATOM_OBJECT *object)
{ … }
static enum bp_result get_ss_info_from_ss_info_table(
struct bios_parser *bp,
uint32_t id,
struct spread_spectrum_info *ss_info);
static enum bp_result get_ss_info_from_tbl(
struct bios_parser *bp,
uint32_t id,
struct spread_spectrum_info *ss_info);
static enum bp_result bios_parser_get_spread_spectrum_info(
struct dc_bios *dcb,
enum as_signal_type signal,
uint32_t index,
struct spread_spectrum_info *ss_info)
{ … }
static enum bp_result get_ss_info_from_internal_ss_info_tbl_V2_1(
struct bios_parser *bp,
uint32_t id,
struct spread_spectrum_info *info);
static enum bp_result get_ss_info_from_tbl(
struct bios_parser *bp,
uint32_t id,
struct spread_spectrum_info *ss_info)
{ … }
static enum bp_result get_ss_info_from_internal_ss_info_tbl_V2_1(
struct bios_parser *bp,
uint32_t id,
struct spread_spectrum_info *info)
{ … }
static enum bp_result get_ss_info_from_ss_info_table(
struct bios_parser *bp,
uint32_t id,
struct spread_spectrum_info *ss_info)
{ … }
static enum bp_result get_embedded_panel_info_v1_2(
struct bios_parser *bp,
struct embedded_panel_info *info);
static enum bp_result get_embedded_panel_info_v1_3(
struct bios_parser *bp,
struct embedded_panel_info *info);
static enum bp_result bios_parser_get_embedded_panel_info(
struct dc_bios *dcb,
struct embedded_panel_info *info)
{ … }
static enum bp_result get_embedded_panel_info_v1_2(
struct bios_parser *bp,
struct embedded_panel_info *info)
{ … }
static enum bp_result get_embedded_panel_info_v1_3(
struct bios_parser *bp,
struct embedded_panel_info *info)
{ … }
static enum bp_result bios_parser_get_encoder_cap_info(
struct dc_bios *dcb,
struct graphics_object_id object_id,
struct bp_encoder_cap_info *info)
{ … }
static ATOM_ENCODER_CAP_RECORD_V2 *get_encoder_cap_record(
struct bios_parser *bp,
ATOM_OBJECT *object)
{ … }
static uint32_t get_ss_entry_number(
struct bios_parser *bp,
uint32_t id);
static uint32_t get_ss_entry_number_from_internal_ss_info_tbl_v2_1(
struct bios_parser *bp,
uint32_t id);
static uint32_t get_ss_entry_number_from_internal_ss_info_tbl_V3_1(
struct bios_parser *bp,
uint32_t id);
static uint32_t get_ss_entry_number_from_ss_info_tbl(
struct bios_parser *bp,
uint32_t id);
static uint32_t bios_parser_get_ss_entry_number(
struct dc_bios *dcb,
enum as_signal_type signal)
{ … }
static uint32_t get_ss_entry_number_from_ss_info_tbl(
struct bios_parser *bp,
uint32_t id)
{ … }
static uint32_t get_ss_entry_number(struct bios_parser *bp, uint32_t id)
{ … }
static uint32_t get_ss_entry_number_from_internal_ss_info_tbl_v2_1(
struct bios_parser *bp,
uint32_t id)
{ … }
static uint32_t get_ss_entry_number_from_internal_ss_info_tbl_V3_1(
struct bios_parser *bp,
uint32_t id)
{ … }
static enum bp_result bios_parser_get_gpio_pin_info(
struct dc_bios *dcb,
uint32_t gpio_id,
struct gpio_pin_info *info)
{ … }
static enum bp_result get_gpio_i2c_info(struct bios_parser *bp,
ATOM_I2C_RECORD *record,
struct graphics_object_i2c_info *info)
{ … }
static bool dal_graphics_object_id_is_valid(struct graphics_object_id id)
{ … }
static bool dal_graphics_object_id_is_equal(
struct graphics_object_id id1,
struct graphics_object_id id2)
{ … }
static ATOM_OBJECT *get_bios_object(struct bios_parser *bp,
struct graphics_object_id id)
{ … }
static uint32_t get_src_obj_list(struct bios_parser *bp, ATOM_OBJECT *object,
uint16_t **id_list)
{ … }
static struct device_id device_type_from_device_id(uint16_t device_id)
{ … }
static void get_atom_data_table_revision(
ATOM_COMMON_TABLE_HEADER *atom_data_tbl,
struct atom_data_revision *tbl_revision)
{ … }
static uint32_t signal_to_ss_id(enum as_signal_type signal)
{ … }
static uint32_t get_support_mask_for_device_id(struct device_id device_id)
{ … }
static void bios_parser_set_scratch_critical_state(
struct dc_bios *dcb,
bool state)
{ … }
static enum bp_result get_integrated_info_v8(
struct bios_parser *bp,
struct integrated_info *info)
{ … }
static enum bp_result get_integrated_info_v9(
struct bios_parser *bp,
struct integrated_info *info)
{ … }
static enum bp_result construct_integrated_info(
struct bios_parser *bp,
struct integrated_info *info)
{ … }
static struct integrated_info *bios_parser_create_integrated_info(
struct dc_bios *dcb)
{ … }
static enum bp_result update_slot_layout_info(struct dc_bios *dcb,
unsigned int i,
struct slot_layout_info *slot_layout_info,
unsigned int record_offset)
{ … }
static enum bp_result get_bracket_layout_record(struct dc_bios *dcb,
unsigned int bracket_layout_id,
struct slot_layout_info *slot_layout_info)
{ … }
static enum bp_result bios_get_board_layout_info(
struct dc_bios *dcb,
struct board_layout_info *board_layout_info)
{ … }
static const struct dc_vbios_funcs vbios_funcs = …;
static bool bios_parser_construct(
struct bios_parser *bp,
struct bp_init_data *init,
enum dce_version dce_version)
{ … }