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: 10875523 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 4FCCA925 for ; Thu, 28 Mar 2019 17:18:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 29FDD28B49 for ; Thu, 28 Mar 2019 17:18:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D20028BBB; Thu, 28 Mar 2019 17:18:16 +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 B953028B49 for ; Thu, 28 Mar 2019 17:18:14 +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=q1cCqBXFFgtXph0kiX8ZeB18kBUkVmKP6EJmpcn1sLA=; b=og+ygOwI9g+nng u5JHusxTB+nkYd07KCAZy0szJ0/kTKbLLiQTxZ8htdwA6Jry8UHoI2dNKi0pEDIhXdXE9aKOi+E9J rKFZjNuvBopnOKiIvm7ZRODXx3Gst4bx/Otcw/fqHexW2f2Ga5UkhW6OdCkI+8eP14Nu476I+EaEN rp74xfgYUzkyMqMWBisOND7fSJ18NSBP2pAMaCbgL/m67sAa8Jj/k7Qf/VqVIkqQ0AFTUhjjJQ6qj 9EtLXFfN6OQfg/UWbsyyO6o6xsohjWXuskGBHTh+n+/f35eOtJ+KTBVIbyQGV1Vp4eK5PIlQ+taWx 4bft6yT11L9emertEJjA==; 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 1h9YfJ-0007Yw-JV; Thu, 28 Mar 2019 17:18:09 +0000 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9Yf8-0007K2-QJ for linux-rockchip@lists.infradead.org; Thu, 28 Mar 2019 17:18:03 +0000 Received: by mail-pl1-x644.google.com with SMTP id g37so5257451plb.5 for ; Thu, 28 Mar 2019 10:17:58 -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=aReZeTSxMM1wXIMnaZC/78auAvzmRRvwq++CtJnHKd0=; b=K/icZPmAjbF+TUk2TvZobuzYP9E0brJqs2mBKjZ17RAIZtMXrM69njFw92rYEXetag DsWNlQW9J0fe6sRZvSi+BpBgk1xDxw0PWb47H2glbRn1D0/D5lBvBfQvDfpcug4KqQrZ WZOpi3OFUJxzqosCGo2QgbOE6VjC9qqcgMzzI= 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=nSo3ZrgK63z4aDsnVlWkS7NdYmn0n6XFEQlS41e0fmym/2VQuCbRvWSe2cqFprLPF0 tAuDSoBWqmal2vrAt+6U9Hil/Z3krlduQmxAjxjZDKgWNzm9EXODJ2hbAN20Tewytt9i DJmBc8Y/WsARWuNl2AmYi9FSAZ5d2KRKxYeHvVOLleZl4zhNWN+YFmMFzq1kgN7RdG3B NA1+9Ep0diLkFc0EHZ9D7ZZKYXcoYrh2RY99GMWx08VZcw27Ruy00wl4lVlE8h6Llh1S TcYDcdtGUhpc6+5ll/evUDX6lXStNTID4qRTMvL73UQ+f9iR5RkcquqHJ/1uduVv52K7 I/5w== X-Gm-Message-State: APjAAAVQmtJQ0tICFsoBPe1LOucmT3YFbl/RecUYwjh3y3eZNDQBiOJc HyN1x+HRazJ71d1pukiqZtgEeg== 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190328_101758_874139_3B195AB0 X-CRM114-Status: GOOD ( 21.83 ) 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) 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