From patchwork Thu Mar 28 17:17:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10875505 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 2AAD7925 for ; Thu, 28 Mar 2019 17:18:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03AF928B49 for ; Thu, 28 Mar 2019 17:18:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB80928BBB; Thu, 28 Mar 2019 17:18:01 +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,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5C4C828B49 for ; Thu, 28 Mar 2019 17:18:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 753436E4A2; Thu, 28 Mar 2019 17:17:59 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by gabe.freedesktop.org (Postfix) with ESMTPS id 58E2A6E4A2 for ; Thu, 28 Mar 2019 17:17:56 +0000 (UTC) Received: by mail-pl1-x644.google.com with SMTP id k2so5258112plt.3 for ; Thu, 28 Mar 2019 10:17:56 -0700 (PDT) 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=DBM+pB4CxpDj9X9ckxHYOhoSP8yGYbHTSKQhNQ0sly0=; b=PMTIel6/zt2TgAoYR9tl/72Xp92qR+0Awopvc8FLdwIBc42Ljc0mXWe4G6lBPeDHX6 Bkjpzg7dPdrrCBRyRGrhLLkONZi/X4CJ9IEs08XiJte55Zk1pasxOMlyGrHAaDlFJjkR G8civGWW4f+IUst5mowFREjaJM+sCxsYMLCmyCpSssficD8wdovDjA18B7Z2Wsgg58eW hSjEnPZcfKeALu2sZHc1vj54RbC5a0WhizTiRzdHpXcFConZk+xGoQEJtiCQE7aLPUKN owYvaKSZr7aGU6rpuGglt6esGrns8RDuJlxT2Na7+tFJ1LAb0D61/j4iaxoXw8u1x/QK 3Q/g== X-Gm-Message-State: APjAAAXRMa5h/OyTSB4epff4+gszOX3TWGULjxYwrVq+NKT3vN6+uV7F dcr1udoRsCTwcLqjqxDMHWqd8A== X-Google-Smtp-Source: APXvYqwbitXH3ctsAeFOy7juR1bSYPkUK/OS67IB2OrZTp/oTxmqvWQJISOi6pjRnGsrAkbO/dpwsg== X-Received: by 2002:a17:902:7d81:: with SMTP id a1mr36554619plm.202.1553793475964; Thu, 28 Mar 2019 10:17:55 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id r10sm31699414pfn.188.2019.03.28.10.17.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Mar 2019 10:17:55 -0700 (PDT) From: Douglas Anderson To: Thierry Reding , Heiko Stuebner , Sean Paul Subject: [PATCH v4 1/7] dt-bindings: Add panel-timing subnode to simple-panel Date: Thu, 28 Mar 2019 10:17:04 -0700 Message-Id: <20190328171710.31949-2-dianders@chromium.org> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog In-Reply-To: <20190328171710.31949-1-dianders@chromium.org> References: <20190328171710.31949-1-dianders@chromium.org> MIME-Version: 1.0 X-Mailman-Original-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=DBM+pB4CxpDj9X9ckxHYOhoSP8yGYbHTSKQhNQ0sly0=; b=Vl66ov/rhi5WwNbU6h29eVKCrE9SYA5S7w092zAxp0qnZ/RAev8buplTe4QwSImPVn Nwub8mYhk+gmVd1IoRtKYMBXyH9n00HMixzzFFTZuOQJrC/6Xr/tDLXeDyd5/yIEOwmS BxRzOyKq+0v8okUlkF8GKhwM6u+20WSF6c60M= 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: Mark Rutland , devicetree@vger.kernel.org, Rob Herring , 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 , =?utf-8?q?Enric_Balle?= =?utf-8?q?tb=C3=B2?= , =?utf-8?q?St=C3=A9phan?= =?utf-8?q?e_Marchesin?= , Ezequiel Garcia , mka@chromium.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 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 --- .../bindings/display/panel/simple-panel.txt | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Documentation/devicetree/bindings/display/panel/simple-panel.txt b/Documentation/devicetree/bindings/display/panel/simple-panel.txt index b2b872c710f2..6157f86ddce4 100644 --- a/Documentation/devicetree/bindings/display/panel/simple-panel.txt +++ b/Documentation/devicetree/bindings/display/panel/simple-panel.txt @@ -15,6 +15,18 @@ 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. The panel timings provided +here will be ignored if they are found to be outside of allowable +ranges for the given panel. + +Format information on the panel-timing subnode can be found in +display-timing.txt. + + Example: panel: panel { @@ -25,4 +37,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 Thu Mar 28 17:17:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10875507 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 9782E925 for ; Thu, 28 Mar 2019 17:18:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7283A28B49 for ; Thu, 28 Mar 2019 17:18:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66B8328BBB; Thu, 28 Mar 2019 17:18:05 +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,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A687928B49 for ; Thu, 28 Mar 2019 17:18:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 050666E4A3; Thu, 28 Mar 2019 17:18:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by gabe.freedesktop.org (Postfix) with ESMTPS id CEB646E4A2 for ; Thu, 28 Mar 2019 17:17:57 +0000 (UTC) Received: by mail-pl1-x641.google.com with SMTP id bf11so5267184plb.12 for ; Thu, 28 Mar 2019 10:17:57 -0700 (PDT) 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=aReZeTSxMM1wXIMnaZC/78auAvzmRRvwq++CtJnHKd0=; b=sA7aky5uXmAYariYG52qKKiU4Egs3W/O0N0c9T7neaCVWC714OqJ3rhHoqcllPtnc7 Ov+AwDtW6Xc9oIYVKprJUJ03upaTEFCqJRop2c2ZV6fb9w/Vss4mutJR66vZJfn02NS7 aU0EtymiYcUEfUzRw6UzJkDh4ADA8SeJmMcmVTeVIRTLYyghmhyw8XuA+i8vfVCdJ1Ec 6sd2alHpMUH1UyQhFZtFxRtZL3vUwyuaRR6MA7Q5yCsvO1opdPIMTo2AaD+Wu7ZgZUdi jHLeLr/6WZ4hsi/ci+fXO6a0mKSeIT4Q7YnJnEh6UbX1Wa5MCDFQo5SVlQyvKs106I4R Ki6g== X-Gm-Message-State: APjAAAWB3aRb3qI+pNE3PfU+CWfObqsYsJGkIBRnWGP6Dey3WQ67+8FQ Apa83qVkL2VHAirV1+IrOX04fA== X-Google-Smtp-Source: APXvYqzHLbqgE3KIJMsjZ2yyceU7G9pfXxw542LUpPg6X5c3k3vfQbEx6Y8QLsdKkFgHxF734plgGw== X-Received: by 2002:a17:902:2927:: with SMTP id g36mr16023956plb.57.1553793477320; Thu, 28 Mar 2019 10:17:57 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id r10sm31699414pfn.188.2019.03.28.10.17.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Mar 2019 10:17:56 -0700 (PDT) From: Douglas Anderson To: Thierry Reding , Heiko Stuebner , Sean Paul Subject: [PATCH v4 2/7] drm/panel: simple: Add ability to override typical timing Date: Thu, 28 Mar 2019 10:17:05 -0700 Message-Id: <20190328171710.31949-3-dianders@chromium.org> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog In-Reply-To: <20190328171710.31949-1-dianders@chromium.org> References: <20190328171710.31949-1-dianders@chromium.org> MIME-Version: 1.0 X-Mailman-Original-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=aReZeTSxMM1wXIMnaZC/78auAvzmRRvwq++CtJnHKd0=; b=K/icZPmAjbF+TUk2TvZobuzYP9E0brJqs2mBKjZ17RAIZtMXrM69njFw92rYEXetag DsWNlQW9J0fe6sRZvSi+BpBgk1xDxw0PWb47H2glbRn1D0/D5lBvBfQvDfpcug4KqQrZ WZOpi3OFUJxzqosCGo2QgbOE6VjC9qqcgMzzI= 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: devicetree@vger.kernel.org, Rob Herring , 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 , =?utf-8?q?Enric_Balle?= =?utf-8?q?tb=C3=B2?= , =?utf-8?q?St=C3=A9phan?= =?utf-8?q?e_Marchesin?= , Ezequiel Garcia , mka@chromium.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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) 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 --- 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