Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3696186pxb; Mon, 24 Jan 2022 15:37:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJyldl8SrveFV4845l2M7+45q2jW05NYLTOLf6Mfy6gOzw0aT9C3KkxaEH98z6YGVka8rHJg X-Received: by 2002:a17:903:245:b0:149:d2a3:ddbf with SMTP id j5-20020a170903024500b00149d2a3ddbfmr16407167plh.3.1643067452115; Mon, 24 Jan 2022 15:37:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643067452; cv=none; d=google.com; s=arc-20160816; b=Sj70q0QfSn5MnzqiKWd+sDoa5p9mFKP+YasJYaFRC5lY6YBKVGRX7YKGP6wIYO09nS W3KNXMlzwLK2nhZwkM6BpW/7FQoHj9+P9C9qT8jgumSVntc9s8aHncxhF4jadNSFJZFE 7jqmovy37gErhAsNN2ROLqkUAW6IQHFtvGUPxP6ax+0RYAIDubxs7NcvfE3wm9l8KMmZ BaKkCirLGYMJFg/KqqYXGycMZzOFQQvD7d5+O2SD36zb/NHuE/PNXfjde/y+fitDz0xN B37pN+ABJuQnzh4Q+tUcIgrZrj2q6wADzScQfISZtRf+mS/vTo19tM08MKrHg6z46D+y oXrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ot90uK82M2NTnkmca5b+4MnkbhM9xHVODC8W+leMm3c=; b=zRI02K+meDnQIIbYo71oStXGbSa+IXbeB7n1I7pqo/90B4PWgpRhiJk7lHmHqaJ3xH W39/yS63bSuF/mTH702Fw4SWEeNde1xSm1/W8bIoT4nyDe3O3eEZNCHTMmb6/hMh6BXV l7gVMKouwVhFmoHFbI6MYWnZ1LlmSaCyDi2Vw8FouIxzU9JzGms0KbqKc9XhjoPJ4AKO BbsH54Wek5dasOUKbzMTi28vT+zQ//aF4mM1dZ3r8dWqACUdIraApWbknzbxy99MVAp6 tUL1fVu4INrUp5Sb1ShgPzW8qTWnL4PXdBZrT33IUw9M6FLn9yOjW+kcTR2cyK7akuBf PSRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZIoWWWW+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bf11si14032904plb.56.2022.01.24.15.37.20; Mon, 24 Jan 2022 15:37:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZIoWWWW+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2359595AbiAXXc5 (ORCPT + 99 others); Mon, 24 Jan 2022 18:32:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1837008AbiAXWli (ORCPT ); Mon, 24 Jan 2022 17:41:38 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FAB0C04D634; Mon, 24 Jan 2022 13:04:33 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0F3766131F; Mon, 24 Jan 2022 21:04:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D67FEC340E5; Mon, 24 Jan 2022 21:04:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058272; bh=ZqBpEma6EwjEHMM+OJMZD2VLNm0DVB11FAv/b+XM+VI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZIoWWWW+QynyPW/YfLmshqn5OLP7kG7JxFC7sEtjIvOEshJAaAVQ+te4YGrKII+7I 8jFF+B50vSanenz8HGrNvWKFctF/aJ+aMKs28Zv96PKR+KY6afUWtYr/g1M/DCk8nD g0z+HXdqFF6UpVEAqUr1bd4YLECuUYS31/j1mVIo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kieran Bingham , Laurent Pinchart , Laurent Pinchart , Sasha Levin Subject: [PATCH 5.16 0236/1039] drm: rcar-du: crtc: Support external DSI dot clock Date: Mon, 24 Jan 2022 19:33:45 +0100 Message-Id: <20220124184133.246171168@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kieran Bingham [ Upstream commit 57b290cb905bec520372ac635d9e9f0548d9d67e ] On platforms with an external clock, both the group and crtc must be handled accordingly to correctly pass through the external clock and configure the DU to use the external rate. The CRTC support was missed while adding the DSI support on the r8a779a0 which led to the output clocks being incorrectly determined. Ensure that when a CRTC is routed through the DSI encoder, the external clock is used without any further divider being applied. Fixes: b291fdcf5114 ("drm: rcar-du: Add r8a779a0 device support") Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart Signed-off-by: Sasha Levin --- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c index 5672830ca184d..5236f917cc68d 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c @@ -261,12 +261,13 @@ static void rcar_du_crtc_set_display_timing(struct rcar_du_crtc *rcrtc) rcar_du_group_write(rcrtc->group, DPLLCR, dpllcr); escr = ESCR_DCLKSEL_DCLKIN | div; - } else if (rcdu->info->lvds_clk_mask & BIT(rcrtc->index)) { + } else if (rcdu->info->lvds_clk_mask & BIT(rcrtc->index) || + rcdu->info->dsi_clk_mask & BIT(rcrtc->index)) { /* - * Use the LVDS PLL output as the dot clock when outputting to - * the LVDS encoder on an SoC that supports this clock routing - * option. We use the clock directly in that case, without any - * additional divider. + * Use the external LVDS or DSI PLL output as the dot clock when + * outputting to the LVDS or DSI encoder on an SoC that supports + * this clock routing option. We use the clock directly in that + * case, without any additional divider. */ escr = ESCR_DCLKSEL_DCLKIN; } else { -- 2.34.1