From patchwork Tue Mar 19 10:41:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 160545 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp3711738jad; Tue, 19 Mar 2019 03:42:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMh620+7V2kJtzsOMVqN0dHrYgMXx5tVPy/1OlY5uyQwb1fiFlXMZbYFx+JUNUei2vSK+h X-Received: by 2002:a17:902:aa47:: with SMTP id c7mr1345133plr.338.1552992148984; Tue, 19 Mar 2019 03:42:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552992148; cv=none; d=google.com; s=arc-20160816; b=dy44ikRlZwa02t4FgHug3QTgTtzSLgv5AbQNNxoS2gsZgaCGVVKTB+NJSFUYCnYQ8P UKpsjfAAZvhtsu6vcyeajUQZDi3WSkkqs6ATWblEiXzKXURJe0hNcmmaAlCZYD15C7zr HUupiTKb1068j2XPUfmvYyKAM2iJTH5+RhyhGQ6w+QPhHg9rzihbVVU+oBMc8fGIp5lc MO6/TvImGS9f69f3JxENMHk0pRWB8lFtOfwNdi0m1i0tSMGKD+do4MDJ+aXeyH0YaZxt vnnB0ZVs/Jt1zaPe+J1EkfNnADNUZwyQKLg57VhEYqg1B3YOlIwYn3mcDRz8xRdW4Si9 kBEA== 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=C1PjumJhcn1FRbRwFNSmyv2H/m2cP+uw5Mmip3IS2zn9rbfJ3T01zToTNw9G7PpZDP RMu69WqtWj5B2TE23so2KLHCoJ5ZSzGCpUKt4Gp4MLNUoh5MDMIJ3J4tC+ez3NLpeq7e b6IELjk41AI6b1RzdYFmikcxQPWkRUYFPQbDrknW1IehPC8beD6LOv0EGcIECunAmk7u c127giykS6zbQl1PynpZkqe89wfLy43vethb4S9qqUJz/w87IkjrrYmxvOpaTiPIc12Z rvFpJwlsVSKIbY9Wim4cJ2pK5sYtNNausVYsSMoZlIfdZXre2irg9PHbtQ12exPVks6n 54nw== 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 2610:10:20:722:a800:ff:fe36:1795 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. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id c3si10765568pgq.510.2019.03.19.03.42.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 03:42:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 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 442D889A72; Tue, 19 Mar 2019 10:42:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by gabe.freedesktop.org (Postfix) with ESMTPS id E3DE989487 for ; Tue, 19 Mar 2019 10:42:21 +0000 (UTC) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x2JAgJY6051319; Tue, 19 Mar 2019 05:42:19 -0500 Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x2JAgJB1105583 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Mar 2019 05:42:19 -0500 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 19 Mar 2019 05:42:18 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1713.5 via Frontend Transport; Tue, 19 Mar 2019 05:42:18 -0500 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id x2JAfxlQ019091; Tue, 19 Mar 2019 05:42:16 -0500 From: Tomi Valkeinen To: Andrzej Hajda , Laurent Pinchart , , Lucas Stach , Andrey Gusakov , Philipp Zabel , Jyri Sarha , Peter Ujfalusi , Benoit Parrot Subject: [PATCH 07/21] drm/bridge: tc358767: move video stream setup to tc_main_link_stream Date: Tue, 19 Mar 2019 12:41:00 +0200 Message-ID: <20190319104114.12077-8-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190319104114.12077-1-tomi.valkeinen@ti.com> References: <20190319104114.12077-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=1552992139; bh=LRQ6uuXI3P5Ckw+nSjXkfEM1OuTURIiUzBnH1mzwhtw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=OV9ejK44wPgexmKX+8R6G4lNmxjEstd9YbeNPMTyUsOLqsi3iBgWhF7TZ1awX/NIg Ek4xhQxQKTMFzM5JnvUE0ehPiwxFZZkHKf3TcRcSbB5pe25ebnATc/8Q6UwF3SzZux z5AomoURKiBdPbBmBPpO4MnOQ34IdVX10M8qy/NY= 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 --- 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;