Received: by 10.213.65.68 with SMTP id h4csp2866679imn; Mon, 2 Apr 2018 15:52:07 -0700 (PDT) X-Google-Smtp-Source: AIpwx48LXJBjTZWYw50gIizFG/m7bs2tKWgET7cM4ckpPczBmEiv34gLpFrwIqQbdGInIJjBUon7 X-Received: by 2002:a17:902:1665:: with SMTP id g92-v6mr11243767plg.195.1522709526980; Mon, 02 Apr 2018 15:52:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522709526; cv=none; d=google.com; s=arc-20160816; b=bcB2oMDIwYtZ0P9qmtS7r0l6tIVi3xb+Cj/bZMlyencL1vwKFq/+3AMIBomIsZjGnN /EuK2LX3edqH5cLiQIDwkS9hjzRL+a9wFwxk6sEt4ViTWakJIpjvm1hjpeoJFgg/92pw E6MmtO58pN59CK7BqtqcMM3QWtsyZr4XfVKlASVBGtxllhfopN/aNqhvYv/ebGv2zbu7 7/MvuAK3KBtG1su6W/NrCtBPo3lVm4bQQB2Un/1Ie3ONHUmXjTCg2kw73PqZQplKOuqY W+zzY+oHjFdFgmDbPhGiqmHwCcPuQRHcBD6ijzlQiddFv0ADIi8eBNl20gdFMgQVzimz Fmpg== 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=SwKjIuJEn3SqBdZOUx+TTZvCJs5WmrHcHDlVNXucb7g=; b=SgFENhlgV0k1MKqlrzy1CNYVrdZdJfswheuBJ6Za6xMng2UrHP3hgrggCygMsLUkx/ 7+rYGKwK4SZB1sbzaN8WJg1A6YNBBLvx/VsbSrXiHQE9b1bzSp6KSFmtDYbTJZhBX82v Jqj6W02SovaINx2dSBuq4mSrpqNbgLAzyLS3x07qpXAg/pa2048aD5kBqA9j0Er18TAM 0ruzOExOt9lDxOv5ndMw9pGVAxiRdor4mOdv6Uo1p1+jrVfPX+0VeVoLJwYrzVKQW2O4 OKafAnZIUQi1lclV5GtBJOgO1FsH15womg5ZMFldLA0OJC16SIBWsZMbIb2uVILZO33k kLZA== 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 y34-v6si1295430plb.248.2018.04.02.15.51.53; Mon, 02 Apr 2018 15:52:06 -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 S1754682AbeDBWsa (ORCPT + 99 others); Mon, 2 Apr 2018 18:48:30 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:55178 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754615AbeDBWs2 (ORCPT ); Mon, 2 Apr 2018 18:48:28 -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 6FA1B722E8; Mon, 2 Apr 2018 22:48:28 +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 230701101E88; Mon, 2 Apr 2018 22:48:28 +0000 (UTC) From: Lyude Paul To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: Manasi Navare , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Gustavo Padovan , Maarten Lankhorst , Sean Paul , David Airlie , linux-kernel@vger.kernel.org Subject: [PATCH v5 06/10] drm/dp_mst: Add reset_state callback to topology mgr Date: Mon, 2 Apr 2018 18:47:42 -0400 Message-Id: <20180402224800.16080-7-lyude@redhat.com> In-Reply-To: <20180402224800.16080-1-lyude@redhat.com> References: <20180402224800.16080-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]); Mon, 02 Apr 2018 22:48:28 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 02 Apr 2018 22:48:28 +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 --- drivers/gpu/drm/drm_dp_mst_topology.c | 11 +++++++++++ include/drm/drm_dp_mst_helper.h | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 8a72eed0ae05..b55fd545d6a3 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -2096,6 +2096,16 @@ 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 +2181,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 b42922987470..fd856c371a6e 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