linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lyude Paul <lyude@redhat.com>
To: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org,
	intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org
Cc: "Harry Wentland" <harry.wentland@amd.com>,
	"Leo Li" <sunpeng.li@amd.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"David (ChunMing) Zhou" <David1.Zhou@amd.com>,
	"David Airlie" <airlied@linux.ie>,
	"Jerry (Fangzhi) Zuo" <Jerry.Zuo@amd.com>,
	"Roman Li" <Roman.Li@amd.com>, "Tony Cheng" <Tony.Cheng@amd.com>,
	"Andrey Grodzovsky" <Andrey.Grodzovsky@amd.com>,
	"Daniel Vetter" <daniel.vetter@ffwll.ch>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 6/6] drm/amdgpu/dm/mst: Use drm_dp_mst_connector_atomic_check()
Date: Tue, 18 Sep 2018 19:06:22 -0400	[thread overview]
Message-ID: <20180918230637.20700-7-lyude@redhat.com> (raw)
In-Reply-To: <20180918230637.20700-1-lyude@redhat.com>

Hook this into amdgpu's atomic check for their connectors so they never
get modesets on no-longer-present MST connectors. We'll also expand on
this later once we add DP MST fallback retraining support.

As well, turns out that the only atomic DRM driver without the
->best_encoder() bug is amdgpu. Congrats AMD!

Signed-off-by: Lyude Paul <lyude@redhat.com>
---
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c  | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
index 9a300732ba37..d011a39f17b2 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
@@ -294,10 +294,22 @@ static struct drm_encoder *dm_mst_best_encoder(struct drm_connector *connector)
 	return &amdgpu_dm_connector->mst_encoder->base;
 }
 
+static int
+amdgpu_dm_mst_connector_atomic_check(struct drm_connector *connector,
+				     struct drm_connector_state *new_cstate)
+{
+	struct amdgpu_dm_connector *aconnector =
+		to_amdgpu_dm_connector(connector);
+
+	return drm_dp_mst_connector_atomic_check(connector, new_cstate,
+						 &aconnector->mst_mgr);
+}
+
 static const struct drm_connector_helper_funcs dm_dp_mst_connector_helper_funcs = {
 	.get_modes = dm_dp_mst_get_modes,
 	.mode_valid = amdgpu_dm_connector_mode_valid,
 	.best_encoder = dm_mst_best_encoder,
+	.atomic_check = amdgpu_dm_mst_connector_atomic_check,
 };
 
 static void amdgpu_dm_encoder_destroy(struct drm_encoder *encoder)
-- 
2.17.1


  parent reply	other threads:[~2018-09-18 23:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-18 23:06 [PATCH 0/6] Fix legacy DPMS changes with MST Lyude Paul
2018-09-18 23:06 ` [PATCH 1/6] drm/dp_mst: Introduce drm_dp_mst_connector_atomic_check() Lyude Paul
2018-09-20  9:16   ` Dan Carpenter
2018-09-20 23:35   ` Harry Wentland
2018-09-18 23:06 ` [PATCH 2/6] drm/nouveau: Unbreak nv50_mstc->best_encoder() Lyude Paul
2018-09-18 23:06 ` [PATCH 3/6] drm/i915: Leave intel_conn->mst_port set, use mst_port_gone instead Lyude Paul
2018-09-21  9:27   ` [Intel-gfx] " Daniel Vetter
2018-09-21 20:17     ` Lyude Paul
2018-09-22  8:51       ` Daniel Vetter
2018-09-18 23:06 ` [PATCH 4/6] drm/i915: Skip vcpi allocation for MSTB ports that are gone Lyude Paul
2018-09-18 23:06 ` [PATCH 5/6] drm/i915: Fix intel_dp_mst_best_encoder() Lyude Paul
2018-09-18 23:06 ` Lyude Paul [this message]
2018-09-20 23:36   ` [PATCH 6/6] drm/amdgpu/dm/mst: Use drm_dp_mst_connector_atomic_check() Harry Wentland

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=20180918230637.20700-7-lyude@redhat.com \
    --to=lyude@redhat.com \
    --cc=Andrey.Grodzovsky@amd.com \
    --cc=David1.Zhou@amd.com \
    --cc=Jerry.Zuo@amd.com \
    --cc=Roman.Li@amd.com \
    --cc=Tony.Cheng@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=sunpeng.li@amd.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).