]> asedeno.scripts.mit.edu Git - linux.git/blob - drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h
ASoC: fsl_ssi: Fix build error
[linux.git] / drivers / gpu / drm / amd / display / dc / inc / hw / link_encoder.h
1 /*
2  * link_encoder.h
3  *
4  *  Created on: Oct 6, 2015
5  *      Author: yonsun
6  */
7
8 #ifndef LINK_ENCODER_H_
9 #define LINK_ENCODER_H_
10
11 #include "grph_object_defs.h"
12 #include "signal_types.h"
13 #include "dc_types.h"
14
15 struct dc_context;
16 struct encoder_set_dp_phy_pattern_param;
17 struct link_mst_stream_allocation_table;
18 struct dc_link_settings;
19 struct link_training_settings;
20 struct pipe_ctx;
21
22 struct encoder_init_data {
23         enum channel_id channel;
24         struct graphics_object_id connector;
25         enum hpd_source_id hpd_source;
26         /* TODO: in DAL2, here was pointer to EventManagerInterface */
27         struct graphics_object_id encoder;
28         struct dc_context *ctx;
29         enum transmitter transmitter;
30 };
31
32 struct encoder_feature_support {
33         union {
34                 struct {
35                         uint32_t IS_HBR2_CAPABLE:1;
36                         uint32_t IS_HBR3_CAPABLE:1;
37                         uint32_t IS_TPS3_CAPABLE:1;
38                         uint32_t IS_TPS4_CAPABLE:1;
39                         uint32_t IS_YCBCR_CAPABLE:1;
40                         uint32_t HDMI_6GB_EN:1;
41                 } bits;
42                 uint32_t raw;
43         } flags;
44
45         enum dc_color_depth max_hdmi_deep_color;
46         unsigned int max_hdmi_pixel_clock;
47         bool ycbcr420_supported;
48 };
49
50 union dpcd_psr_configuration {
51         struct {
52                 unsigned char ENABLE                    : 1;
53                 unsigned char TRANSMITTER_ACTIVE_IN_PSR : 1;
54                 unsigned char CRC_VERIFICATION          : 1;
55                 unsigned char FRAME_CAPTURE_INDICATION  : 1;
56                 /* For eDP 1.4, PSR v2*/
57                 unsigned char LINE_CAPTURE_INDICATION   : 1;
58                 /* For eDP 1.4, PSR v2*/
59                 unsigned char IRQ_HPD_WITH_CRC_ERROR    : 1;
60                 unsigned char RESERVED                  : 2;
61         } bits;
62         unsigned char raw;
63 };
64
65 union psr_error_status {
66         struct {
67                 unsigned char LINK_CRC_ERROR        :1;
68                 unsigned char RFB_STORAGE_ERROR     :1;
69                 unsigned char RESERVED              :6;
70         } bits;
71         unsigned char raw;
72 };
73
74 union psr_sink_psr_status {
75         struct {
76         unsigned char SINK_SELF_REFRESH_STATUS  :3;
77         unsigned char RESERVED                  :5;
78         } bits;
79         unsigned char raw;
80 };
81
82 struct link_encoder {
83         const struct link_encoder_funcs *funcs;
84         int32_t aux_channel_offset;
85         struct dc_context *ctx;
86         struct graphics_object_id id;
87         struct graphics_object_id connector;
88         uint32_t output_signals;
89         enum engine_id preferred_engine;
90         struct encoder_feature_support features;
91         enum transmitter transmitter;
92         enum hpd_source_id hpd_source;
93 };
94
95 struct link_encoder_funcs {
96         bool (*validate_output_with_stream)(
97                 struct link_encoder *enc, const struct dc_stream_state *stream);
98         void (*hw_init)(struct link_encoder *enc);
99         void (*setup)(struct link_encoder *enc,
100                 enum signal_type signal);
101         void (*enable_tmds_output)(struct link_encoder *enc,
102                 enum clock_source_id clock_source,
103                 enum dc_color_depth color_depth,
104                 bool hdmi,
105                 bool dual_link,
106                 uint32_t pixel_clock);
107         void (*enable_dp_output)(struct link_encoder *enc,
108                 const struct dc_link_settings *link_settings,
109                 enum clock_source_id clock_source);
110         void (*enable_dp_mst_output)(struct link_encoder *enc,
111                 const struct dc_link_settings *link_settings,
112                 enum clock_source_id clock_source);
113         void (*disable_output)(struct link_encoder *link_enc,
114                 enum signal_type signal, struct dc_link *link);
115         void (*dp_set_lane_settings)(struct link_encoder *enc,
116                 const struct link_training_settings *link_settings);
117         void (*dp_set_phy_pattern)(struct link_encoder *enc,
118                 const struct encoder_set_dp_phy_pattern_param *para);
119         void (*update_mst_stream_allocation_table)(
120                 struct link_encoder *enc,
121                 const struct link_mst_stream_allocation_table *table);
122         void (*psr_program_dp_dphy_fast_training)(struct link_encoder *enc,
123                         bool exit_link_training_required);
124         void (*psr_program_secondary_packet)(struct link_encoder *enc,
125                                 unsigned int sdp_transmit_line_num_deadline);
126         void (*connect_dig_be_to_fe)(struct link_encoder *enc,
127                 enum engine_id engine,
128                 bool connect);
129         void (*enable_hpd)(struct link_encoder *enc);
130         void (*disable_hpd)(struct link_encoder *enc);
131         void (*destroy)(struct link_encoder **enc);
132 };
133
134 #endif /* LINK_ENCODER_H_ */