Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/4] drm/i915/bios: add DSI ports to parse_ddi_port()
Date: Tue, 29 Oct 2019 18:01:09 +0200	[thread overview]
Message-ID: <20191029160109.GC1208@intel.com> (raw)
In-Reply-To: <20191029153930.27103-2-jani.nikula@intel.com>

On Tue, Oct 29, 2019 at 05:39:28PM +0200, Jani Nikula wrote:
> Bring DSI closer to other ports, and facilitate easier lookup of more
> child device specific data in a unified manner in the future. This may
> cause problems if there are any VBTs in the wild with colliding child
> device ports. In practice those should have surfaced already by way of
> trying to initialize DSI and something else on the same port.

I think this can legit happen on VLV/CHV where the DSI ports
do not occupy the same universe as the HDMI/DP ports. Eg.
it would be perfectly legal to have DSI C + HDMI/DP C at the same
time. DSI A of course won't collide with anything since the
other ports start from B.

> 
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_bios.c | 14 ++++++++------
>  drivers/gpu/drm/i915/i915_drv.h           |  1 +
>  2 files changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
> index 5c78f52be9b4..7d7e953e4a30 100644
> --- a/drivers/gpu/drm/i915/display/intel_bios.c
> +++ b/drivers/gpu/drm/i915/display/intel_bios.c
> @@ -1393,9 +1393,9 @@ static enum port dvo_port_to_port(u8 dvo_port)
>  	 * so look for all the possible values for each port.
>  	 */
>  	static const int dvo_ports[][3] = {
> -		[PORT_A] = { DVO_PORT_HDMIA, DVO_PORT_DPA, -1},
> -		[PORT_B] = { DVO_PORT_HDMIB, DVO_PORT_DPB, -1},
> -		[PORT_C] = { DVO_PORT_HDMIC, DVO_PORT_DPC, -1},
> +		[PORT_A] = { DVO_PORT_HDMIA, DVO_PORT_DPA, DVO_PORT_MIPIA },
> +		[PORT_B] = { DVO_PORT_HDMIB, DVO_PORT_DPB, DVO_PORT_MIPIB },
> +		[PORT_C] = { DVO_PORT_HDMIC, DVO_PORT_DPC, DVO_PORT_MIPIC },
>  		[PORT_D] = { DVO_PORT_HDMID, DVO_PORT_DPD, -1},
>  		[PORT_E] = { DVO_PORT_CRT, DVO_PORT_HDMIE, DVO_PORT_DPE},
>  		[PORT_F] = { DVO_PORT_HDMIF, DVO_PORT_DPF, -1},
> @@ -1422,7 +1422,7 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv,
>  			   u8 bdb_version)
>  {
>  	struct ddi_vbt_port_info *info;
> -	bool is_dvi, is_hdmi, is_dp, is_edp, is_crt;
> +	bool is_dvi, is_hdmi, is_dp, is_edp, is_crt, is_dsi;
>  	enum port port;
>  
>  	port = dvo_port_to_port(child->dvo_port);
> @@ -1442,6 +1442,7 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv,
>  	is_crt = child->device_type & DEVICE_TYPE_ANALOG_OUTPUT;
>  	is_hdmi = is_dvi && (child->device_type & DEVICE_TYPE_NOT_HDMI_OUTPUT) == 0;
>  	is_edp = is_dp && (child->device_type & DEVICE_TYPE_INTERNAL_CONNECTOR);
> +	is_dsi = child->device_type & DEVICE_TYPE_MIPI_OUTPUT;
>  
>  	if (port == PORT_A && is_dvi) {
>  		DRM_DEBUG_KMS("VBT claims port A supports DVI%s, ignoring\n",
> @@ -1454,6 +1455,7 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv,
>  	info->supports_hdmi = is_hdmi;
>  	info->supports_dp = is_dp;
>  	info->supports_edp = is_edp;
> +	info->supports_dsi = is_dsi;
>  
>  	if (bdb_version >= 195)
>  		info->supports_typec_usb = child->dp_usb_type_c;
> @@ -1461,9 +1463,9 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv,
>  	if (bdb_version >= 209)
>  		info->supports_tbt = child->tbt;
>  
> -	DRM_DEBUG_KMS("Port %c VBT info: CRT:%d DVI:%d HDMI:%d DP:%d eDP:%d LSPCON:%d USB-Type-C:%d TBT:%d\n",
> +	DRM_DEBUG_KMS("Port %c VBT info: CRT:%d DVI:%d HDMI:%d DP:%d eDP:%d DSI:%d LSPCON:%d USB-Type-C:%d TBT:%d\n",
>  		      port_name(port), is_crt, is_dvi, is_hdmi, is_dp, is_edp,
> -		      HAS_LSPCON(dev_priv) && child->lspcon,
> +		      is_dsi, HAS_LSPCON(dev_priv) && child->lspcon,
>  		      info->supports_typec_usb, info->supports_tbt);
>  
>  	if (is_edp && is_dvi)
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 9faf5cb6bfaa..5c6a43d79597 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -635,6 +635,7 @@ struct ddi_vbt_port_info {
>  	u8 supports_hdmi:1;
>  	u8 supports_dp:1;
>  	u8 supports_edp:1;
> +	u8 supports_dsi:1;
>  	u8 supports_typec_usb:1;
>  	u8 supports_tbt:1;
>  
> -- 
> 2.20.1

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

WARNING: multiple messages have this Message-ID (diff)
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 2/4] drm/i915/bios: add DSI ports to parse_ddi_port()
Date: Tue, 29 Oct 2019 18:01:09 +0200	[thread overview]
Message-ID: <20191029160109.GC1208@intel.com> (raw)
Message-ID: <20191029160109.5mHA3VQOjmUFtwFvdG__XzLWCKj6GtvABq9HoCuwST0@z> (raw)
In-Reply-To: <20191029153930.27103-2-jani.nikula@intel.com>

On Tue, Oct 29, 2019 at 05:39:28PM +0200, Jani Nikula wrote:
> Bring DSI closer to other ports, and facilitate easier lookup of more
> child device specific data in a unified manner in the future. This may
> cause problems if there are any VBTs in the wild with colliding child
> device ports. In practice those should have surfaced already by way of
> trying to initialize DSI and something else on the same port.

I think this can legit happen on VLV/CHV where the DSI ports
do not occupy the same universe as the HDMI/DP ports. Eg.
it would be perfectly legal to have DSI C + HDMI/DP C at the same
time. DSI A of course won't collide with anything since the
other ports start from B.

> 
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_bios.c | 14 ++++++++------
>  drivers/gpu/drm/i915/i915_drv.h           |  1 +
>  2 files changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
> index 5c78f52be9b4..7d7e953e4a30 100644
> --- a/drivers/gpu/drm/i915/display/intel_bios.c
> +++ b/drivers/gpu/drm/i915/display/intel_bios.c
> @@ -1393,9 +1393,9 @@ static enum port dvo_port_to_port(u8 dvo_port)
>  	 * so look for all the possible values for each port.
>  	 */
>  	static const int dvo_ports[][3] = {
> -		[PORT_A] = { DVO_PORT_HDMIA, DVO_PORT_DPA, -1},
> -		[PORT_B] = { DVO_PORT_HDMIB, DVO_PORT_DPB, -1},
> -		[PORT_C] = { DVO_PORT_HDMIC, DVO_PORT_DPC, -1},
> +		[PORT_A] = { DVO_PORT_HDMIA, DVO_PORT_DPA, DVO_PORT_MIPIA },
> +		[PORT_B] = { DVO_PORT_HDMIB, DVO_PORT_DPB, DVO_PORT_MIPIB },
> +		[PORT_C] = { DVO_PORT_HDMIC, DVO_PORT_DPC, DVO_PORT_MIPIC },
>  		[PORT_D] = { DVO_PORT_HDMID, DVO_PORT_DPD, -1},
>  		[PORT_E] = { DVO_PORT_CRT, DVO_PORT_HDMIE, DVO_PORT_DPE},
>  		[PORT_F] = { DVO_PORT_HDMIF, DVO_PORT_DPF, -1},
> @@ -1422,7 +1422,7 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv,
>  			   u8 bdb_version)
>  {
>  	struct ddi_vbt_port_info *info;
> -	bool is_dvi, is_hdmi, is_dp, is_edp, is_crt;
> +	bool is_dvi, is_hdmi, is_dp, is_edp, is_crt, is_dsi;
>  	enum port port;
>  
>  	port = dvo_port_to_port(child->dvo_port);
> @@ -1442,6 +1442,7 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv,
>  	is_crt = child->device_type & DEVICE_TYPE_ANALOG_OUTPUT;
>  	is_hdmi = is_dvi && (child->device_type & DEVICE_TYPE_NOT_HDMI_OUTPUT) == 0;
>  	is_edp = is_dp && (child->device_type & DEVICE_TYPE_INTERNAL_CONNECTOR);
> +	is_dsi = child->device_type & DEVICE_TYPE_MIPI_OUTPUT;
>  
>  	if (port == PORT_A && is_dvi) {
>  		DRM_DEBUG_KMS("VBT claims port A supports DVI%s, ignoring\n",
> @@ -1454,6 +1455,7 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv,
>  	info->supports_hdmi = is_hdmi;
>  	info->supports_dp = is_dp;
>  	info->supports_edp = is_edp;
> +	info->supports_dsi = is_dsi;
>  
>  	if (bdb_version >= 195)
>  		info->supports_typec_usb = child->dp_usb_type_c;
> @@ -1461,9 +1463,9 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv,
>  	if (bdb_version >= 209)
>  		info->supports_tbt = child->tbt;
>  
> -	DRM_DEBUG_KMS("Port %c VBT info: CRT:%d DVI:%d HDMI:%d DP:%d eDP:%d LSPCON:%d USB-Type-C:%d TBT:%d\n",
> +	DRM_DEBUG_KMS("Port %c VBT info: CRT:%d DVI:%d HDMI:%d DP:%d eDP:%d DSI:%d LSPCON:%d USB-Type-C:%d TBT:%d\n",
>  		      port_name(port), is_crt, is_dvi, is_hdmi, is_dp, is_edp,
> -		      HAS_LSPCON(dev_priv) && child->lspcon,
> +		      is_dsi, HAS_LSPCON(dev_priv) && child->lspcon,
>  		      info->supports_typec_usb, info->supports_tbt);
>  
>  	if (is_edp && is_dvi)
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 9faf5cb6bfaa..5c6a43d79597 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -635,6 +635,7 @@ struct ddi_vbt_port_info {
>  	u8 supports_hdmi:1;
>  	u8 supports_dp:1;
>  	u8 supports_edp:1;
> +	u8 supports_dsi:1;
>  	u8 supports_typec_usb:1;
>  	u8 supports_tbt:1;
>  
> -- 
> 2.20.1

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2019-10-29 16:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-29 15:39 [PATCH 1/4] drm/i915/bios: use a flag for vbt hdmi level shift presence Jani Nikula
2019-10-29 15:39 ` [Intel-gfx] " Jani Nikula
2019-10-29 15:39 ` [PATCH 2/4] drm/i915/bios: add DSI ports to parse_ddi_port() Jani Nikula
2019-10-29 15:39   ` [Intel-gfx] " Jani Nikula
2019-10-29 16:01   ` Ville Syrjälä [this message]
2019-10-29 16:01     ` Ville Syrjälä
2019-10-29 15:39 ` [PATCH 3/4] drm/i915/bios: parse DDI ports also on VLV Jani Nikula
2019-10-29 15:39   ` [Intel-gfx] " Jani Nikula
2019-10-29 15:39 ` [PATCH 4/4] drm/i915/dsi: initialize DSI on each port Jani Nikula
2019-10-29 15:39   ` [Intel-gfx] " Jani Nikula
2019-10-29 21:45 ` ✓ Fi.CI.BAT: success for series starting with [1/4] drm/i915/bios: use a flag for vbt hdmi level shift presence Patchwork
2019-10-29 21:45   ` [Intel-gfx] " Patchwork
2019-10-30 18:36 ` ✓ Fi.CI.IGT: " Patchwork
2019-10-30 18:36   ` [Intel-gfx] " 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=20191029160109.GC1208@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox