Skip to content

Commit 74fce3b

Browse files
alexdeuchergregkh
authored andcommitted
drm/radeon/kms: properly set panel mode for eDP
commit 00dfb8d upstream. This should make eDP more reliable. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 6af5ee8 commit 74fce3b

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

‎drivers/gpu/drm/radeon/atombios_dp.c‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,17 +553,28 @@ static void radeon_dp_set_panel_mode(struct drm_encoder *encoder,
553553
{
554554
struct drm_device *dev = encoder->dev;
555555
struct radeon_device *rdev = dev->dev_private;
556+
struct radeon_connector *radeon_connector = to_radeon_connector(connector);
556557
int panel_mode = DP_PANEL_MODE_EXTERNAL_DP_MODE;
557558

558559
if (!ASIC_IS_DCE4(rdev))
559560
return;
560561

561562
if (radeon_connector_encoder_is_dp_bridge(connector))
562563
panel_mode = DP_PANEL_MODE_INTERNAL_DP1_MODE;
564+
else if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) {
565+
u8 tmp = radeon_read_dpcd_reg(radeon_connector, DP_EDP_CONFIGURATION_CAP);
566+
if (tmp & 1)
567+
panel_mode = DP_PANEL_MODE_INTERNAL_DP2_MODE;
568+
}
563569

564570
atombios_dig_encoder_setup(encoder,
565571
ATOM_ENCODER_CMD_SETUP_PANEL_MODE,
566572
panel_mode);
573+
574+
if ((connector->connector_type == DRM_MODE_CONNECTOR_eDP) &&
575+
(panel_mode == DP_PANEL_MODE_INTERNAL_DP2_MODE)) {
576+
radeon_write_dpcd_reg(radeon_connector, DP_EDP_CONFIGURATION_SET, 1);
577+
}
567578
}
568579

569580
void radeon_dp_set_link_config(struct drm_connector *connector,

‎include/drm/drm_dp_helper.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272

7373
#define DP_MAIN_LINK_CHANNEL_CODING 0x006
7474

75+
#define DP_EDP_CONFIGURATION_CAP 0x00d
7576
#define DP_TRAINING_AUX_RD_INTERVAL 0x00e
7677

7778
/* link configuration */
@@ -133,6 +134,8 @@
133134
#define DP_MAIN_LINK_CHANNEL_CODING_SET 0x108
134135
# define DP_SET_ANSI_8B10B (1 << 0)
135136

137+
#define DP_EDP_CONFIGURATION_SET 0x10a
138+
136139
#define DP_LANE0_1_STATUS 0x202
137140
#define DP_LANE2_3_STATUS 0x203
138141
# define DP_LANE_CR_DONE (1 << 0)

0 commit comments

Comments
 (0)