Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright 2012-15 Advanced Micro Devices, Inc.
0003  *
0004  * Permission is hereby granted, free of charge, to any person obtaining a
0005  * copy of this software and associated documentation files (the "Software"),
0006  * to deal in the Software without restriction, including without limitation
0007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
0008  * and/or sell copies of the Software, and to permit persons to whom the
0009  * Software is furnished to do so, subject to the following conditions:
0010  *
0011  * The above copyright notice and this permission notice shall be included in
0012  * all copies or substantial portions of the Software.
0013  *
0014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0015  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
0017  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
0018  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
0019  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0020  * OTHER DEALINGS IN THE SOFTWARE.
0021  *
0022  * Authors: AMD
0023  *
0024  */
0025 
0026 #include "dm_services.h"
0027 #include "dm_services_types.h"
0028 
0029 #include "virtual_link_encoder.h"
0030 
0031 static bool virtual_link_encoder_validate_output_with_stream(
0032     struct link_encoder *enc,
0033     const struct dc_stream_state *stream) { return true; }
0034 
0035 static void virtual_link_encoder_hw_init(struct link_encoder *enc) {}
0036 
0037 static void virtual_link_encoder_setup(
0038     struct link_encoder *enc,
0039     enum signal_type signal) {}
0040 
0041 static void virtual_link_encoder_enable_tmds_output(
0042     struct link_encoder *enc,
0043     enum clock_source_id clock_source,
0044     enum dc_color_depth color_depth,
0045     enum signal_type signal,
0046     uint32_t pixel_clock) {}
0047 
0048 static void virtual_link_encoder_enable_dp_output(
0049     struct link_encoder *enc,
0050     const struct dc_link_settings *link_settings,
0051     enum clock_source_id clock_source) {}
0052 
0053 static void virtual_link_encoder_enable_dp_mst_output(
0054     struct link_encoder *enc,
0055     const struct dc_link_settings *link_settings,
0056     enum clock_source_id clock_source) {}
0057 
0058 static void virtual_link_encoder_disable_output(
0059     struct link_encoder *link_enc,
0060     enum signal_type signal) {}
0061 
0062 static void virtual_link_encoder_dp_set_lane_settings(
0063     struct link_encoder *enc,
0064     const struct dc_link_settings *link_settings,
0065     const struct dc_lane_settings lane_settings[LANE_COUNT_DP_MAX]) {}
0066 
0067 static void virtual_link_encoder_dp_set_phy_pattern(
0068     struct link_encoder *enc,
0069     const struct encoder_set_dp_phy_pattern_param *param) {}
0070 
0071 static void virtual_link_encoder_update_mst_stream_allocation_table(
0072     struct link_encoder *enc,
0073     const struct link_mst_stream_allocation_table *table) {}
0074 
0075 static void virtual_link_encoder_connect_dig_be_to_fe(
0076     struct link_encoder *enc,
0077     enum engine_id engine,
0078     bool connect) {}
0079 
0080 static void virtual_link_encoder_destroy(struct link_encoder **enc)
0081 {
0082     kfree(*enc);
0083     *enc = NULL;
0084 }
0085 
0086 static void virtual_link_encoder_get_max_link_cap(struct link_encoder *enc,
0087         struct dc_link_settings *link_settings)
0088 {
0089     /* Set Default link settings */
0090     struct dc_link_settings max_link_cap = {LANE_COUNT_FOUR, LINK_RATE_HIGH,
0091                 LINK_SPREAD_05_DOWNSPREAD_30KHZ, false, 0};
0092     *link_settings = max_link_cap;
0093 }
0094 
0095 static const struct link_encoder_funcs virtual_lnk_enc_funcs = {
0096     .validate_output_with_stream =
0097         virtual_link_encoder_validate_output_with_stream,
0098     .hw_init = virtual_link_encoder_hw_init,
0099     .setup = virtual_link_encoder_setup,
0100     .enable_tmds_output = virtual_link_encoder_enable_tmds_output,
0101     .enable_dp_output = virtual_link_encoder_enable_dp_output,
0102     .enable_dp_mst_output = virtual_link_encoder_enable_dp_mst_output,
0103     .disable_output = virtual_link_encoder_disable_output,
0104     .get_max_link_cap = virtual_link_encoder_get_max_link_cap,
0105     .dp_set_lane_settings = virtual_link_encoder_dp_set_lane_settings,
0106     .dp_set_phy_pattern = virtual_link_encoder_dp_set_phy_pattern,
0107     .update_mst_stream_allocation_table =
0108         virtual_link_encoder_update_mst_stream_allocation_table,
0109     .connect_dig_be_to_fe = virtual_link_encoder_connect_dig_be_to_fe,
0110     .destroy = virtual_link_encoder_destroy
0111 };
0112 
0113 bool virtual_link_encoder_construct(
0114     struct link_encoder *enc, const struct encoder_init_data *init_data)
0115 {
0116     enc->funcs = &virtual_lnk_enc_funcs;
0117     enc->ctx = init_data->ctx;
0118     enc->id = init_data->encoder;
0119 
0120     enc->hpd_source = init_data->hpd_source;
0121     enc->connector = init_data->connector;
0122 
0123     enc->transmitter = init_data->transmitter;
0124 
0125     enc->output_signals = SIGNAL_TYPE_VIRTUAL;
0126 
0127     enc->preferred_engine = ENGINE_ID_VIRTUAL;
0128 
0129     return true;
0130 }
0131 
0132