From patchwork Tue Mar 26 10:31:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 161185 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp5038806jan; Tue, 26 Mar 2019 03:33:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqyW/qzk987toWLNU88tntV5diZN01ZH0MQ52lyu5EOzx0hwanFiPv5pL2fz2KDIaA4C9HmQ X-Received: by 2002:a65:65c4:: with SMTP id y4mr28015804pgv.305.1553596382456; Tue, 26 Mar 2019 03:33:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553596382; cv=none; d=google.com; s=arc-20160816; b=fBFJaTM1LJr2Rs1+n/SPjcjRm1bIKF2mRhWL9PmATnx9EUHY9l2VIcm9EaxYUuddMD Tu11fxd6S2uwbetwwsWU338gYoZUIFDSH8jigFtA1Gt7YAnnR7ECL62wnUlSmHhR7BPV OAnkW/vQMB5PpUaM6AUIblmeA52IQfZq8d4lP5L7ac6S7j+snt0+dkTFJ5iBg33w8Q0d Mm1xyWuQUwV419mJb0g9edkQNQPDfJcjFfDWerhHfB8Ermj2wpmSf6uS2gC+WCIKGTQk Mcz+3bRSiJP38faGa63K8jlKXt4iJaCB/f+1BEG5jkpnjq4jiD6kaAAYtMnNtUYyUeGi 0M9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to; bh=/4ZRbEfbDyVGdjLeJ9UNd4g924Wsh+EYT+FUlujJyl8=; b=X2bUYSlhwJC02wFSZqN9KkUrrKXLodr6wz3Fs1iHauDSPsOO5V/o7WLx91HFOUMXdF sD35QptsptqKci2slpxQfq2HYs2I3l0cEoTZu69ZNXoBXksIxIOSyFrWcmMx06cGpAa1 c3Rx4rWu4ilWEfmHs3+oQFVcZDhn+EE1V3Lq7P0KmxRtHuLMHOBti+JAHeG7+vb0oSU9 CjdXRq49lvVYiM7lIE1+QCxA8CHSwfz15nXYz3sMXCVZl7rvPa9yCmX6JSHe3A+UE5Bz AeqBpcthlEObpQ+MvkuTI1rHHgY+frz956rzTnn28l4k7soDZzWOzcpVerfKav27KDx6 Bkow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id f185si4447376pgc.182.2019.03.26.03.33.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Mar 2019 03:33:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BAA846E7E7; Tue, 26 Mar 2019 10:33:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by gabe.freedesktop.org (Postfix) with ESMTPS id C51C76E7E8 for ; Tue, 26 Mar 2019 10:32:58 +0000 (UTC) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2QAWtMo081320; Tue, 26 Mar 2019 05:32:55 -0500 Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2QAWtwJ021870 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 26 Mar 2019 05:32:55 -0500 Received: from DLEE110.ent.ti.com (157.170.170.21) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 26 Mar 2019 05:32:44 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Tue, 26 Mar 2019 05:32:44 -0500 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x2QAWN29071249; Tue, 26 Mar 2019 05:32:42 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Andrey Smirnov , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCHv2 07/22] drm/bridge: tc358767: move video stream setup to tc_main_link_stream Date: Tue, 26 Mar 2019 12:31:31 +0200 Message-ID: <20190326103146.24795-8-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190326103146.24795-1-tomi.valkeinen@ti.com> References: <20190326103146.24795-1-tomi.valkeinen@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1553596375; bh=LRQ6uuXI3P5Ckw+nSjXkfEM1OuTURIiUzBnH1mzwhtw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=OhBgTD4OA+23uUH0InQD6BH+IASnO6S1fWVeNnIYBVIa6wRBDfhUd15qLGCAgNFHs JrrDqRFa5gJTjt5DTOr3/HFik799VrgoOIzFAxJpc+ZrwUxXUr64WVQbd+5+Kx9Vs1 O7jFke3l/4CdyUBOEAMSZ+XGSei5udIg97qoRV+s= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomi Valkeinen Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The driver currently sets the video stream registers in tc_main_link_setup. One should be able to establish the DP link without any video stream, so a more logical place is to configure the stream in the tc_main_link_stream. So move them there. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/bridge/tc358767.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index f5c232a9064e..86b272422281 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1003,15 +1003,6 @@ static int tc_main_link_setup(struct tc_data *tc) return -EAGAIN; } - ret = tc_set_video_mode(tc, tc->mode); - if (ret) - goto err; - - /* Set M/N */ - ret = tc_stream_clock_calc(tc); - if (ret) - goto err; - return 0; err_dpcd_read: dev_err(tc->dev, "Failed to read DPCD: %d\n", ret); @@ -1030,6 +1021,15 @@ static int tc_main_link_stream(struct tc_data *tc, int state) dev_dbg(tc->dev, "stream: %d\n", state); if (state) { + ret = tc_set_video_mode(tc, tc->mode); + if (ret) + goto err; + + /* Set M/N */ + ret = tc_stream_clock_calc(tc); + if (ret) + goto err; + value = VID_MN_GEN | DP_EN; if (tc->link.base.capabilities & DP_LINK_CAP_ENHANCED_FRAMING) value |= EF_EN;