Received: by 10.192.165.156 with SMTP id m28csp1271627imm; Wed, 11 Apr 2018 15:59:34 -0700 (PDT) X-Google-Smtp-Source: AIpwx49/1/1/dqGLh3agIy9+YKSGgJy/f7LJ6CKoqLA799tN/NuoYKLDmA7u605F9J/PjqnWVUeu X-Received: by 10.98.70.199 with SMTP id o68mr5511635pfi.169.1523487574309; Wed, 11 Apr 2018 15:59:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523487574; cv=none; d=google.com; s=arc-20160816; b=w5/dkrKcrgIr8+FqBzqaNJJgNzrzJdh68pmGMcUoU3xp7u8muKtvy9d01QzmNLIS/t J0OXIlobSGv+cBpQgFMYr/XR6fhPTlVrPh4m3k1uBNN6ZrKiVsDw3fxHBJQcluWpb4p8 3XmBaJPV7OQY/VP44WLShP0ZdPIqTfqLTKS2qx0ZYJlxRavj2lwhetsuB+dT3tvQSg1Z cTiLj2NLaMXOGe+oxvGrvIRu+QsATSloKZ7a4aEMkmggrwexGLxHiUHimsYnjHuBkhBb Qv2u6oPmYudOBMQPrhV0dreLvusRhJtnBExY+qDAikoFGdMj7Ws05XTa+CSo+NLbAhBf yE9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=BfYYb7z7Oex5KMkZH4+uPQe5UrS28vvAxD/tky/Fl+w=; b=HBBZZfawy+1k1gSOEk1nwKGBxqWmayTs0hNDpMUuqx0ghR9wp7sMeMi2r6nRnzjTP9 JYLJtDKiMQeeolPQzn5LJoMEY07QFujlBGocMRiECEZhKipRQhu6BWsAcZq3aTzZ2M/9 bWdgVd7k3KI6wrEtPLPylaF/G2yZ7dk8r6Ub0mrpLosMn/rnuIE2TDwjgH1y3+Hd8ZM7 VguHNc7/gb8jzHkEylfUHHMX/hXFpEazwYjm28TIkpEZhu9Mo6odqPzZiiFMhZw6mI6Y bZyseyIL6qXL9c6EBp+Nl1SGU8Y43Vbdm5hUTC1A+ezeaiRnScBKS9RA9UEtZbHeY/Iq rjCA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y17-v6si2111396pll.296.2018.04.11.15.58.57; Wed, 11 Apr 2018 15:59:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752758AbeDKWzg (ORCPT + 99 others); Wed, 11 Apr 2018 18:55:36 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36308 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752245AbeDKWze (ORCPT ); Wed, 11 Apr 2018 18:55:34 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8129F414DF39; Wed, 11 Apr 2018 22:55:33 +0000 (UTC) Received: from malachite.bss.redhat.com (dhcp-10-20-1-55.bss.redhat.com [10.20.1.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 334492026E03; Wed, 11 Apr 2018 22:55:33 +0000 (UTC) From: Lyude Paul To: intel-gfx@lists.freedesktop.org Cc: Manasi Navare , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Gustavo Padovan , Maarten Lankhorst , Sean Paul , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 06/10] drm/dp_mst: Add reset_state callback to topology mgr Date: Wed, 11 Apr 2018 18:54:43 -0400 Message-Id: <20180411225501.26751-7-lyude@redhat.com> In-Reply-To: <20180411225501.26751-1-lyude@redhat.com> References: <20180411225501.26751-1-lyude@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 11 Apr 2018 22:55:33 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 11 Apr 2018 22:55:33 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lyude@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This gives drivers subclassing drm_dp_mst_topology_state the ability to prepare their topology states for a new hub to be connected whenever it's detected that the currently connected topology has been disconnected from the system. We'll need this in order to correctly track RX capabilities in i915 from the topology's atomic state. Cc: Manasi Navare Cc: Ville Syrjälä Signed-off-by: Lyude Paul V7: - Fix CHECKPATCH errors Signed-off-by: Lyude Paul --- drivers/gpu/drm/drm_dp_mst_topology.c | 10 ++++++++++ include/drm/drm_dp_mst_helper.h | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index fbd7888ebca8..981bd0f7d3ab 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -2096,6 +2096,15 @@ static bool drm_dp_get_vc_payload_bw(int dp_link_bw, return true; } +static void drm_dp_mst_topology_reset_state(struct drm_dp_mst_topology_mgr *mgr) +{ + struct drm_dp_mst_topology_state *state = + to_dp_mst_topology_state(mgr->base.state); + + if (mgr->cbs->reset_state) + mgr->cbs->reset_state(state); +} + /** * drm_dp_mst_topology_mgr_set_mst() - Set the MST state for a topology manager * @mgr: manager to set state for @@ -2171,6 +2180,7 @@ int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool ms mgr->payload_mask = 0; set_bit(0, &mgr->payload_mask); mgr->vcpi_mask = 0; + drm_dp_mst_topology_reset_state(mgr); } out_unlock: diff --git a/include/drm/drm_dp_mst_helper.h b/include/drm/drm_dp_mst_helper.h index ad1aaec8d514..3a7378cd5bd1 100644 --- a/include/drm/drm_dp_mst_helper.h +++ b/include/drm/drm_dp_mst_helper.h @@ -381,6 +381,7 @@ struct drm_dp_sideband_msg_tx { /* sideband msg handler */ struct drm_dp_mst_topology_mgr; +struct drm_dp_mst_topology_state; struct drm_dp_mst_topology_cbs { /* create a connector for a port */ struct drm_connector *(*add_connector)(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, const char *path); @@ -388,7 +389,7 @@ struct drm_dp_mst_topology_cbs { void (*destroy_connector)(struct drm_dp_mst_topology_mgr *mgr, struct drm_connector *connector); void (*hotplug)(struct drm_dp_mst_topology_mgr *mgr); - + void (*reset_state)(struct drm_dp_mst_topology_state *state); }; #define DP_MAX_PAYLOAD (sizeof(unsigned long) * 8) -- 2.14.3