All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhang, Xiong Y" <xiong.y.zhang@intel.com>
To: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Cc: "Vivi, Rodrigo" <rodrigo.vivi@intel.com>
Subject: Re: [PATCH] drm/i915: Set alternate aux for DDI-E
Date: Tue, 11 Aug 2015 06:18:33 +0000	[thread overview]
Message-ID: <8082FF9BCB2B054996454E47167FF4EC029ABC50@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <1438992076-9183-1-git-send-email-rodrigo.vivi@intel.com>

Reviewed-by: Xiong Zhang <xiong.y.zhang@intel.com>

thanks
________________________________________
From: Intel-gfx [intel-gfx-bounces@lists.freedesktop.org] on behalf of Rodrigo Vivi [rodrigo.vivi@intel.com]
Sent: Saturday, August 08, 2015 8:01 AM
To: intel-gfx@lists.freedesktop.org
Cc: Vivi, Rodrigo
Subject: [Intel-gfx] [PATCH] drm/i915: Set alternate aux for DDI-E

There is no correspondent Aux channel for DDI-E.

So we need to rely on VBT to let us know witch one
is being used instead.

v2: Removing some trailing spaces and giving proper
credit to Xiong that added a nice way to avoid port
conflicts by setting supports_dp = 0 when using
equivalent aux for DDI-E.

Credits-to: Xiong Zhang <xiong.y.zhang@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h   |  7 +++++++
 drivers/gpu/drm/i915/intel_bios.c | 23 +++++++++++++++++++----
 drivers/gpu/drm/i915/intel_ddi.c  |  5 ++---
 drivers/gpu/drm/i915/intel_dp.c   | 29 ++++++++++++++++++++++++++++-
 4 files changed, 56 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 4932d29..3ffd962 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1409,6 +1409,11 @@ enum modeset_restore {
        MODESET_SUSPENDED,
 };

+#define DP_AUX_A 0x40
+#define DP_AUX_B 0x10
+#define DP_AUX_C 0x20
+#define DP_AUX_D 0x30
+
 struct ddi_vbt_port_info {
        /*
         * This is an index in the HDMI/DVI DDI buffer translation table.
@@ -1421,6 +1426,8 @@ struct ddi_vbt_port_info {
        uint8_t supports_dvi:1;
        uint8_t supports_hdmi:1;
        uint8_t supports_dp:1;
+
+       uint8_t alternate_aux_channel;
 };

 enum psr_lines_to_wait {
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 31b1079..990acc2 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -968,13 +968,28 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,
        }

        if (is_dp) {
-               if (aux_channel == 0x40 && port != PORT_A)
+               if (port == PORT_E) {
+                       info->alternate_aux_channel = aux_channel;
+                       /* if DDIE share aux channel with other port, then
+                        * DP couldn't exist on the shared port. Otherwise
+                        * they share the same aux channel and system
+                        * couldn't communicate with them seperately. */
+                       if (aux_channel == DP_AUX_A)
+                               dev_priv->vbt.ddi_port_info[PORT_A].supports_dp = 0;
+                       else if (aux_channel == DP_AUX_B)
+                               dev_priv->vbt.ddi_port_info[PORT_B].supports_dp = 0;
+                       else if (aux_channel == DP_AUX_C)
+                               dev_priv->vbt.ddi_port_info[PORT_C].supports_dp = 0;
+                       else if (aux_channel == DP_AUX_D)
+                               dev_priv->vbt.ddi_port_info[PORT_D].supports_dp = 0;
+               }
+               else if (aux_channel == DP_AUX_A && port != PORT_A)
                        DRM_DEBUG_KMS("Unexpected AUX channel for port A\n");
-               if (aux_channel == 0x10 && port != PORT_B)
+               else if (aux_channel == DP_AUX_B && port != PORT_B)
                        DRM_DEBUG_KMS("Unexpected AUX channel for port B\n");
-               if (aux_channel == 0x20 && port != PORT_C)
+               else if (aux_channel == DP_AUX_C && port != PORT_C)
                        DRM_DEBUG_KMS("Unexpected AUX channel for port C\n");
-               if (aux_channel == 0x30 && port != PORT_D)
+               else if (aux_channel == DP_AUX_D && port != PORT_D)
                        DRM_DEBUG_KMS("Unexpected AUX channel for port D\n");
        }

diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 9a40bfb..110d546 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -3184,10 +3184,9 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
                     dev_priv->vbt.ddi_port_info[port].supports_hdmi);
        init_dp = dev_priv->vbt.ddi_port_info[port].supports_dp;
        if (!init_dp && !init_hdmi) {
-               DRM_DEBUG_KMS("VBT says port %c is not DVI/HDMI/DP compatible, assuming it is\n",
+               DRM_DEBUG_KMS("VBT says port %c is not DVI/HDMI/DP compatible, respect it\n",
                              port_name(port));
-               init_hdmi = true;
-               init_dp = true;
+               return;
        }

        intel_dig_port = kzalloc(sizeof(*intel_dig_port), GFP_KERNEL);
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 15f0d72..601a12a 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1033,11 +1033,34 @@ static void
 intel_dp_aux_init(struct intel_dp *intel_dp, struct intel_connector *connector)
 {
        struct drm_device *dev = intel_dp_to_dev(intel_dp);
+       struct drm_i915_private *dev_priv = dev->dev_private;
        struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
        enum port port = intel_dig_port->port;
+       struct ddi_vbt_port_info *info = &dev_priv->vbt.ddi_port_info[port];
        const char *name = NULL;
+       uint32_t porte_aux_ctl_reg = DPA_AUX_CH_CTL;
        int ret;

+       /* On SKL we don't have Aux for port E so we rely on VBT to set
+        * a proper alternate aux channel.
+        */
+       if (IS_SKYLAKE(dev) && port == PORT_E) {
+               switch (info->alternate_aux_channel) {
+               case DP_AUX_B:
+                       porte_aux_ctl_reg = DPB_AUX_CH_CTL;
+                       break;
+               case DP_AUX_C:
+                       porte_aux_ctl_reg = DPC_AUX_CH_CTL;
+                       break;
+               case DP_AUX_D:
+                       porte_aux_ctl_reg = DPD_AUX_CH_CTL;
+                       break;
+               case DP_AUX_A:
+               default:
+                       porte_aux_ctl_reg = DPA_AUX_CH_CTL;
+               }
+       }
+
        switch (port) {
        case PORT_A:
                intel_dp->aux_ch_ctl_reg = DPA_AUX_CH_CTL;
@@ -1055,6 +1078,10 @@ intel_dp_aux_init(struct intel_dp *intel_dp, struct intel_connector *connector)
                intel_dp->aux_ch_ctl_reg = PCH_DPD_AUX_CH_CTL;
                name = "DPDDC-D";
                break;
+       case PORT_E:
+               intel_dp->aux_ch_ctl_reg = porte_aux_ctl_reg;
+               name = "DPDDC-E";
+               break;
        default:
                BUG();
        }
@@ -1068,7 +1095,7 @@ intel_dp_aux_init(struct intel_dp *intel_dp, struct intel_connector *connector)
         *
         * Skylake moves AUX_CTL back next to DDI_BUF_CTL, on the CPU.
         */
-       if (!IS_HASWELL(dev) && !IS_BROADWELL(dev))
+       if (!IS_HASWELL(dev) && !IS_BROADWELL(dev) && port != PORT_E)
                intel_dp->aux_ch_ctl_reg = intel_dp->output_reg + 0x10;

        intel_dp->aux.name = name;
--
2.4.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-08-11  6:18 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-06  7:51 [PATCH 1/6] drm/i915/skl: Enable DDI-E Xiong Zhang
2015-08-06  7:51 ` [PATCH 2/6] drm/i915: Set power domain for DDI-E Xiong Zhang
2015-08-11  6:12   ` Zhang, Xiong Y
2015-08-06  7:51 ` [PATCH 3/6] drm/i915: Set alternate aux " Xiong Zhang
2015-08-08  0:01   ` [PATCH] " Rodrigo Vivi
2015-08-11  6:18     ` Zhang, Xiong Y [this message]
2015-08-13  8:40     ` shuang.he
2015-08-06  7:51 ` [PATCH 4/6] drm/i915: eDP can be present on DDI-E Xiong Zhang
2015-08-11  6:27   ` Zhang, Xiong Y
2015-08-11  9:47   ` Daniel Vetter
2015-08-11 10:09     ` Zhang, Xiong Y
2015-08-11 18:42     ` Vivi, Rodrigo
2015-08-12 10:27       ` Zhang, Xiong Y
2015-08-12 12:32         ` Daniel Vetter
2015-08-12 16:38           ` Vivi, Rodrigo
2015-08-31 15:47   ` Jani Nikula
2015-08-06  7:51 ` [PATCH 5/6] drm/i915/skl: enable DDIE hotplug Xiong Zhang
2015-08-08  0:06   ` Rodrigo Vivi
2015-08-10  6:53     ` [PATCH 5/6 v2] drm/i915/skl: enable DDI-E hotplug Xiong Zhang
2015-08-17  7:55       ` [PATCH 5/6 v3] " Xiong Zhang
2015-08-26  7:25         ` Jani Nikula
2015-08-06  7:51 ` [PATCH 6/6] drm/i915: Enable HDMI on DDI-E Xiong Zhang
2015-08-08  0:09   ` Rodrigo Vivi
2015-08-11  9:58   ` Daniel Vetter
2015-08-12 10:39     ` [PATCH 6/6 v3] " Xiong Zhang
2015-08-12 12:33       ` Daniel Vetter
2015-08-13  2:57         ` Zhang, Xiong Y
2015-08-14  8:42           ` Daniel Vetter
2015-08-14 10:38             ` Zhang, Xiong Y
2015-08-17  8:04             ` Xiong Zhang
2015-08-31 15:47               ` Jani Nikula
2015-08-12 14:19   ` [PATCH 6/6] " shuang.he
2015-08-06 13:30 ` [PATCH 1/6] drm/i915/skl: Enable DDI-E Daniel Vetter
2015-08-06 15:37   ` Vivi, Rodrigo
2015-08-08  0:35   ` [PATCH 8/6] " Rodrigo Vivi
2015-08-11  7:12     ` Zhang, Xiong Y
2015-08-31 15:48     ` Jani Nikula
2015-08-06 15:14 ` [PATCH 1/6] " Daniel Vetter
2015-08-06 15:50   ` Vivi, Rodrigo
2015-08-08  0:33   ` [PATCH 7/6] drm/i915/skl: DDI-E and DDI-A shares 4 lanes Rodrigo Vivi
2015-08-11  7:05     ` Zhang, Xiong Y
2015-08-11 18:38       ` Vivi, Rodrigo
2015-08-12  2:20         ` Zhang, Xiong Y
2015-08-12 16:51           ` Vivi, Rodrigo
2015-08-13  3:27             ` Zhang, Xiong Y
2015-08-13  5:48               ` Jindal, Sonika
2015-08-26  8:15                 ` Jani Nikula
2015-08-26 16:38                   ` Vivi, Rodrigo
2015-08-27  2:52                     ` Zhang, Xiong Y
2015-08-27 14:31                       ` Timo Aaltonen
2015-08-27 17:59                         ` Vivi, Rodrigo
2015-08-12 21:29       ` Timo Aaltonen

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=8082FF9BCB2B054996454E47167FF4EC029ABC50@SHSMSX104.ccr.corp.intel.com \
    --to=xiong.y.zhang@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@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.