aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-02-23 18:24:01 -0500
committerAlex Deucher <alexander.deucher@amd.com>2015-03-19 12:26:49 -0400
commitbf071900c347c43f9d982df5209191fc45cbc3a4 (patch)
treedc03d21d6393e786241f31878af4a488a60408b1
parent00a014e8efab508b30843031d60ac01a8b791cc6 (diff)
drm/radeon: add new atombios encoder/transmitter interfaces
These allow overriding the encoder id with the frontend, we need this for setting up MST. Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/radeon/atombios_encoders.c29
-rw-r--r--drivers/gpu/drm/radeon/radeon_mode.h4
2 files changed, 28 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c
index c39c1d0d9d4e..eb575a854330 100644
--- a/drivers/gpu/drm/radeon/atombios_encoders.c
+++ b/drivers/gpu/drm/radeon/atombios_encoders.c
@@ -823,7 +823,7 @@ union dig_encoder_control {
823}; 823};
824 824
825void 825void
826atombios_dig_encoder_setup(struct drm_encoder *encoder, int action, int panel_mode) 826atombios_dig_encoder_setup2(struct drm_encoder *encoder, int action, int panel_mode, int enc_override)
827{ 827{
828 struct drm_device *dev = encoder->dev; 828 struct drm_device *dev = encoder->dev;
829 struct radeon_device *rdev = dev->dev_private; 829 struct radeon_device *rdev = dev->dev_private;
@@ -920,7 +920,10 @@ atombios_dig_encoder_setup(struct drm_encoder *encoder, int action, int panel_mo
920 920
921 if (ENCODER_MODE_IS_DP(args.v3.ucEncoderMode) && (dp_clock == 270000)) 921 if (ENCODER_MODE_IS_DP(args.v3.ucEncoderMode) && (dp_clock == 270000))
922 args.v1.ucConfig |= ATOM_ENCODER_CONFIG_V3_DPLINKRATE_2_70GHZ; 922 args.v1.ucConfig |= ATOM_ENCODER_CONFIG_V3_DPLINKRATE_2_70GHZ;
923 args.v3.acConfig.ucDigSel = dig->dig_encoder; 923 if (enc_override != -1)
924 args.v3.acConfig.ucDigSel = enc_override;
925 else
926 args.v3.acConfig.ucDigSel = dig->dig_encoder;
924 args.v3.ucBitPerColor = radeon_atom_get_bpc(encoder); 927 args.v3.ucBitPerColor = radeon_atom_get_bpc(encoder);
925 break; 928 break;
926 case 4: 929 case 4:
@@ -948,7 +951,11 @@ atombios_dig_encoder_setup(struct drm_encoder *encoder, int action, int panel_mo
948 else 951 else
949 args.v1.ucConfig |= ATOM_ENCODER_CONFIG_V4_DPLINKRATE_1_62GHZ; 952 args.v1.ucConfig |= ATOM_ENCODER_CONFIG_V4_DPLINKRATE_1_62GHZ;
950 } 953 }
951 args.v4.acConfig.ucDigSel = dig->dig_encoder; 954
955 if (enc_override != -1)
956 args.v4.acConfig.ucDigSel = enc_override;
957 else
958 args.v4.acConfig.ucDigSel = dig->dig_encoder;
952 args.v4.ucBitPerColor = radeon_atom_get_bpc(encoder); 959 args.v4.ucBitPerColor = radeon_atom_get_bpc(encoder);
953 if (hpd_id == RADEON_HPD_NONE) 960 if (hpd_id == RADEON_HPD_NONE)
954 args.v4.ucHPD_ID = 0; 961 args.v4.ucHPD_ID = 0;
@@ -969,6 +976,12 @@ atombios_dig_encoder_setup(struct drm_encoder *encoder, int action, int panel_mo
969 976
970} 977}
971 978
979void
980atombios_dig_encoder_setup(struct drm_encoder *encoder, int action, int panel_mode)
981{
982 atombios_dig_encoder_setup2(encoder, action, panel_mode, -1);
983}
984
972union dig_transmitter_control { 985union dig_transmitter_control {
973 DIG_TRANSMITTER_CONTROL_PS_ALLOCATION v1; 986 DIG_TRANSMITTER_CONTROL_PS_ALLOCATION v1;
974 DIG_TRANSMITTER_CONTROL_PARAMETERS_V2 v2; 987 DIG_TRANSMITTER_CONTROL_PARAMETERS_V2 v2;
@@ -978,7 +991,7 @@ union dig_transmitter_control {
978}; 991};
979 992
980void 993void
981atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t lane_num, uint8_t lane_set) 994atombios_dig_transmitter_setup2(struct drm_encoder *encoder, int action, uint8_t lane_num, uint8_t lane_set, int fe)
982{ 995{
983 struct drm_device *dev = encoder->dev; 996 struct drm_device *dev = encoder->dev;
984 struct radeon_device *rdev = dev->dev_private; 997 struct radeon_device *rdev = dev->dev_private;
@@ -1328,7 +1341,7 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t
1328 args.v5.asConfig.ucHPDSel = 0; 1341 args.v5.asConfig.ucHPDSel = 0;
1329 else 1342 else
1330 args.v5.asConfig.ucHPDSel = hpd_id + 1; 1343 args.v5.asConfig.ucHPDSel = hpd_id + 1;
1331 args.v5.ucDigEncoderSel = 1 << dig_encoder; 1344 args.v5.ucDigEncoderSel = (fe != -1) ? (1 << fe) : (1 << dig_encoder);
1332 args.v5.ucDPLaneSet = lane_set; 1345 args.v5.ucDPLaneSet = lane_set;
1333 break; 1346 break;
1334 default: 1347 default:
@@ -1344,6 +1357,12 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t
1344 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); 1357 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
1345} 1358}
1346 1359
1360void
1361atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t lane_num, uint8_t lane_set)
1362{
1363 atombios_dig_transmitter_setup2(encoder, action, lane_num, lane_set, -1);
1364}
1365
1347bool 1366bool
1348atombios_set_edp_panel_power(struct drm_connector *connector, int action) 1367atombios_set_edp_panel_power(struct drm_connector *connector, int action)
1349{ 1368{
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h
index 5390ce67510c..f6a43461b76c 100644
--- a/drivers/gpu/drm/radeon/radeon_mode.h
+++ b/drivers/gpu/drm/radeon/radeon_mode.h
@@ -726,11 +726,15 @@ extern ssize_t
726radeon_dp_aux_transfer_native(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg); 726radeon_dp_aux_transfer_native(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg);
727 727
728extern void atombios_dig_encoder_setup(struct drm_encoder *encoder, int action, int panel_mode); 728extern void atombios_dig_encoder_setup(struct drm_encoder *encoder, int action, int panel_mode);
729extern void atombios_dig_encoder_setup2(struct drm_encoder *encoder, int action, int panel_mode, int enc_override);
729extern void radeon_atom_encoder_init(struct radeon_device *rdev); 730extern void radeon_atom_encoder_init(struct radeon_device *rdev);
730extern void radeon_atom_disp_eng_pll_init(struct radeon_device *rdev); 731extern void radeon_atom_disp_eng_pll_init(struct radeon_device *rdev);
731extern void atombios_dig_transmitter_setup(struct drm_encoder *encoder, 732extern void atombios_dig_transmitter_setup(struct drm_encoder *encoder,
732 int action, uint8_t lane_num, 733 int action, uint8_t lane_num,
733 uint8_t lane_set); 734 uint8_t lane_set);
735extern void atombios_dig_transmitter_setup2(struct drm_encoder *encoder,
736 int action, uint8_t lane_num,
737 uint8_t lane_set, int fe);
734extern void radeon_atom_ext_encoder_setup_ddc(struct drm_encoder *encoder); 738extern void radeon_atom_ext_encoder_setup_ddc(struct drm_encoder *encoder);
735extern struct drm_encoder *radeon_get_external_encoder(struct drm_encoder *encoder); 739extern struct drm_encoder *radeon_get_external_encoder(struct drm_encoder *encoder);
736void radeon_atom_copy_swap(u8 *dst, u8 *src, u8 num_bytes, bool to_le); 740void radeon_atom_copy_swap(u8 *dst, u8 *src, u8 num_bytes, bool to_le);