#include <drm/display/drm_dp_helper.h>
#include "i915_drv.h"
#include "intel_display_types.h"
#include "intel_dp.h"
#include "intel_dp_link_training.h"
#include "intel_encoder.h"
#include "intel_hotplug.h"
#include "intel_panel.h"
#define LT_MSG_PREFIX …
#define LT_MSG_ARGS(_intel_dp, _dp_phy) …
#define lt_dbg(_intel_dp, _dp_phy, _format, ...) …
#define lt_err(_intel_dp, _dp_phy, _format, ...) …
static void intel_dp_reset_lttpr_common_caps(struct intel_dp *intel_dp)
{ … }
static void intel_dp_reset_lttpr_count(struct intel_dp *intel_dp)
{ … }
static u8 *intel_dp_lttpr_phy_caps(struct intel_dp *intel_dp,
enum drm_dp_phy dp_phy)
{ … }
static void intel_dp_read_lttpr_phy_caps(struct intel_dp *intel_dp,
const u8 dpcd[DP_RECEIVER_CAP_SIZE],
enum drm_dp_phy dp_phy)
{ … }
static bool intel_dp_read_lttpr_common_caps(struct intel_dp *intel_dp,
const u8 dpcd[DP_RECEIVER_CAP_SIZE])
{ … }
static bool
intel_dp_set_lttpr_transparent_mode(struct intel_dp *intel_dp, bool enable)
{ … }
static bool intel_dp_lttpr_transparent_mode_enabled(struct intel_dp *intel_dp)
{ … }
static int intel_dp_init_lttpr_phys(struct intel_dp *intel_dp, const u8 dpcd[DP_RECEIVER_CAP_SIZE])
{ … }
static int intel_dp_init_lttpr(struct intel_dp *intel_dp, const u8 dpcd[DP_RECEIVER_CAP_SIZE])
{ … }
int intel_dp_read_dprx_caps(struct intel_dp *intel_dp, u8 dpcd[DP_RECEIVER_CAP_SIZE])
{ … }
int intel_dp_init_lttpr_and_dprx_caps(struct intel_dp *intel_dp)
{ … }
static u8 dp_voltage_max(u8 preemph)
{ … }
static u8 intel_dp_lttpr_voltage_max(struct intel_dp *intel_dp,
enum drm_dp_phy dp_phy)
{ … }
static u8 intel_dp_lttpr_preemph_max(struct intel_dp *intel_dp,
enum drm_dp_phy dp_phy)
{ … }
static bool
intel_dp_phy_is_downstream_of_source(struct intel_dp *intel_dp,
enum drm_dp_phy dp_phy)
{ … }
static u8 intel_dp_phy_voltage_max(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state,
enum drm_dp_phy dp_phy)
{ … }
static u8 intel_dp_phy_preemph_max(struct intel_dp *intel_dp,
enum drm_dp_phy dp_phy)
{ … }
static bool has_per_lane_signal_levels(struct intel_dp *intel_dp,
enum drm_dp_phy dp_phy)
{ … }
static u8 intel_dp_get_lane_adjust_tx_ffe_preset(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state,
enum drm_dp_phy dp_phy,
const u8 link_status[DP_LINK_STATUS_SIZE],
int lane)
{ … }
static u8 intel_dp_get_lane_adjust_vswing_preemph(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state,
enum drm_dp_phy dp_phy,
const u8 link_status[DP_LINK_STATUS_SIZE],
int lane)
{ … }
static u8 intel_dp_get_lane_adjust_train(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state,
enum drm_dp_phy dp_phy,
const u8 link_status[DP_LINK_STATUS_SIZE],
int lane)
{ … }
#define TRAIN_REQ_FMT …
#define _TRAIN_REQ_VSWING_ARGS(link_status, lane) …
#define TRAIN_REQ_VSWING_ARGS(link_status) …
#define _TRAIN_REQ_PREEMPH_ARGS(link_status, lane) …
#define TRAIN_REQ_PREEMPH_ARGS(link_status) …
#define _TRAIN_REQ_TX_FFE_ARGS(link_status, lane) …
#define TRAIN_REQ_TX_FFE_ARGS(link_status) …
void
intel_dp_get_adjust_train(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state,
enum drm_dp_phy dp_phy,
const u8 link_status[DP_LINK_STATUS_SIZE])
{ … }
static int intel_dp_training_pattern_set_reg(struct intel_dp *intel_dp,
enum drm_dp_phy dp_phy)
{ … }
static bool
intel_dp_set_link_train(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state,
enum drm_dp_phy dp_phy,
u8 dp_train_pat)
{ … }
static char dp_training_pattern_name(u8 train_pat)
{ … }
void
intel_dp_program_link_training_pattern(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state,
enum drm_dp_phy dp_phy,
u8 dp_train_pat)
{ … }
#define TRAIN_SET_FMT …
#define _TRAIN_SET_VSWING_ARGS(train_set) …
#define TRAIN_SET_VSWING_ARGS(train_set) …
#define _TRAIN_SET_PREEMPH_ARGS(train_set) …
#define TRAIN_SET_PREEMPH_ARGS(train_set) …
#define _TRAIN_SET_TX_FFE_ARGS(train_set) …
#define TRAIN_SET_TX_FFE_ARGS(train_set) …
void intel_dp_set_signal_levels(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state,
enum drm_dp_phy dp_phy)
{ … }
static bool
intel_dp_reset_link_train(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state,
enum drm_dp_phy dp_phy,
u8 dp_train_pat)
{ … }
static bool
intel_dp_update_link_train(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state,
enum drm_dp_phy dp_phy)
{ … }
static bool intel_dp_lane_max_tx_ffe_reached(u8 train_set_lane)
{ … }
static bool intel_dp_lane_max_vswing_reached(u8 train_set_lane)
{ … }
static bool intel_dp_link_max_vswing_reached(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state)
{ … }
void intel_dp_link_training_set_mode(struct intel_dp *intel_dp, int link_rate, bool is_vrr)
{ … }
static void intel_dp_update_downspread_ctrl(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state)
{ … }
void intel_dp_link_training_set_bw(struct intel_dp *intel_dp,
int link_bw, int rate_select, int lane_count,
bool enhanced_framing)
{ … }
static void intel_dp_update_link_bw_set(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state,
u8 link_bw, u8 rate_select)
{ … }
static bool
intel_dp_prepare_link_train(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state)
{ … }
static bool intel_dp_adjust_request_changed(const struct intel_crtc_state *crtc_state,
const u8 old_link_status[DP_LINK_STATUS_SIZE],
const u8 new_link_status[DP_LINK_STATUS_SIZE])
{ … }
void
intel_dp_dump_link_status(struct intel_dp *intel_dp, enum drm_dp_phy dp_phy,
const u8 link_status[DP_LINK_STATUS_SIZE])
{ … }
static bool
intel_dp_link_training_clock_recovery(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state,
enum drm_dp_phy dp_phy)
{ … }
static u32 intel_dp_training_pattern(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state,
enum drm_dp_phy dp_phy)
{ … }
static bool
intel_dp_link_training_channel_equalization(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state,
enum drm_dp_phy dp_phy)
{ … }
static bool intel_dp_disable_dpcd_training_pattern(struct intel_dp *intel_dp,
enum drm_dp_phy dp_phy)
{ … }
static int
intel_dp_128b132b_intra_hop(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state)
{ … }
void intel_dp_stop_link_train(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state)
{ … }
static bool
intel_dp_link_train_phy(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state,
enum drm_dp_phy dp_phy)
{ … }
static bool intel_dp_can_link_train_fallback_for_edp(struct intel_dp *intel_dp,
int link_rate,
u8 lane_count)
{ … }
static bool reduce_link_params_in_bw_order(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state,
int *new_link_rate, int *new_lane_count)
{ … }
static int reduce_link_rate(struct intel_dp *intel_dp, int current_rate)
{ … }
static int reduce_lane_count(struct intel_dp *intel_dp, int current_lane_count)
{ … }
static bool reduce_link_params_in_rate_lane_order(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state,
int *new_link_rate, int *new_lane_count)
{ … }
static bool reduce_link_params(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state,
int *new_link_rate, int *new_lane_count)
{ … }
static int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state)
{ … }
static bool intel_dp_schedule_fallback_link_training(struct intel_atomic_state *state,
struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state)
{ … }
static bool
intel_dp_link_train_all_phys(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state,
int lttpr_count)
{ … }
static bool
intel_dp_128b132b_lane_eq(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state)
{ … }
static bool
intel_dp_128b132b_lane_cds(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state,
int lttpr_count)
{ … }
static bool
intel_dp_128b132b_link_train(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state,
int lttpr_count)
{ … }
void intel_dp_start_link_train(struct intel_atomic_state *state,
struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state)
{ … }
void intel_dp_128b132b_sdp_crc16(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state)
{ … }
static struct intel_dp *intel_connector_to_intel_dp(struct intel_connector *connector)
{ … }
static int i915_dp_force_link_rate_show(struct seq_file *m, void *data)
{ … }
static int parse_link_rate(struct intel_dp *intel_dp, const char __user *ubuf, size_t len)
{ … }
static ssize_t i915_dp_force_link_rate_write(struct file *file,
const char __user *ubuf,
size_t len, loff_t *offp)
{ … }
DEFINE_SHOW_STORE_ATTRIBUTE(…);
static int i915_dp_force_lane_count_show(struct seq_file *m, void *data)
{ … }
static int parse_lane_count(const char __user *ubuf, size_t len)
{ … }
static ssize_t i915_dp_force_lane_count_write(struct file *file,
const char __user *ubuf,
size_t len, loff_t *offp)
{ … }
DEFINE_SHOW_STORE_ATTRIBUTE(…);
static int i915_dp_max_link_rate_show(void *data, u64 *val)
{ … }
DEFINE_DEBUGFS_ATTRIBUTE(…);
static int i915_dp_max_lane_count_show(void *data, u64 *val)
{ … }
DEFINE_DEBUGFS_ATTRIBUTE(…);
static int i915_dp_force_link_training_failure_show(void *data, u64 *val)
{ … }
static int i915_dp_force_link_training_failure_write(void *data, u64 val)
{ … }
DEFINE_DEBUGFS_ATTRIBUTE(…);
static int i915_dp_force_link_retrain_show(void *data, u64 *val)
{ … }
static int i915_dp_force_link_retrain_write(void *data, u64 val)
{ … }
DEFINE_DEBUGFS_ATTRIBUTE(…);
static int i915_dp_link_retrain_disabled_show(struct seq_file *m, void *data)
{ … }
DEFINE_SHOW_ATTRIBUTE(…);
void intel_dp_link_training_debugfs_add(struct intel_connector *connector)
{ … }