Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e1214b95 authored by Ville Syrjälä's avatar Ville Syrjälä
Browse files

drm/i915: Populate output_types from .get_config()



Rather than having the caller of .get_config() set output_types based on
encoder->type, let's just have .get_config() itself populate
output_types. This way we are isolated from encoder->type, which won't
be useable for this purpose anyway soon (at least for DDI encoders).

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171027193128.14483-2-ville.syrjala@linux.intel.com


Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
parent d6038611
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -119,6 +119,8 @@ static unsigned int intel_crt_get_flags(struct intel_encoder *encoder)
static void intel_crt_get_config(struct intel_encoder *encoder,
				 struct intel_crtc_state *pipe_config)
{
	pipe_config->output_types |= BIT(INTEL_OUTPUT_ANALOG);

	pipe_config->base.adjusted_mode.flags |= intel_crt_get_flags(encoder);

	pipe_config->base.adjusted_mode.crtc_clock = pipe_config->port_clock;
+11 −0
Original line number Diff line number Diff line
@@ -2595,12 +2595,23 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
			pipe_config->hdmi_high_tmds_clock_ratio = true;
		/* fall through */
	case TRANS_DDI_MODE_SELECT_DVI:
		pipe_config->output_types |= BIT(INTEL_OUTPUT_HDMI);
		pipe_config->lane_count = 4;
		break;
	case TRANS_DDI_MODE_SELECT_FDI:
		pipe_config->output_types |= BIT(INTEL_OUTPUT_ANALOG);
		break;
	case TRANS_DDI_MODE_SELECT_DP_SST:
		if (encoder->type == INTEL_OUTPUT_EDP)
			pipe_config->output_types |= BIT(INTEL_OUTPUT_EDP);
		else
			pipe_config->output_types |= BIT(INTEL_OUTPUT_DP);
		pipe_config->lane_count =
			((temp & DDI_PORT_WIDTH_MASK) >> DDI_PORT_WIDTH_SHIFT) + 1;
		intel_dp_get_m_n(intel_crtc, pipe_config);
		break;
	case TRANS_DDI_MODE_SELECT_DP_MST:
		pipe_config->output_types |= BIT(INTEL_OUTPUT_DP_MST);
		pipe_config->lane_count =
			((temp & DDI_PORT_WIDTH_MASK) >> DDI_PORT_WIDTH_SHIFT) + 1;
		intel_dp_get_m_n(intel_crtc, pipe_config);
+1 −4
Original line number Diff line number Diff line
@@ -11562,11 +11562,9 @@ verify_crtc_state(struct drm_crtc *crtc,
				"Encoder connected to wrong pipe %c\n",
				pipe_name(pipe));

		if (active) {
			pipe_config->output_types |= 1 << encoder->type;
		if (active)
			encoder->get_config(encoder, pipe_config);
	}
	}

	intel_crtc_compute_pixel_rate(pipe_config);

@@ -14960,7 +14958,6 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
			crtc_state = to_intel_crtc_state(crtc->base.state);

			encoder->base.crtc = &crtc->base;
			crtc_state->output_types |= 1 << encoder->type;
			encoder->get_config(encoder, crtc_state);
		} else {
			encoder->base.crtc = NULL;
+5 −0
Original line number Diff line number Diff line
@@ -2621,6 +2621,11 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
	enum port port = dp_to_dig_port(intel_dp)->port;
	struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc);

	if (encoder->type == INTEL_OUTPUT_EDP)
		pipe_config->output_types |= BIT(INTEL_OUTPUT_EDP);
	else
		pipe_config->output_types |= BIT(INTEL_OUTPUT_DP);

	tmp = I915_READ(intel_dp->output_reg);

	pipe_config->has_audio = tmp & DP_AUDIO_OUTPUT_ENABLE && port != PORT_A;
+2 −0
Original line number Diff line number Diff line
@@ -291,6 +291,8 @@ static void intel_dp_mst_enc_get_config(struct intel_encoder *encoder,
	enum transcoder cpu_transcoder = pipe_config->cpu_transcoder;
	u32 temp, flags = 0;

	pipe_config->output_types |= BIT(INTEL_OUTPUT_DP_MST);

	pipe_config->has_audio =
		intel_ddi_is_audio_enabled(dev_priv, crtc);

Loading