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

Commit 89667383 authored by Jesse Barnes's avatar Jesse Barnes Committed by Chris Wilson
Browse files

drm/i915/dp: cache eDP DPCD data



Cache the first 4 bytes of DPCD data in the eDP case.  It's unlikely to
change and can save us some trouble at link training time.

Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent 8088699f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -350,6 +350,7 @@ typedef struct drm_i915_private {
		int bpp;
		struct edp_power_seq pps;
	} edp;
	bool no_aux_handshake;

	struct notifier_block lid_notifier;

+20 −0
Original line number Diff line number Diff line
@@ -1724,6 +1724,26 @@ intel_dp_init(struct drm_device *dev, int output_reg)

	intel_dp_i2c_init(intel_dp, intel_connector, name);

	/* Cache some DPCD data in the eDP case */
	if (is_edp(intel_dp)) {
		int ret;
		bool was_on;

		was_on = ironlake_edp_panel_on(intel_dp);
		ret = intel_dp_aux_native_read(intel_dp, DP_DPCD_REV,
					       intel_dp->dpcd,
					       sizeof(intel_dp->dpcd));
		if (ret == sizeof(intel_dp->dpcd)) {
			if (intel_dp->dpcd[0] >= 0x11)
				dev_priv->no_aux_handshake = intel_dp->dpcd[3] &
					DP_NO_AUX_HANDSHAKE_LINK_TRAINING;
		} else {
			DRM_ERROR("failed to retrieve link info\n");
		}
		if (!was_on)
			ironlake_edp_panel_off(dev);
	}

	intel_encoder->hot_plug = intel_dp_hot_plug;

	if (is_edp(intel_dp)) {