/* * Copyright 2023 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Authors: AMD * */ /* FILE POLICY AND INTENDED USAGE: * This file owns the creation/destruction of link structure. */ #include "link_factory.h" #include "link_detection.h" #include "link_resource.h" #include "link_validation.h" #include "link_dpms.h" #include "accessories/link_dp_cts.h" #include "accessories/link_dp_trace.h" #include "protocols/link_ddc.h" #include "protocols/link_dp_capability.h" #include "protocols/link_dp_dpia_bw.h" #include "protocols/link_dp_dpia.h" #include "protocols/link_dp_irq_handler.h" #include "protocols/link_dp_phy.h" #include "protocols/link_dp_training.h" #include "protocols/link_edp_panel_control.h" #include "protocols/link_hpd.h" #include "gpio_service_interface.h" #include "atomfirmware.h" #define DC_LOGGER … #define DC_LOGGER_INIT(logger) … #define LINK_INFO(...) … /* link factory owns the creation/destruction of link structures. */ static void construct_link_service_factory(struct link_service *link_srv) { … } /* link_detection manages link detection states and receiver states by using * various link protocols. It also provides helper functions to interpret * certain capabilities or status based on the states it manages or retrieve * them directly from connected receivers. */ static void construct_link_service_detection(struct link_service *link_srv) { … } /* link resource implements accessors to link resource. */ static void construct_link_service_resource(struct link_service *link_srv) { … } /* link validation owns timing validation against various link limitations. (ex. * link bandwidth, receiver capability or our hardware capability) It also * provides helper functions exposing bandwidth formulas used in validation. */ static void construct_link_service_validation(struct link_service *link_srv) { … } /* link dpms owns the programming sequence of stream's dpms state associated * with the link and link's enable/disable sequences as result of the stream's * dpms state change. */ static void construct_link_service_dpms(struct link_service *link_srv) { … } /* link ddc implements generic display communication protocols such as i2c, aux * and scdc. It should not contain any specific applications of these * protocols such as display capability query, detection, or handshaking such as * link training. */ static void construct_link_service_ddc(struct link_service *link_srv) { … } /* link dp capability implements dp specific link capability retrieval sequence. * It is responsible for retrieving, parsing, overriding, deciding capability * obtained from dp link. Link capability consists of encoders, DPRXs, cables, * retimers, usb and all other possible backend capabilities. */ static void construct_link_service_dp_capability(struct link_service *link_srv) { … } /* link dp phy/dpia implements basic dp phy/dpia functionality such as * enable/disable output and set lane/drive settings. It is responsible for * maintaining and update software state representing current phy/dpia status * such as current link settings. */ static void construct_link_service_dp_phy_or_dpia(struct link_service *link_srv) { … } /* link dp irq handler implements DP HPD short pulse handling sequence according * to DP specifications */ static void construct_link_service_dp_irq_handler(struct link_service *link_srv) { … } /* link edp panel control implements retrieval and configuration of eDP panel * features such as PSR and ABM and it also manages specs defined eDP panel * power sequences. */ static void construct_link_service_edp_panel_control(struct link_service *link_srv) { … } /* link dp cts implements dp compliance test automation protocols and manual * testing interfaces for debugging and certification purpose. */ static void construct_link_service_dp_cts(struct link_service *link_srv) { … } /* link dp trace implements tracing interfaces for tracking major dp sequences * including execution status and timestamps */ static void construct_link_service_dp_trace(struct link_service *link_srv) { … } static void construct_link_service(struct link_service *link_srv) { … } struct link_service *link_create_link_service(void) { … } void link_destroy_link_service(struct link_service **link_srv) { … } static enum transmitter translate_encoder_to_transmitter( struct graphics_object_id encoder) { … } static void link_destruct(struct dc_link *link) { … } static enum channel_id get_ddc_line(struct dc_link *link) { … } static bool construct_phy(struct dc_link *link, const struct link_init_data *init_params) { … } static bool construct_dpia(struct dc_link *link, const struct link_init_data *init_params) { … } static bool link_construct(struct dc_link *link, const struct link_init_data *init_params) { … } struct dc_link *link_create(const struct link_init_data *init_params) { … } void link_destroy(struct dc_link **link) { … }