[Intel-gfx] [PATCH 03/12] drm/i915: Call the DDC bus i2c adapter "ddc"

Jani Nikula jani.nikula at linux.intel.com
Wed Aug 30 12:04:44 UTC 2023


On Wed, 30 Aug 2023, Jani Nikula <jani.nikula at linux.intel.com> wrote:
> On Tue, 29 Aug 2023, Ville Syrjala <ville.syrjala at linux.intel.com> wrote:
>> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>> @@ -2452,24 +2447,24 @@ intel_hdmi_set_edid(struct drm_connector *connector)
>>  {
>>  	struct drm_i915_private *dev_priv = to_i915(connector->dev);
>>  	struct intel_hdmi *intel_hdmi = intel_attached_hdmi(to_intel_connector(connector));
>> +	struct i2c_adapter *ddc = intel_gmbus_get_adapter(dev_priv, intel_hdmi->ddc_bus);
>>  	intel_wakeref_t wakeref;
>>  	const struct drm_edid *drm_edid;
>>  	const struct edid *edid;
>>  	bool connected = false;
>> -	struct i2c_adapter *i2c;
>>  
>>  	wakeref = intel_display_power_get(dev_priv, POWER_DOMAIN_GMBUS);
>>  
>> -	i2c = intel_gmbus_get_adapter(dev_priv, intel_hdmi->ddc_bus);
>> +	edid = drm_get_edid(connector, ddc);
>
> Must be a rebase fail.

With this + line dropped, everything else is

Reviewed-by: Jani Nikula <jani.nikula at intel.com>


>
> BR,
> Jani.
>
>>  
>> -	drm_edid = drm_edid_read_ddc(connector, i2c);
>> +	drm_edid = drm_edid_read_ddc(connector, ddc);
>>  
>> -	if (!drm_edid && !intel_gmbus_is_forced_bit(i2c)) {
>> +	if (!drm_edid && !intel_gmbus_is_forced_bit(ddc)) {
>>  		drm_dbg_kms(&dev_priv->drm,
>>  			    "HDMI GMBUS EDID read failed, retry using GPIO bit-banging\n");
>> -		intel_gmbus_force_bit(i2c, true);
>> -		drm_edid = drm_edid_read_ddc(connector, i2c);
>> -		intel_gmbus_force_bit(i2c, false);
>> +		intel_gmbus_force_bit(ddc, true);
>> +		drm_edid = drm_edid_read_ddc(connector, ddc);
>> +		intel_gmbus_force_bit(ddc, false);
>>  	}
>>  
>>  	/* Below we depend on display info having been updated */
>> @@ -2561,8 +2556,8 @@ intel_hdmi_get_i2c_adapter(struct drm_connector *connector)
>>  static void intel_hdmi_create_i2c_symlink(struct drm_connector *connector)
>>  {
>>  	struct drm_i915_private *i915 = to_i915(connector->dev);
>> -	struct i2c_adapter *adapter = intel_hdmi_get_i2c_adapter(connector);
>> -	struct kobject *i2c_kobj = &adapter->dev.kobj;
>> +	struct i2c_adapter *ddc = intel_hdmi_get_i2c_adapter(connector);
>> +	struct kobject *i2c_kobj = &ddc->dev.kobj;
>>  	struct kobject *connector_kobj = &connector->kdev->kobj;
>>  	int ret;
>>  
>> @@ -2573,8 +2568,8 @@ static void intel_hdmi_create_i2c_symlink(struct drm_connector *connector)
>>  
>>  static void intel_hdmi_remove_i2c_symlink(struct drm_connector *connector)
>>  {
>> -	struct i2c_adapter *adapter = intel_hdmi_get_i2c_adapter(connector);
>> -	struct kobject *i2c_kobj = &adapter->dev.kobj;
>> +	struct i2c_adapter *ddc = intel_hdmi_get_i2c_adapter(connector);
>> +	struct kobject *i2c_kobj = &ddc->dev.kobj;
>>  	struct kobject *connector_kobj = &connector->kdev->kobj;
>>  
>>  	sysfs_remove_link(connector_kobj, i2c_kobj->name);
>> diff --git a/drivers/gpu/drm/i915/display/intel_lspcon.c b/drivers/gpu/drm/i915/display/intel_lspcon.c
>> index bb3b5355a0d9..152a22a8ffd2 100644
>> --- a/drivers/gpu/drm/i915/display/intel_lspcon.c
>> +++ b/drivers/gpu/drm/i915/display/intel_lspcon.c
>> @@ -144,9 +144,9 @@ static enum drm_lspcon_mode lspcon_get_current_mode(struct intel_lspcon *lspcon)
>>  	struct intel_dp *intel_dp = lspcon_to_intel_dp(lspcon);
>>  	struct drm_i915_private *i915 = dp_to_i915(intel_dp);
>>  	enum drm_lspcon_mode current_mode;
>> -	struct i2c_adapter *adapter = &intel_dp->aux.ddc;
>> +	struct i2c_adapter *ddc = &intel_dp->aux.ddc;
>>  
>> -	if (drm_lspcon_get_mode(intel_dp->aux.drm_dev, adapter, &current_mode)) {
>> +	if (drm_lspcon_get_mode(intel_dp->aux.drm_dev, ddc, &current_mode)) {
>>  		drm_dbg_kms(&i915->drm, "Error reading LSPCON mode\n");
>>  		return DRM_LSPCON_MODE_INVALID;
>>  	}
>> @@ -185,9 +185,9 @@ static int lspcon_change_mode(struct intel_lspcon *lspcon,
>>  	struct drm_i915_private *i915 = dp_to_i915(intel_dp);
>>  	int err;
>>  	enum drm_lspcon_mode current_mode;
>> -	struct i2c_adapter *adapter = &intel_dp->aux.ddc;
>> +	struct i2c_adapter *ddc = &intel_dp->aux.ddc;
>>  
>> -	err = drm_lspcon_get_mode(intel_dp->aux.drm_dev, adapter, &current_mode);
>> +	err = drm_lspcon_get_mode(intel_dp->aux.drm_dev, ddc, &current_mode);
>>  	if (err) {
>>  		drm_err(&i915->drm, "Error reading LSPCON mode\n");
>>  		return err;
>> @@ -198,7 +198,7 @@ static int lspcon_change_mode(struct intel_lspcon *lspcon,
>>  		return 0;
>>  	}
>>  
>> -	err = drm_lspcon_set_mode(intel_dp->aux.drm_dev, adapter, mode);
>> +	err = drm_lspcon_set_mode(intel_dp->aux.drm_dev, ddc, mode);
>>  	if (err < 0) {
>>  		drm_err(&i915->drm, "LSPCON mode change failed\n");
>>  		return err;
>> @@ -233,7 +233,7 @@ static bool lspcon_probe(struct intel_lspcon *lspcon)
>>  	enum drm_dp_dual_mode_type adaptor_type;
>>  	struct intel_dp *intel_dp = lspcon_to_intel_dp(lspcon);
>>  	struct drm_i915_private *i915 = dp_to_i915(intel_dp);
>> -	struct i2c_adapter *adapter = &intel_dp->aux.ddc;
>> +	struct i2c_adapter *ddc = &intel_dp->aux.ddc;
>>  	enum drm_lspcon_mode expected_mode;
>>  
>>  	expected_mode = lspcon_wake_native_aux_ch(lspcon) ?
>> @@ -244,7 +244,7 @@ static bool lspcon_probe(struct intel_lspcon *lspcon)
>>  		if (retry)
>>  			usleep_range(500, 1000);
>>  
>> -		adaptor_type = drm_dp_dual_mode_detect(intel_dp->aux.drm_dev, adapter);
>> +		adaptor_type = drm_dp_dual_mode_detect(intel_dp->aux.drm_dev, ddc);
>>  		if (adaptor_type == DRM_DP_DUAL_MODE_LSPCON)
>>  			break;
>>  	}

-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the Intel-gfx mailing list