Received: by 10.192.165.156 with SMTP id m28csp1307224imm; Wed, 11 Apr 2018 16:48:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx49oz0Wn6xmq0Px4COKNpQi+d4iaue7ny4muBOJbgnkt5mTDT1nSSeEndzFuTkmNatf5Qph5 X-Received: by 10.99.54.75 with SMTP id d72mr4852973pga.96.1523490485786; Wed, 11 Apr 2018 16:48:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523490485; cv=none; d=google.com; s=arc-20160816; b=gxt4W65Nm4LBaagH4virceWnFizp7VEejp76mjCVkGnnKU+g8Ukje0LOpD24OVdEBI 8aeLqj8FqZ0/Z8MvPG18THtIg8RbrYsVT3TAvb0w1trLw/8PLIdE1s7WOZrXjekYufGg nUqu78QiqdKLIwcXOHhwJPZBmWzDDYwf3RFhc1UKlJyJuwGko8BJ94879SUGrPDp06t2 rLbY6w8UYdwKpylQSsxtHcnSKLwlCxDZUTK2Qk1Sx0nHXYcrFvK12Fws8yIM8fzKXntA TkaAym8Vb1riouSEA00701t4+J3S6XpgW/ikqtxy+ozVa7Yhd5bVeMnylm/3NYxhEdlz FT7w== 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=jVDsly/ish5UUt8gfLhda3W4Ty+ut5u/n9kC3PZyyo0=; b=Hqz1o4AJ3b9cPlU3Y+uz3CQc0XMVdCwQF8lqGHKq/79Mbd1thhVpZBz6YhLzb3Sjf5 21QKS4dQtXJkXwsdCqLYOgNDWllH+FYep/DG84hVfPy4bxtkuwsHrxkulwujyecbPG3J P6WNtpUYiXiRJ4OINsDlRdWoCcIbPoWjtNXz6QBOSgkC1QL4RArARUDtBhWhPjwWdusB Klz3VKiJKbsJWwLtDAba3yWL0vaDRhlIPShPHhRehu3elLAPckgee7Ow6xNhZWVkM3sz eCHiByL1SqE0K0G6ddaRE9uyLe9nsbaDDN3SWp7OEbiHA96VQrROdnrZdVQLFQbGg8s+ V64A== 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 s2si1629766pfb.39.2018.04.11.16.47.29; Wed, 11 Apr 2018 16:48:05 -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 S1752713AbeDKXnb (ORCPT + 99 others); Wed, 11 Apr 2018 19:43:31 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50296 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752501AbeDKXn1 (ORCPT ); Wed, 11 Apr 2018 19:43:27 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AFBB38DC43; Wed, 11 Apr 2018 23:43:26 +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 638E310EE6D9; Wed, 11 Apr 2018 23:43:26 +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 v8 06/10] drm/dp_mst: Add reset_state callback to topology mgr Date: Wed, 11 Apr 2018 19:42:45 -0400 Message-Id: <20180411234302.2896-7-lyude@redhat.com> In-Reply-To: <20180411234302.2896-1-lyude@redhat.com> References: <20180411234302.2896-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.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 11 Apr 2018 23:43:26 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 11 Apr 2018 23:43:26 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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 --- 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