0001
0002
0003
0004
0005
0006 #ifndef __INTEL_DP_H__
0007 #define __INTEL_DP_H__
0008
0009 #include <linux/types.h>
0010
0011 enum intel_output_format;
0012 enum pipe;
0013 enum port;
0014 struct drm_connector_state;
0015 struct drm_encoder;
0016 struct drm_i915_private;
0017 struct drm_modeset_acquire_ctx;
0018 struct drm_dp_vsc_sdp;
0019 struct intel_atomic_state;
0020 struct intel_connector;
0021 struct intel_crtc_state;
0022 struct intel_digital_port;
0023 struct intel_dp;
0024 struct intel_encoder;
0025
0026 struct link_config_limits {
0027 int min_rate, max_rate;
0028 int min_lane_count, max_lane_count;
0029 int min_bpp, max_bpp;
0030 };
0031
0032 void intel_edp_fixup_vbt_bpp(struct intel_encoder *encoder, int pipe_bpp);
0033 void intel_dp_adjust_compliance_config(struct intel_dp *intel_dp,
0034 struct intel_crtc_state *pipe_config,
0035 struct link_config_limits *limits);
0036 bool intel_dp_limited_color_range(const struct intel_crtc_state *crtc_state,
0037 const struct drm_connector_state *conn_state);
0038 int intel_dp_min_bpp(enum intel_output_format output_format);
0039 bool intel_dp_init_connector(struct intel_digital_port *dig_port,
0040 struct intel_connector *intel_connector);
0041 void intel_dp_set_link_params(struct intel_dp *intel_dp,
0042 int link_rate, int lane_count);
0043 int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp,
0044 int link_rate, u8 lane_count);
0045 int intel_dp_retrain_link(struct intel_encoder *encoder,
0046 struct drm_modeset_acquire_ctx *ctx);
0047 void intel_dp_set_power(struct intel_dp *intel_dp, u8 mode);
0048 void intel_dp_configure_protocol_converter(struct intel_dp *intel_dp,
0049 const struct intel_crtc_state *crtc_state);
0050 void intel_dp_sink_set_decompression_state(struct intel_dp *intel_dp,
0051 const struct intel_crtc_state *crtc_state,
0052 bool enable);
0053 void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder);
0054 void intel_dp_encoder_shutdown(struct intel_encoder *intel_encoder);
0055 void intel_dp_encoder_flush_work(struct drm_encoder *encoder);
0056 int intel_dp_compute_config(struct intel_encoder *encoder,
0057 struct intel_crtc_state *pipe_config,
0058 struct drm_connector_state *conn_state);
0059 bool intel_dp_is_edp(struct intel_dp *intel_dp);
0060 bool intel_dp_is_uhbr(const struct intel_crtc_state *crtc_state);
0061 bool intel_dp_is_port_edp(struct drm_i915_private *dev_priv, enum port port);
0062 enum irqreturn intel_dp_hpd_pulse(struct intel_digital_port *dig_port,
0063 bool long_hpd);
0064 void intel_edp_backlight_on(const struct intel_crtc_state *crtc_state,
0065 const struct drm_connector_state *conn_state);
0066 void intel_edp_backlight_off(const struct drm_connector_state *conn_state);
0067 void intel_edp_fixup_vbt_bpp(struct intel_encoder *encoder, int pipe_bpp);
0068 void intel_dp_mst_suspend(struct drm_i915_private *dev_priv);
0069 void intel_dp_mst_resume(struct drm_i915_private *dev_priv);
0070 int intel_dp_max_link_rate(struct intel_dp *intel_dp);
0071 int intel_dp_max_lane_count(struct intel_dp *intel_dp);
0072 int intel_dp_rate_select(struct intel_dp *intel_dp, int rate);
0073
0074 void intel_dp_compute_rate(struct intel_dp *intel_dp, int port_clock,
0075 u8 *link_bw, u8 *rate_select);
0076 bool intel_dp_source_supports_tps3(struct drm_i915_private *i915);
0077 bool intel_dp_source_supports_tps4(struct drm_i915_private *i915);
0078
0079 bool intel_dp_get_colorimetry_status(struct intel_dp *intel_dp);
0080 int intel_dp_link_required(int pixel_clock, int bpp);
0081 int intel_dp_max_data_rate(int max_link_rate, int max_lanes);
0082 bool intel_dp_can_bigjoiner(struct intel_dp *intel_dp);
0083 bool intel_dp_needs_vsc_sdp(const struct intel_crtc_state *crtc_state,
0084 const struct drm_connector_state *conn_state);
0085 void intel_dp_compute_psr_vsc_sdp(struct intel_dp *intel_dp,
0086 const struct intel_crtc_state *crtc_state,
0087 const struct drm_connector_state *conn_state,
0088 struct drm_dp_vsc_sdp *vsc);
0089 void intel_write_dp_vsc_sdp(struct intel_encoder *encoder,
0090 const struct intel_crtc_state *crtc_state,
0091 const struct drm_dp_vsc_sdp *vsc);
0092 void intel_dp_set_infoframes(struct intel_encoder *encoder, bool enable,
0093 const struct intel_crtc_state *crtc_state,
0094 const struct drm_connector_state *conn_state);
0095 void intel_read_dp_sdp(struct intel_encoder *encoder,
0096 struct intel_crtc_state *crtc_state,
0097 unsigned int type);
0098 bool intel_digital_port_connected(struct intel_encoder *encoder);
0099
0100 static inline unsigned int intel_dp_unused_lane_mask(int lane_count)
0101 {
0102 return ~((1 << lane_count) - 1) & 0xf;
0103 }
0104
0105 u32 intel_dp_mode_to_fec_clock(u32 mode_clock);
0106
0107 void intel_ddi_update_pipe(struct intel_atomic_state *state,
0108 struct intel_encoder *encoder,
0109 const struct intel_crtc_state *crtc_state,
0110 const struct drm_connector_state *conn_state);
0111
0112 bool intel_dp_initial_fastset_check(struct intel_encoder *encoder,
0113 struct intel_crtc_state *crtc_state);
0114 void intel_dp_sync_state(struct intel_encoder *encoder,
0115 const struct intel_crtc_state *crtc_state);
0116
0117 void intel_dp_check_frl_training(struct intel_dp *intel_dp);
0118 void intel_dp_pcon_dsc_configure(struct intel_dp *intel_dp,
0119 const struct intel_crtc_state *crtc_state);
0120 void intel_dp_phy_test(struct intel_encoder *encoder);
0121
0122 void intel_dp_wait_source_oui(struct intel_dp *intel_dp);
0123
0124 #endif