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: 10880371 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 B2666139A for ; Mon, 1 Apr 2019 17:18:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E9E4287FA for ; Mon, 1 Apr 2019 17:18:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C7C0288AD; Mon, 1 Apr 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 DDBC5288A0 for ; Mon, 1 Apr 2019 17:18:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 879A16E6C8; Mon, 1 Apr 2019 17:17:56 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by gabe.freedesktop.org (Postfix) with ESMTPS id 655766E6CA for ; Mon, 1 Apr 2019 17:17:55 +0000 (UTC) Received: by mail-pl1-x642.google.com with SMTP id ck15so3609396plb.3 for ; Mon, 01 Apr 2019 10:17:55 -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=qCuthoMNLE7oG5BcFr/VLQrstKVLsbG6o5veAgiYBjM=; b=hGzM4WSR1S8m3hqk2NOj5odr3bTwBErqM8kHJCq5E9QO5Jt2UYou2u8hMcsVzpYK7C f6OMEJUbdd3PFB5HYovNIYtrVvFTxYZZHOASzjJr8CBQ00x3NNOZCG9gS0j4/YtcNHYI wq75yY23kZDWeF4OdgkcOWV9s86PeS7LXPb2RkdXXEmqniLdro1Qh56Od/5weWBCROZE 51stPa8fUaQ5QgZhnG78kgSjxWoKq7Izf+e/hPtf5e1BRKann6ZRV54rbNrIvyMJvGkf gnBEGOzc9r8731vLp1+a3P8/bkkOr914YNOpj2uAZmg4APb5tTDwLWqIXElrCEfW7VR+ YP1w== X-Gm-Message-State: APjAAAUuELU5E3bDEF9YZ/GnFA5U1ENtGbTs3RNfoPnz1bdOjM62Rk0F xas9o3HrCFYymAvfXQ4cUjQM2g== 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-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=qCuthoMNLE7oG5BcFr/VLQrstKVLsbG6o5veAgiYBjM=; b=BeuxmBL7asgMN0dyz2ZltyV09uNTnzdrlVM412Q/FIANNWRzhPAoWj2LVD+pyPkZEs 5JAnL8SkKQv5hH7QHqzqg/zQFjeWiR/Tk2GaloGFlFeLQIBhRtzk+btrXgs3fAiikeDI jLccwbmAkLIwQsyARd+mbOdBSW6omtP8CuJ2E= 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) 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