Commit 1a66c95a authored by Alex Deucher's avatar Alex Deucher Committed by Dave Airlie

drm/radeon/kms: DP fixes and cleanup from the ddx

- dpcp -> dpcd
- fix up dig encoder routing
- aux transaction table takes delay in 10 usec units
Signed-off-by: default avatarAlex Deucher <alexdeucher@gmail.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 746c1aa4
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#define DP_LINK_STATUS_SIZE 6 #define DP_LINK_STATUS_SIZE 6
bool radeon_process_aux_ch(struct radeon_i2c_chan *chan, u8 *req_bytes, bool radeon_process_aux_ch(struct radeon_i2c_chan *chan, u8 *req_bytes,
int num_bytes, u8 *read_byte, int num_bytes, u8 *read_byte,
u8 read_buf_len, u8 delay) u8 read_buf_len, u8 delay)
{ {
struct drm_device *dev = chan->dev; struct drm_device *dev = chan->dev;
...@@ -42,9 +42,9 @@ bool radeon_process_aux_ch(struct radeon_i2c_chan *chan, u8 *req_bytes, ...@@ -42,9 +42,9 @@ bool radeon_process_aux_ch(struct radeon_i2c_chan *chan, u8 *req_bytes,
PROCESS_AUX_CHANNEL_TRANSACTION_PS_ALLOCATION args; PROCESS_AUX_CHANNEL_TRANSACTION_PS_ALLOCATION args;
int index = GetIndexIntoMasterTable(COMMAND, ProcessAuxChannelTransaction); int index = GetIndexIntoMasterTable(COMMAND, ProcessAuxChannelTransaction);
unsigned char *base; unsigned char *base;
memset(&args, 0, sizeof(args)); memset(&args, 0, sizeof(args));
base = (unsigned char *)rdev->mode_info.atom_context->scratch; base = (unsigned char *)rdev->mode_info.atom_context->scratch;
memcpy(base, req_bytes, num_bytes); memcpy(base, req_bytes, num_bytes);
...@@ -53,7 +53,7 @@ bool radeon_process_aux_ch(struct radeon_i2c_chan *chan, u8 *req_bytes, ...@@ -53,7 +53,7 @@ bool radeon_process_aux_ch(struct radeon_i2c_chan *chan, u8 *req_bytes,
args.lpDataOut = 16; args.lpDataOut = 16;
args.ucDataOutLen = 0; args.ucDataOutLen = 0;
args.ucChannelID = chan->i2c_id; args.ucChannelID = chan->i2c_id;
args.ucDelay = delay; args.ucDelay = delay / 10;
atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
...@@ -158,24 +158,24 @@ bool radeon_dp_aux_native_read(struct radeon_connector *radeon_connector, uint16 ...@@ -158,24 +158,24 @@ bool radeon_dp_aux_native_read(struct radeon_connector *radeon_connector, uint16
return ret; return ret;
} }
void radeon_dp_getdpcp(struct radeon_connector *radeon_connector) void radeon_dp_getdpcd(struct radeon_connector *radeon_connector)
{ {
struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv; struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv;
u8 msg[25]; u8 msg[25];
int ret; int ret;
ret = radeon_dp_aux_native_read(radeon_connector, DP_DPCP_REV, 0, 8, msg); ret = radeon_dp_aux_native_read(radeon_connector, DP_DPCD_REV, 0, 8, msg);
if (ret) { if (ret) {
memcpy(radeon_dig_connector->dpcp, msg, 8); memcpy(radeon_dig_connector->dpcd, msg, 8);
{ {
int i; int i;
printk("DPCP: "); printk("DPCD: ");
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
printk("%02x ", msg[i]); printk("%02x ", msg[i]);
printk("\n"); printk("\n");
} }
} }
radeon_dig_connector->dpcp[0] = 0; radeon_dig_connector->dpcd[0] = 0;
return; return;
} }
...@@ -199,8 +199,8 @@ static bool atom_dp_get_link_status(struct radeon_connector *radeon_connector, ...@@ -199,8 +199,8 @@ static bool atom_dp_get_link_status(struct radeon_connector *radeon_connector,
static void dp_set_power(struct radeon_connector *radeon_connector, u8 power_state) static void dp_set_power(struct radeon_connector *radeon_connector, u8 power_state)
{ {
struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv; struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv;
if (radeon_dig_connector->dpcp[0] >= 0x11) { if (radeon_dig_connector->dpcd[0] >= 0x11) {
radeon_dp_aux_native_write(radeon_connector, 0x600, 1, radeon_dp_aux_native_write(radeon_connector, DP_SET_POWER, 1,
&power_state); &power_state);
} }
} }
......
...@@ -923,7 +923,7 @@ static enum drm_connector_status radeon_dp_detect(struct drm_connector *connecto ...@@ -923,7 +923,7 @@ static enum drm_connector_status radeon_dp_detect(struct drm_connector *connecto
sink_type = radeon_dp_getsinktype(radeon_connector); sink_type = radeon_dp_getsinktype(radeon_connector);
if (sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) { if (sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) {
radeon_dp_getdpcp(radeon_connector); radeon_dp_getdpcd(radeon_connector);
ret = connector_status_connected; ret = connector_status_connected;
} }
return ret; return ret;
......
This diff is collapsed.
...@@ -335,7 +335,7 @@ struct radeon_connector_atom_dig { ...@@ -335,7 +335,7 @@ struct radeon_connector_atom_dig {
bool linkb; bool linkb;
uint16_t uc_i2c_id; uint16_t uc_i2c_id;
struct radeon_i2c_chan *dp_i2c_bus; struct radeon_i2c_chan *dp_i2c_bus;
u8 dpcp[8]; u8 dpcd[8];
}; };
struct radeon_connector { struct radeon_connector {
...@@ -362,7 +362,7 @@ struct radeon_framebuffer { ...@@ -362,7 +362,7 @@ struct radeon_framebuffer {
}; };
extern int radeon_dp_getsinktype(struct radeon_connector *radeon_connector); extern int radeon_dp_getsinktype(struct radeon_connector *radeon_connector);
extern void radeon_dp_getdpcp(struct radeon_connector *connector); extern void radeon_dp_getdpcd(struct radeon_connector *connector);
extern int radeon_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode, extern int radeon_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode,
uint8_t write_byte, uint8_t *read_byte); uint8_t write_byte, uint8_t *read_byte);
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
#define AUX_I2C_REPLY_MASK (0x3 << 6) #define AUX_I2C_REPLY_MASK (0x3 << 6)
/* AUX CH addresses */ /* AUX CH addresses */
#define DP_DPCP_REV 0x0 #define DP_DPCD_REV 0x0
#define DP_LINK_BW_SET 0x100 #define DP_LINK_BW_SET 0x100
# define DP_LINK_BW_1_62 0x06 # define DP_LINK_BW_1_62 0x06
...@@ -132,6 +132,8 @@ ...@@ -132,6 +132,8 @@
#define DP_ADJUST_PRE_EMPHASIS_LANE1_MASK 0xc0 #define DP_ADJUST_PRE_EMPHASIS_LANE1_MASK 0xc0
#define DP_ADJUST_PRE_EMPHASIS_LANE1_SHIFT 6 #define DP_ADJUST_PRE_EMPHASIS_LANE1_SHIFT 6
#define DP_SET_POWER 0x600
#define MODE_I2C_START 1 #define MODE_I2C_START 1
#define MODE_I2C_WRITE 2 #define MODE_I2C_WRITE 2
#define MODE_I2C_READ 4 #define MODE_I2C_READ 4
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment