#include <drm/amdgpu_drm.h>
#include <drm/display/drm_dp_helper.h>
#include "amdgpu.h"
#include "atom.h"
#include "atom-bits.h"
#include "atombios_encoders.h"
#include "atombios_dp.h"
#include "amdgpu_connectors.h"
#include "amdgpu_atombios.h"
#define DP_LINK_CONFIGURATION_SIZE …
#define DP_DPCD_SIZE …
static char *voltage_names[] = …;
static char *pre_emph_names[] = …;
aux_channel_transaction;
static int amdgpu_atombios_dp_process_aux_ch(struct amdgpu_i2c_chan *chan,
u8 *send, int send_bytes,
u8 *recv, int recv_size,
u8 delay, u8 *ack)
{ … }
#define BARE_ADDRESS_SIZE …
#define HEADER_SIZE …
static ssize_t
amdgpu_atombios_dp_aux_transfer(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg)
{ … }
void amdgpu_atombios_dp_aux_init(struct amdgpu_connector *amdgpu_connector)
{ … }
#define DP_VOLTAGE_MAX …
#define DP_PRE_EMPHASIS_MAX …
static void amdgpu_atombios_dp_get_adjust_train(const u8 link_status[DP_LINK_STATUS_SIZE],
int lane_count,
u8 train_set[4])
{ … }
static unsigned amdgpu_atombios_dp_convert_bpc_to_bpp(int bpc)
{ … }
static int amdgpu_atombios_dp_get_dp_link_config(struct drm_connector *connector,
const u8 dpcd[DP_DPCD_SIZE],
unsigned pix_clock,
unsigned *dp_lanes, unsigned *dp_rate)
{ … }
static u8 amdgpu_atombios_dp_encoder_service(struct amdgpu_device *adev,
int action, int dp_clock,
u8 ucconfig, u8 lane_num)
{ … }
u8 amdgpu_atombios_dp_get_sinktype(struct amdgpu_connector *amdgpu_connector)
{ … }
static void amdgpu_atombios_dp_probe_oui(struct amdgpu_connector *amdgpu_connector)
{ … }
static void amdgpu_atombios_dp_ds_ports(struct amdgpu_connector *amdgpu_connector)
{ … }
int amdgpu_atombios_dp_get_dpcd(struct amdgpu_connector *amdgpu_connector)
{ … }
int amdgpu_atombios_dp_get_panel_mode(struct drm_encoder *encoder,
struct drm_connector *connector)
{ … }
void amdgpu_atombios_dp_set_link_config(struct drm_connector *connector,
const struct drm_display_mode *mode)
{ … }
int amdgpu_atombios_dp_mode_valid_helper(struct drm_connector *connector,
struct drm_display_mode *mode)
{ … }
bool amdgpu_atombios_dp_needs_link_train(struct amdgpu_connector *amdgpu_connector)
{ … }
void amdgpu_atombios_dp_set_rx_power_state(struct drm_connector *connector,
u8 power_state)
{ … }
struct amdgpu_atombios_dp_link_train_info { … };
static void
amdgpu_atombios_dp_update_vs_emph(struct amdgpu_atombios_dp_link_train_info *dp_info)
{ … }
static void
amdgpu_atombios_dp_set_tp(struct amdgpu_atombios_dp_link_train_info *dp_info, int tp)
{ … }
static int
amdgpu_atombios_dp_link_train_init(struct amdgpu_atombios_dp_link_train_info *dp_info)
{ … }
static int
amdgpu_atombios_dp_link_train_finish(struct amdgpu_atombios_dp_link_train_info *dp_info)
{ … }
static int
amdgpu_atombios_dp_link_train_cr(struct amdgpu_atombios_dp_link_train_info *dp_info)
{ … }
static int
amdgpu_atombios_dp_link_train_ce(struct amdgpu_atombios_dp_link_train_info *dp_info)
{ … }
void amdgpu_atombios_dp_link_train(struct drm_encoder *encoder,
struct drm_connector *connector)
{ … }