Skip to content

Commit 44905a2

Browse files
committed
i915: split some DP modesetting code into a separate function
this is just prep work for mst support. Reviewed-by: Todd Previte <tprevite@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
1 parent 01b887c commit 44905a2

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

drivers/gpu/drm/i915/intel_ddi.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,18 @@ void hsw_fdi_link_train(struct drm_crtc *crtc)
365365
DRM_ERROR("FDI link training failed!\n");
366366
}
367367

368+
void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder)
369+
{
370+
struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
371+
struct intel_digital_port *intel_dig_port =
372+
enc_to_dig_port(&encoder->base);
373+
374+
intel_dp->DP = intel_dig_port->saved_port_bits |
375+
DDI_BUF_CTL_ENABLE | DDI_BUF_EMP_400MV_0DB_HSW;
376+
intel_dp->DP |= DDI_PORT_WIDTH(intel_dp->lane_count);
377+
378+
}
379+
368380
static struct intel_encoder *
369381
intel_ddi_get_crtc_encoder(struct drm_crtc *crtc)
370382
{
@@ -1015,12 +1027,8 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder)
10151027

10161028
if (type == INTEL_OUTPUT_DISPLAYPORT || type == INTEL_OUTPUT_EDP) {
10171029
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
1018-
struct intel_digital_port *intel_dig_port =
1019-
enc_to_dig_port(encoder);
10201030

1021-
intel_dp->DP = intel_dig_port->saved_port_bits |
1022-
DDI_BUF_CTL_ENABLE | DDI_BUF_EMP_400MV_0DB_HSW;
1023-
intel_dp->DP |= DDI_PORT_WIDTH(intel_dp->lane_count);
1031+
intel_ddi_init_dp_buf_reg(intel_encoder);
10241032

10251033
intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
10261034
intel_dp_start_link_train(intel_dp);

drivers/gpu/drm/i915/intel_drv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,7 @@ void intel_ddi_fdi_disable(struct drm_crtc *crtc);
718718
void intel_ddi_get_config(struct intel_encoder *encoder,
719719
struct intel_crtc_config *pipe_config);
720720

721+
void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder);
721722

722723
/* intel_display.c */
723724
const char *intel_output_name(int output);

0 commit comments

Comments
 (0)