All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Sharma, Shashank" <shashank.sharma@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: daniel.vetter@intel.com, intel-gfx@lists.freedesktop.org,
	paulo.r.zanoni@intel.com
Subject: Re: [PATCH 5/5] drm/i915: Enable lspcon initialization
Date: Wed, 01 Jun 2016 15:06:56 +0530	[thread overview]
Message-ID: <574EACB8.6070307@intel.com> (raw)
In-Reply-To: <20160531163423.GZ4329@intel.com>

Regards
Shashank

On 5/31/2016 10:04 PM, Ville Syrjälä wrote:
> On Tue, May 31, 2016 at 02:55:46PM +0530, Shashank Sharma wrote:
>> This patch adds initialization code for lspcon.
>> What we are doing here is:
>> 	- Check if lspcon is configured in VBT for this port
>> 	- If lspcon is configured, configure it as DP port
>> 	- Register additional HDMI functions to support LS
>> 	  mode functionalities.
>>
>> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
>> ---
>>   drivers/gpu/drm/i915/intel_ddi.c  | 36 ++++++++++++++++++++++++++++++++++--
>>   drivers/gpu/drm/i915/intel_drv.h  |  4 ++++
>>   drivers/gpu/drm/i915/intel_hdmi.c | 17 +++++++++++++++++
>>   3 files changed, 55 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
>> index 811c829..2107c0d 100644
>> --- a/drivers/gpu/drm/i915/intel_ddi.c
>> +++ b/drivers/gpu/drm/i915/intel_ddi.c
>> @@ -2314,8 +2314,9 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
>>   	struct drm_i915_private *dev_priv = dev->dev_private;
>>   	struct intel_digital_port *intel_dig_port;
>>   	struct intel_encoder *intel_encoder;
>> +	struct intel_connector *intel_connector = NULL;
>>   	struct drm_encoder *encoder;
>> -	bool init_hdmi, init_dp;
>> +	bool init_hdmi, init_dp, init_lspcon = false;
>>   	int max_lanes;
>>
>>   	if (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES) {
>> @@ -2347,6 +2348,19 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
>>   	init_hdmi = (dev_priv->vbt.ddi_port_info[port].supports_dvi ||
>>   		     dev_priv->vbt.ddi_port_info[port].supports_hdmi);
>>   	init_dp = dev_priv->vbt.ddi_port_info[port].supports_dp;
>> +
>> +	if (intel_bios_is_lspcon_present(dev_priv, port)) {
>> +		/*
>> +		* Lspcon device needs to be driven with DP connector
>> +		* with special detection sequence. So make sure DP
>> +		* is initialized before lspcon.
>> +		*/
>> +		init_dp = true;
>> +		init_lspcon = true;
>> +		init_hdmi = false;
>> +		DRM_DEBUG_KMS("VBT says port %c has lspcon\n", port_name(port));
>> +	}
>> +
>>   	if (!init_dp && !init_hdmi) {
>>   		DRM_DEBUG_KMS("VBT says port %c is not DVI/HDMI/DP compatible, respect it\n",
>>   			      port_name(port));
>> @@ -2399,7 +2413,8 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
>>   	intel_encoder->cloneable = 0;
>>
>>   	if (init_dp) {
>> -		if (!intel_ddi_init_dp_connector(intel_dig_port))
>> +		intel_connector = intel_ddi_init_dp_connector(intel_dig_port);
>> +		if (!intel_connector)
>>   			goto err;
>>
>>   		intel_dig_port->hpd_pulse = intel_dp_hpd_pulse;
>> @@ -2420,6 +2435,23 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
>>   			goto err;
>>   	}
>>
>> +	if (init_lspcon) {
>> +		if (lspcon_init(intel_dig_port)) {
>> +			if (intel_hdmi_init_minimum(intel_dig_port,
>> +				intel_connector)) {
>> +				DRM_ERROR("HDMI init for LSPCON failed\n");
>> +				goto err;
>> +			}
>> +		} else {
>> +			/*
>> +			* LSPCON init faied, but DP init was success, so lets try to
>> +			* drive as DP++ port.
>> +			*/
>> +			DRM_ERROR("LSPCON init failed on port %c\n",
>> +				port_name(port));
>> +		}
>> +	}
>> +
>>   	return;
>>
>>   err:
>> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
>> index fa77886..402e656 100644
>> --- a/drivers/gpu/drm/i915/intel_drv.h
>> +++ b/drivers/gpu/drm/i915/intel_drv.h
>> @@ -1454,6 +1454,10 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
>>   void intel_dp_dual_mode_set_tmds_output(struct intel_hdmi *hdmi, bool enable);
>>   enum drm_connector_status
>>   intel_hdmi_detect(struct drm_connector *connector, bool force);
>> +int intel_hdmi_init_minimum(struct intel_digital_port *intel_dig_port,
>> +			       struct intel_connector *intel_connector);
>> +
>> +
>>
>>   /* intel_lvds.c */
>>   void intel_lvds_init(struct drm_device *dev);
>> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
>> index 79184e2..54b0b46 100644
>> --- a/drivers/gpu/drm/i915/intel_hdmi.c
>> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
>> @@ -1931,6 +1931,23 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
>>   	}
>>   }
>>
>> +int intel_hdmi_init_minimum(struct intel_digital_port *intel_dig_port,
>> +			       struct intel_connector *intel_connector)
>> +{
>> +	struct intel_hdmi *intel_hdmi = &intel_dig_port->hdmi;
>> +
>> +	if (WARN(intel_dig_port->max_lanes < 4,
>> +		"Not enough lanes (%d) for HDMI on port %c\n",
>> +		intel_dig_port->max_lanes, port_name(intel_dig_port->port)))
>> +		return -EINVAL;
>> +
>> +	intel_hdmi->write_infoframe = hsw_write_infoframe;
>> +	intel_hdmi->set_infoframes = hsw_set_infoframes;
>> +	intel_hdmi->infoframe_enabled = hsw_infoframe_enabled;
>> +	intel_hdmi->attached_connector = intel_connector;
>> +	return 0;
>> +}
>
> Hmm. I think I had patches somewhere to isolate the infoframe stuff from
> the HDMI code a bit better. I think I even had patches to move the
> infoframe hooks to the dig_port level. Should maybe dig those up.
Sure, that will be more systematic, and a better design.
>
>> +
>>   void intel_hdmi_init(struct drm_device *dev,
>>   		     i915_reg_t hdmi_reg, enum port port)
>>   {
>> --
>> 1.9.1
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-06-01  9:36 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-31  9:25 [PATCH 0/5] Enable lspcon support for GEN9 devices Shashank Sharma
2016-05-31  9:25 ` [PATCH 1/5] drm: Helper for LSPCON in drm_dp_dual_mode Shashank Sharma
2016-05-31  9:52   ` Ville Syrjälä
2016-05-31 10:52     ` Sharma, Shashank
2016-05-31 12:10       ` Ville Syrjälä
2016-05-31 12:42         ` Sharma, Shashank
2016-05-31 16:05   ` Ville Syrjälä
2016-05-31 16:13     ` Sharma, Shashank
2016-05-31  9:25 ` [PATCH 2/5] drm/i915: Add lspcon support for I915 driver Shashank Sharma
2016-05-31 16:08   ` Ville Syrjälä
2016-05-31 16:27     ` Sharma, Shashank
2016-05-31  9:25 ` [PATCH 3/5] drm/i915: lspcon detection Shashank Sharma
2016-05-31 16:30   ` Ville Syrjälä
2016-06-01  9:33     ` Sharma, Shashank
2016-05-31  9:25 ` [PATCH 4/5] drm/i915: Parse VBT data for lspcon Shashank Sharma
2016-05-31 16:32   ` Ville Syrjälä
2016-06-01  9:35     ` Sharma, Shashank
2016-05-31  9:25 ` [PATCH 5/5] drm/i915: Enable lspcon initialization Shashank Sharma
2016-05-31 16:34   ` Ville Syrjälä
2016-06-01  9:36     ` Sharma, Shashank [this message]
2016-05-31 12:32 ` ✗ Ro.CI.BAT: warning for Enable lspcon support for GEN9 devices Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=574EACB8.6070307@intel.com \
    --to=shashank.sharma@intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@intel.com \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.