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

Commit 335af9a2 authored by Zhenyu Wang's avatar Zhenyu Wang Committed by Eric Anholt
Browse files

drm/i915: change intel_ddc_get_modes() function parameters



This one replaces original param for intel_ddc_get_modes() with
DRM connector and i2c bus adapter instead. With explicit params,
we won't require that a single driver structure must hold connector
and DDC bus reference, which ease the conversion to splitted encoder/
connector model.

It also clears up for some cases that we would steal other DDC bus
for mode probe, like VGA analog DDC probe for DVI-I. Also it fixed
a bug in old DVI-I probe handling, that failed to restore origin
analog GPIO port.

Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: default avatarEric Anholt <eric@anholt.net>
parent c1c43977
Loading
Loading
Loading
Loading
+6 −9
Original line number Diff line number Diff line
@@ -433,28 +433,25 @@ static int intel_crt_get_modes(struct drm_connector *connector)
{
	int ret;
	struct intel_encoder *intel_encoder = to_intel_encoder(connector);
	struct i2c_adapter *ddcbus;
	struct i2c_adapter *ddc_bus;
	struct drm_device *dev = connector->dev;


	ret = intel_ddc_get_modes(intel_encoder);
	ret = intel_ddc_get_modes(connector, intel_encoder->ddc_bus);
	if (ret || !IS_G4X(dev))
		goto end;

	ddcbus = intel_encoder->ddc_bus;
	/* Try to probe digital port for output in DVI-I -> VGA mode. */
	intel_encoder->ddc_bus =
		intel_i2c_create(connector->dev, GPIOD, "CRTDDC_D");
	ddc_bus = intel_i2c_create(connector->dev, GPIOD, "CRTDDC_D");

	if (!intel_encoder->ddc_bus) {
		intel_encoder->ddc_bus = ddcbus;
	if (!ddc_bus) {
		dev_printk(KERN_ERR, &connector->dev->pdev->dev,
			   "DDC bus registration failed for CRTDDC_D.\n");
		goto end;
	}
	/* Try to get modes by GPIOD port */
	ret = intel_ddc_get_modes(intel_encoder);
	intel_i2c_destroy(ddcbus);
	ret = intel_ddc_get_modes(connector, ddc_bus);
	intel_i2c_destroy(ddc_bus);

end:
	return ret;
+1 −1
Original line number Diff line number Diff line
@@ -1229,7 +1229,7 @@ static int intel_dp_get_modes(struct drm_connector *connector)
	/* We should parse the EDID data and find out if it has an audio sink
	 */

	ret = intel_ddc_get_modes(intel_encoder);
	ret = intel_ddc_get_modes(connector, intel_encoder->ddc_bus);
	if (ret)
		return ret;

+1 −1
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ struct intel_crtc {
struct i2c_adapter *intel_i2c_create(struct drm_device *dev, const u32 reg,
				     const char *name);
void intel_i2c_destroy(struct i2c_adapter *adapter);
int intel_ddc_get_modes(struct intel_encoder *intel_encoder);
int intel_ddc_get_modes(struct drm_connector *c, struct i2c_adapter *adapter);
extern bool intel_ddc_probe(struct intel_encoder *intel_encoder);
void intel_i2c_quirk_set(struct drm_device *dev, bool enable);
void intel_i2c_reset_gmbus(struct drm_device *dev);
+1 −1
Original line number Diff line number Diff line
@@ -256,7 +256,7 @@ static int intel_dvo_get_modes(struct drm_connector *connector)
	 * (TV-out, for example), but for now with just TMDS and LVDS,
	 * that's not the case.
	 */
	intel_ddc_get_modes(intel_encoder);
	intel_ddc_get_modes(connector, intel_encoder->ddc_bus);
	if (!list_empty(&connector->probed_modes))
		return 1;

+1 −1
Original line number Diff line number Diff line
@@ -179,7 +179,7 @@ static int intel_hdmi_get_modes(struct drm_connector *connector)
	 * we can send audio to it.
	 */

	return intel_ddc_get_modes(intel_encoder);
	return intel_ddc_get_modes(connector, intel_encoder->ddc_bus);
}

static void intel_hdmi_destroy(struct drm_connector *connector)
Loading