From patchwork Mon Apr 1 17:17:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10880385 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2BF03139A for ; Mon, 1 Apr 2019 17:18:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 093542237D for ; Mon, 1 Apr 2019 17:18:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07A6C288AE; Mon, 1 Apr 2019 17:18:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 82AD02889C for ; Mon, 1 Apr 2019 17:18:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NIeQBb0sAC/5ryQimk4SlEaMoKORAT1QUE6AU8j9LJI=; b=qDCc0tWZ7+UBEv HYZhBh+jskIb4/De0lLLkClR7dcu0qYvoOBGsvTBza4eL0ctpTuSKNJkdf6Rrkxd+erysVtPmadY6 MbnlXuv17EangZItAcdHY6L6PArqzHSvJaJuI0HV4V+XpCQqIZQ6meYleRuwQr/E4FaML3REM+z0E XbMdSVVMK0QlMVCCQPZ1E6V/wSmOojG6MVk131OMXOZ5/QNMJaiPjJ9N6ytb3no89LK81Ei51SOCC WCMGLUphGlxPK6Fio1k9AssmZBpqavS6g74kkPDXUXeURzyxZU2a2GCxU7t0MoEHsvFEizYKNR9A3 e/GyHdaf0a9PDAJ5rNjA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hB0ZR-0004MV-3e; Mon, 01 Apr 2019 17:18:05 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hB0ZF-00048V-LC for linux-rockchip@lists.infradead.org; Mon, 01 Apr 2019 17:17:55 +0000 Received: by mail-pl1-x643.google.com with SMTP id y6so4825409plt.1 for ; Mon, 01 Apr 2019 10:17:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=glsr5s+XdI5E8OElKXrSOhJG5EzpWyBtwSQUCs3zmgY=; b=TcX442vkjfWQpxQC70BHgRkRbkU2/tJqvgUdcir+UEaQiLz9977Gd3m+QPVVBaVLK0 1xQ7lajs0jQFLxCMjF5ayNeGMo055Fw0EOLamNSmSsMj4tnG/ucDbGqlNaVk4Gkpmspl zprv+7Il9sh3cfyfLV2wRaP5h+TCH5jVle6to= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=glsr5s+XdI5E8OElKXrSOhJG5EzpWyBtwSQUCs3zmgY=; b=fzkhoHzBCfeumPLUfLJZO1zXeuo1uIgNu2B9X2HzkylCAddwxZPi9NuvmeeGwrBqB9 iZgw8xTBljXK2AFtJMA+Q3HW8BLifjUEkaZxfcJiXhverdz8eWL61fGrCGOOJODyc4lv 3HFlupCqC9MJmi+ApwmGAIthY1khjaj5J2d+cZQB6iVHswDA705fTfPa3dtOPlSci3mc knz4UZKBca3TtaX5K2kMKjdftLYkQMY2C2mJ3yzUUXF7pqC1fsewVpWqB7cdZgqueFH2 RtL8u62eWsFOoCOyW1evDdsyqewG+YgTl3XKIy9Q1ekWNODYz8tWrp0eaJiXPKzITQHg u9+Q== X-Gm-Message-State: APjAAAW28HtN8f8Vfg/lVsPiyY4yImYf/StIABUapsdieZcQJw6egHHQ CucgG29BNFXiwu7zpHEfVewcLw== X-Google-Smtp-Source: APXvYqx7wUIzLLe7Nyc479/ioHCQ6EnzrtmezVmxgg8KZIhRgA3BwDqQ/+5CWD1TGc3ev+3Aa0LIPg== X-Received: by 2002:a17:902:e508:: with SMTP id ck8mr3655525plb.96.1554139073184; Mon, 01 Apr 2019 10:17:53 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id y12sm31370112pgq.64.2019.04.01.10.17.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Apr 2019 10:17:52 -0700 (PDT) From: Douglas Anderson To: Thierry Reding , Heiko Stuebner , Sean Paul Subject: [PATCH v5 1/7] dt-bindings: Add panel-timing subnode to simple-panel Date: Mon, 1 Apr 2019 10:17:18 -0700 Message-Id: <20190401171724.215780-2-dianders@chromium.org> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog In-Reply-To: <20190401171724.215780-1-dianders@chromium.org> References: <20190401171724.215780-1-dianders@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190401_101753_690057_36509C00 X-CRM114-Status: GOOD ( 15.25 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Rob Herring , Eric Anholt , David Airlie , Jeffy Chen , Doug Anderson , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Boris Brezillon , Laurent Pinchart , Daniel Vetter , =?utf-8?q?Enric_Balletb=C3=B2?= , =?utf-8?q?S?= =?utf-8?q?t=C3=A9phane_Marchesin?= , Ezequiel Garcia , mka@chromium.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sean Paul This patch adds a new subnode to simple-panel allowing us to override the typical timing expressed in the panel's display_timing. Changes in v2: - Split out the binding into a new patch (Rob) - display-timings is a new section (Rob) - Use the full display-timings subnode instead of picking the timing out (Rob/Thierry) Changes in v3: - Go back to using the timing subnode directly, but rename to panel-timing (Rob) Changes in v4: - Simplify desc. for when override should be used (Thierry/Laurent) - Removed Rob H review since it's been a year and wording changed Changes in v5: - Removed bit about OS may ignore (Rob/Ezequiel) Cc: Doug Anderson Cc: Eric Anholt Cc: Heiko Stuebner Cc: Jeffy Chen Cc: Rob Herring Cc: Stéphane Marchesin Cc: Thierry Reding Cc: devicetree@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: linux-rockchip@lists.infradead.org Signed-off-by: Sean Paul Signed-off-by: Douglas Anderson Reviewed-by: Rob Herring Reviewed-by: Boris Brezillon Acked-by: Thierry Reding --- .../bindings/display/panel/simple-panel.txt | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Documentation/devicetree/bindings/display/panel/simple-panel.txt b/Documentation/devicetree/bindings/display/panel/simple-panel.txt index b2b872c710f2..93882268c0b9 100644 --- a/Documentation/devicetree/bindings/display/panel/simple-panel.txt +++ b/Documentation/devicetree/bindings/display/panel/simple-panel.txt @@ -15,6 +15,16 @@ Optional properties: (hot plug detect) signal, but the signal isn't hooked up so we should hardcode the max delay from the panel spec when powering up the panel. +panel-timing subnode +-------------------- + +This optional subnode is for devices which require a mode differing +from the panel's "typical" display timing. + +Format information on the panel-timing subnode can be found in +display-timing.txt. + + Example: panel: panel { @@ -25,4 +35,16 @@ Example: enable-gpios = <&gpio 90 0>; backlight = <&backlight>; + + panel-timing { + clock-frequency = <266604720>; + hactive = <2400>; + hfront-porch = <48>; + hback-porch = <84>; + hsync-len = <32>; + vactive = <1600>; + vfront-porch = <3>; + vback-porch = <120>; + vsync-len = <10>; + }; }; From patchwork Mon Apr 1 17:17:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10880387 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DC59A1800 for ; Mon, 1 Apr 2019 17:18:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B5BC02887B for ; Mon, 1 Apr 2019 17:18:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B308C287FA; Mon, 1 Apr 2019 17:18:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0F6D62887B for ; Mon, 1 Apr 2019 17:18:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6WPDqNV9I60HgA0zRwSLsRBZS0PqULJDFyhg/zO8Gpk=; b=P6HlbqihOube9B hsqtxIsxoQk2H9LweeMpKh1beDkp5Vs5Qi3Fged6VhI2ZyDf2mpQpjuaFskuTO5CMXDjsiCxgEbhx SSU5+nurBVYkBQKyixMMkVoFWD718XkRf4y9Mtc1sQunVtGc5MK1YFt+wzLPZMwzB5KuZNuhHAker OXvOlLmyvx5H/sika418zoMbIzW6biB6+zx4GRQb3F55nwmaKEdxweBBDQV3zYg8OaqmtPPaoUIbD JCdAxc1y/UBfjgCJRzpQeaT0IK2YMIwVzzFcFXedgAt0EJlRzlaMmrxifTvbTv1q3+D9BvtnTay2g 40sWQLWveJOQfGBhJO/w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hB0ZS-0004OW-OW; Mon, 01 Apr 2019 17:18:06 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hB0ZH-00049G-Em for linux-rockchip@lists.infradead.org; Mon, 01 Apr 2019 17:17:57 +0000 Received: by mail-pl1-x643.google.com with SMTP id y6so4800559pll.13 for ; Mon, 01 Apr 2019 10:17:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qCuthoMNLE7oG5BcFr/VLQrstKVLsbG6o5veAgiYBjM=; b=BeuxmBL7asgMN0dyz2ZltyV09uNTnzdrlVM412Q/FIANNWRzhPAoWj2LVD+pyPkZEs 5JAnL8SkKQv5hH7QHqzqg/zQFjeWiR/Tk2GaloGFlFeLQIBhRtzk+btrXgs3fAiikeDI jLccwbmAkLIwQsyARd+mbOdBSW6omtP8CuJ2E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qCuthoMNLE7oG5BcFr/VLQrstKVLsbG6o5veAgiYBjM=; b=TafLl60RFCABroHDCOBa368pNxNyVHdJoixcAHREGv5tdTW05sW3+fHSNFphz3Eupl EcytJ3ZMAt5uHzcMC+fljI9KuUGp+At6njz39f6phweKnGLwgkWsU/CccGDzbr3HhBqm 2Jepf8bpX5tzKIdyhimxZIKHZX15rPTKDC7CcDpLQmJbu1bXcpnZt2qTqfjKvrL+ZU7p uaniTt1xrt255rbk6dCj0UfGanVBOIQhSCFUwmbbp83M6/yzTWYYmWKDFHZvMCz9w9pT rI10LYUPQu22Fmy6FzVbNYN7lmvmuvYF2/fvf1JRgfDTq40FdJ4lhpv7ev0JGkGiymnY tklQ== X-Gm-Message-State: APjAAAUGydd9RoBVHEQwI2PdbGrh37PVpBkYNxu0D694GSwDP7QWOauH dvJdJDQ32Nb1p4kunLBkSrgDwA== X-Google-Smtp-Source: APXvYqwarIcoctYERt192q6UgAo80DnvoKyoR+ep7xtU5CxnXWO+8jwnxPLBPxi0DiXXn5ekghGk2Q== X-Received: by 2002:a17:902:b43:: with SMTP id 61mr64908196plq.83.1554139074921; Mon, 01 Apr 2019 10:17:54 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id y12sm31370112pgq.64.2019.04.01.10.17.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Apr 2019 10:17:53 -0700 (PDT) From: Douglas Anderson To: Thierry Reding , Heiko Stuebner , Sean Paul Subject: [PATCH v5 2/7] drm/panel: simple: Add ability to override typical timing Date: Mon, 1 Apr 2019 10:17:19 -0700 Message-Id: <20190401171724.215780-3-dianders@chromium.org> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog In-Reply-To: <20190401171724.215780-1-dianders@chromium.org> References: <20190401171724.215780-1-dianders@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190401_101755_500152_E9E2B90F X-CRM114-Status: GOOD ( 22.64 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Rob Herring , Eric Anholt , David Airlie , Jeffy Chen , Doug Anderson , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Boris Brezillon , Laurent Pinchart , Daniel Vetter , =?utf-8?q?Enric_Balletb=C3=B2?= , =?utf-8?q?S?= =?utf-8?q?t=C3=A9phane_Marchesin?= , Ezequiel Garcia , mka@chromium.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sean Paul This patch adds the ability to override the typical display timing for a given panel. This is useful for devices which have timing constraints that do not apply across the entire display driver (eg: to avoid crosstalk between panel and digitizer on certain laptops). The rules are as follows: - panel must not specify fixed mode (since the override mode will either be the same as the fixed mode, or we'll be unable to check the bounds of the overried) - panel must specify at least one display_timing range which will be used to ensure the override mode fits within its bounds Changes in v2: - Parse the full display-timings node (using the native-mode) (Rob) Changes in v3: - No longer parse display-timings subnode, use panel-timing (Rob) Changes in v4: - Don't add mode from timing if override was specified (Thierry) - Add warning if timing and fixed mode was specified (Thierry) - Don't add fixed mode if timing was specified (Thierry) - Refactor/rename a bit to avoid extra indentation from "if" tests - i should be unsigned (Thierry) - Add annoying WARN_ONs for some cases (Thierry) - Simplify 'No display_timing found' handling (Thierry) - Rename to panel_simple_parse_override_mode() (Thierry) Changes in v5: - Added Heiko's Tested-by Cc: Doug Anderson Cc: Eric Anholt Cc: Heiko Stuebner Cc: Jeffy Chen Cc: Rob Herring Cc: Stéphane Marchesin Cc: Thierry Reding Cc: devicetree@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Sean Paul Tested-by: Enric Balletbo i Serra Signed-off-by: Douglas Anderson Tested-by: Heiko Stuebner Reviewed-by: Boris Brezillon Acked-by: Thierry Reding --- drivers/gpu/drm/panel/panel-simple.c | 109 +++++++++++++++++++++++++-- 1 file changed, 104 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 9e8218f6a3f2..ad4f4aac2d44 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -34,6 +34,7 @@ #include #include