intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Dadap <ddadap@nvidia.com>
To: <dri-devel@lists.freedesktop.org>, <lukas@wunner.de>,
	<intel-gfx@lists.freedesktop.org>, <jani.nikula@linux.intel.com>,
	<joonas.lahtinen@linux.intel.com>, <rodrigo.vivi@intel.com>
Cc: Daniel Dadap <ddadap@nvidia.com>
Subject: [Intel-gfx] [PATCH 6/6] i915: bail out of eDP link training while mux-switched away
Date: Mon, 27 Jul 2020 15:51:12 -0500	[thread overview]
Message-ID: <20200727205112.27698-7-ddadap@nvidia.com> (raw)
In-Reply-To: <20200727205112.27698-1-ddadap@nvidia.com>

It is not possible to train a Displayport link while the lanes are
physically disconnected by a display mux. In order to prevent problems
associated with attempting to train a disconnected link, abort eDP
link training if the i915 GPU is not an active vga-switcheroo client.
This short circuit is eDP-specific, as normal DP (e.g. for external
displays) should be able to detect that the link is not physically
connected, while eDP is usually assumed to be always connected.

Signed-off-by: Daniel Dadap <ddadap@nvidia.com>
---
 drivers/gpu/drm/i915/display/intel_dp_link_training.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.c b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
index a7defb37ab00..a1c61db8a228 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
@@ -24,6 +24,7 @@
 #include "intel_display_types.h"
 #include "intel_dp.h"
 #include "intel_dp_link_training.h"
+#include "linux/vga_switcheroo.h"
 
 static void
 intel_dp_dump_link_status(const u8 link_status[DP_LINK_STATUS_SIZE])
@@ -371,6 +372,14 @@ void
 intel_dp_start_link_train(struct intel_dp *intel_dp)
 {
 	struct intel_connector *intel_connector = intel_dp->attached_connector;
+	struct device *dev = dp_to_dig_port(intel_dp)->base.base.dev->dev;
+
+	if (intel_dp_is_edp(intel_dp) &&
+	    !vga_switcheroo_is_client_active(to_pci_dev(dev))) {
+		drm_dbg_kms(&dp_to_i915(intel_dp)->drm,
+			"eDP link training not allowed when muxed away.");
+		return;
+	}
 
 	if (!intel_dp_link_training_clock_recovery(intel_dp))
 		goto failure_handling;
-- 
2.18.4

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

  parent reply	other threads:[~2020-07-27 21:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <ba78cd19-45ad-b17e-5174-256cc11f36c2%40nvidia.com>
2020-07-27 20:51 ` [Intel-gfx] [PATCH 0/6] vga-switcheroo: initial dynamic mux switch support Daniel Dadap
2020-07-27 20:51   ` [Intel-gfx] [PATCH 1/6] vga-switcheroo: add new "immediate" switch event type Daniel Dadap
2020-07-27 20:51   ` [Intel-gfx] [PATCH 2/6] vga-switcheroo: Add a way to test for the active client Daniel Dadap
2020-07-27 20:51   ` [Intel-gfx] [PATCH 3/6] vga-switcheroo: notify clients of pending/completed switch events Daniel Dadap
2020-07-27 20:51   ` [Intel-gfx] [PATCH 4/6] i915: implement vga-switcheroo reprobe() callback Daniel Dadap
2020-07-27 20:51   ` [Intel-gfx] [PATCH 5/6] i915: fail atomic commit when muxed away Daniel Dadap
2020-07-27 20:51   ` Daniel Dadap [this message]
2020-07-28  9:32   ` [Intel-gfx] [PATCH 0/6] vga-switcheroo: initial dynamic mux switch support daniel
2020-07-27 22:05 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/6] vga-switcheroo: add new "immediate" switch event type Patchwork
2020-07-27 22:06 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2020-07-27 22:36 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-07-28  0:45 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " 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=20200727205112.27698-7-ddadap@nvidia.com \
    --to=ddadap@nvidia.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=lukas@wunner.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).