From patchwork Tue May 2 01:07:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 8821 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp285073vqo; Mon, 1 May 2023 18:20:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6sXi18DnRFOWaJ/3uUnmFvVrNVr81OSYt2QnKOJTOGz4y1muo5dUUvUbt6ShN7fR9DW8+k X-Received: by 2002:a05:6a20:7d97:b0:f8:c1a:b2f6 with SMTP id v23-20020a056a207d9700b000f80c1ab2f6mr20875702pzj.49.1682990447489; Mon, 01 May 2023 18:20:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682990447; cv=none; d=google.com; s=arc-20160816; b=fiSxSM+nmaMgI8+lfsPI0wfuD+ayx3atxB+W1/MxpW6XYoPyX7sk+C/IAQGi5i7+hF cM/82ZIjHEleJXxOFjvZTVn+y0gEkuSIaFRAHnpwj4ECbgjvf6xc/qWQy2JL6sPulev1 iu9esLnTbhy8jXzuQyRWRVht6zaUj3UO+ZBx+VlvUTcjCK2HZ8tsq1vav6fgLX8ynhvj OkwRDAkwv77zrL0y2pm/Jo2TtAA2rcUlbE6GaxKZVs0dRbNfapnqUaw/wVrrz4UUS3PT cf/z2HZCtLYVMvfFyX3aQ4BaJ0zE9nALgkeOZ85NiLH2/NMqQFn3GxKFLX8d7AF/DhsQ fErA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=JWHDFN7Ujs5msRXNgIZk9qHJ9Glg+BaYPkvMRLxbY7E=; b=pJqom+4IDMA3BoCUZsEAQqVY99/BXGzP3fgV4SwNa1En6yMToWGRicRjBQwqlysDtP gUpMUPeYtC0lUL89bmFIW1zQh6aQFjK35vHEA9CaaGtSo3ul7wyWiGtxF9bgSy0azwpO YFA3FzW6E2XXGtCdsYjtwxCpAO7eLNFAxzL3fPmGq2HwhPL7+4QAC7lft3ymqGAwBK8y d9hmsmmNvQn/SzA7mh4BTIn3X9PD6jdv8551sAsz/p8PNC7f/nN2oyRLuGQt7KDPaggV ICoBrSjypOBT6JzoqUISWyYaJ8030lpr0y5K2ZWkQlU1t6prvFuz6In0/f7iVw9UeBQo RILg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=lh0V+FG7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 20-20020a630a14000000b00517f7c24664si30379496pgk.491.2023.05.01.18.20.34; Mon, 01 May 2023 18:20:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=lh0V+FG7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231610AbjEBBIP (ORCPT + 99 others); Mon, 1 May 2023 21:08:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233302AbjEBBIM (ORCPT ); Mon, 1 May 2023 21:08:12 -0400 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BB013C30 for ; Mon, 1 May 2023 18:08:08 -0700 (PDT) Received: by mail-io1-xd2c.google.com with SMTP id ca18e2360f4ac-760f5070ccfso248396639f.2 for ; Mon, 01 May 2023 18:08:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682989687; x=1685581687; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=JWHDFN7Ujs5msRXNgIZk9qHJ9Glg+BaYPkvMRLxbY7E=; b=lh0V+FG7uHRTs6DVgOJWfpgNz/OJGm/zRrYCEM8miEzWzfgNut+GnLjU/CESuAdZmv DU7zQO6fXNlyiiwRVkp7aq6cuKyUMx7m4VvwDkpiEs/wC7AhV6Bu7Isu1axKZSbeIPw3 YEzZNuXxQyxj2Wkemem/+CB9Bxle3AGEBIFwwf+6X+0M3DiOxhp9Q2Ue+69dFgkB2rJC DhQ0hZAhxs12e6NoRCULOrrpAJfr0GSRzPcWWZBnSGNK7kePayZQ3vy9tHQ+FACj7Vzg tFHKTn5RKMHBvnSzleg7bWFO13DQ2sYTV9LPx8o4UpCCiUzJASoTOBCwxfSHKp69TD2b nJJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682989687; x=1685581687; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JWHDFN7Ujs5msRXNgIZk9qHJ9Glg+BaYPkvMRLxbY7E=; b=FkKmdaS8d2raZkTGJYpJEfFed4lAoR+4ygyOVoJbnPrOV9Kb8iTwbB2wUYtqYA6rrx hn/tEYKfLY9NJRfstAA4ED6LVZOHnSquLyyeGscrzGEJsR5y2ocMcU2IYixHnxwuW1ZW 9IgszuudrOP0dFDA4kp89sv7KoZWC28uyZS0nNOZ/DhyDR9r481SLly8NEIahr2WX/2U hx/PIUofhIhCD32m+/BWBsUV5rY3egEIIipJI9E852hL/3dSMkLfzpvh3/6eHFe3DRwb LXvfOXyU+gFBGgQi8PBN8sMavjCPYlKQAcig80GfnPhAS1o9w6gf4MX+a9S/UZ6+Dajg ZxOw== X-Gm-Message-State: AC+VfDwZzhesvGRVSGhzBlH1vBPEeLyF1V92nCoJ3rid943EQM4y0Trr R1wGS/7Jvry473/YAzfmvCK/k8O/4rU= X-Received: by 2002:a6b:5c0a:0:b0:760:ec21:a8af with SMTP id z10-20020a6b5c0a000000b00760ec21a8afmr12811865ioh.0.1682989687374; Mon, 01 May 2023 18:08:07 -0700 (PDT) Received: from aford-B741.lan ([2601:447:d001:897f:8257:a536:d7fc:1919]) by smtp.gmail.com with ESMTPSA id f16-20020a056638329000b0040fb5d5429fsm4836329jav.131.2023.05.01.18.08.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 May 2023 18:08:06 -0700 (PDT) From: Adam Ford To: dri-devel@lists.freedesktop.org Cc: marex@denx.de, aford@beaconembedded.com, Adam Ford , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Inki Dae , Jagan Teki , Marek Szyprowski , linux-kernel@vger.kernel.org Subject: [PATCH V3 0/7] drm: bridge: samsung-dsim: Support variable clocking Date: Mon, 1 May 2023 20:07:52 -0500 Message-Id: <20230502010759.17282-1-aford173@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764743391353104969?= X-GMAIL-MSGID: =?utf-8?q?1764743391353104969?= This series fixes the blanking pack size and the PMS calculation. It then adds support to allows the DSIM to dynamically DPHY clocks, and support non-burst mode while allowing the removal of the hard-coded clock values for the PLL for imx8m mini/nano/plus, and it allows the removal of the burst-clock device tree entry when burst-mode isn't supported by connected devices like an HDMI brige. In that event, the HS clock is set to the value requested by the bridge chip. This has been tested on both an i.MX8M Nano and i.MX8M Plus, and should work on i.MX8M Mini as well. Adam Ford (6): drm: bridge: samsung-dsim: Fix PMS Calculator on imx8m[mnp] drm: bridge: samsung-dsim: Fetch pll-clock-frequency automatically drm: bridge: samsung-dsim: Select GENERIC_PHY_MIPI_DPHY drm: bridge: samsung-dsim: Dynamically configure DPHY timing drm: bridge: samsung-dsim: Support non-burst mode drm: bridge: samsung-dsim: Let blanking calcuation work in non-burst mode Lucas Stach (1): drm: bridge: samsung-dsim: fix blanking packet size calculation drivers/gpu/drm/bridge/Kconfig | 1 + drivers/gpu/drm/bridge/samsung-dsim.c | 150 ++++++++++++++++++++++---- include/drm/bridge/samsung-dsim.h | 5 + 3 files changed, 136 insertions(+), 20 deletions(-) Tested-by: Chen-Yu Tsai Tested-by: Marek Szyprowski Tested-by: Alexander Stein --- V3: When checking if the bust-clock is present, only check for it in the device tree, and don't check the presence of the MIPI_DSI_MODE_VIDEO_BURST flag as it breaks an existing Exynos board. Add a new patch to the series to select GENERIC_PHY_MIPI_DPHY in Kconfig otherwise the build breaks on the 32-bit Exynos. Change vco_min variable name to min_freq Added tested-by from Chen-Yu Tsai V2: Instead of using my packet blanking calculation, this integrates on from Lucas Stach which gets modified later in the series to cache the value of the HS-clock instead of having to do the calucations again. Instead of completely eliminating the PLL clock frequency from the device tree, this makes it optional to avoid breaking some Samsung devices. When the samsung,pll-clock-frequency is not found, it reads the value of the clock named "sclk_mipi" This also maintains backwords compatibility with older device trees. This also changes the DPHY calcuation from a Look-up table, a reverse engineered algorithm which uses phy_mipi_dphy_get_default_config to determine the standard nominal values and calculates the cycles necessary to update the DPHY timings accordingly.