From patchwork Tue Sep 18 23:06:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lyude Paul X-Patchwork-Id: 10605003 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CBA0514DA for ; Tue, 18 Sep 2018 23:07:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB4942B2B1 for ; Tue, 18 Sep 2018 23:07:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AEE3F2B2E6; Tue, 18 Sep 2018 23:07:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6D4862B2B1 for ; Tue, 18 Sep 2018 23:07:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E5C066E48E; Tue, 18 Sep 2018 23:07:29 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6B0AB6E48E; Tue, 18 Sep 2018 23:07:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A225630A5681; Tue, 18 Sep 2018 23:07:27 +0000 (UTC) Received: from whitewolf.lyude.net.com (ovpn-125-172.rdu2.redhat.com [10.10.125.172]) by smtp.corp.redhat.com (Postfix) with ESMTP id AC30C7D676; Tue, 18 Sep 2018 23:07:20 +0000 (UTC) From: Lyude Paul To: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Date: Tue, 18 Sep 2018 19:06:22 -0400 Message-Id: <20180918230637.20700-7-lyude@redhat.com> In-Reply-To: <20180918230637.20700-1-lyude@redhat.com> References: <20180918230637.20700-1-lyude@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Tue, 18 Sep 2018 23:07:27 +0000 (UTC) Subject: [Intel-gfx] [PATCH 6/6] drm/amdgpu/dm/mst: Use drm_dp_mst_connector_atomic_check() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "David \(ChunMing\) Zhou" , Andrey Grodzovsky , Leo Li , Tony Cheng , Roman Li , linux-kernel@vger.kernel.org, David Airlie , "Jerry \(Fangzhi\) Zuo" , Daniel Vetter , Alex Deucher , Harry Wentland , =?utf-8?q?Christian_K=C3=B6nig?= MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Harry Wentland --- .../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)