Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1501500rdb; Thu, 7 Dec 2023 00:18:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IE50YKOl/WZom7SntttdgpDX6YFRR0BEhlYr0ZzNevxb7ukWIuVLEYm2elEc0z3t8uWKcbZ X-Received: by 2002:a05:6870:2193:b0:1fb:75b:2bae with SMTP id l19-20020a056870219300b001fb075b2baemr2080989oae.106.1701937119082; Thu, 07 Dec 2023 00:18:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701937119; cv=none; d=google.com; s=arc-20160816; b=ft6R7+1z03rr71IfBNmZKVLKhLs42sSgMeHkUmKnrPOksjp12ANFBmou+cx3pNC+o4 YNzxeWPmWwnDOpyy58GgExSrt6OR6VW8EP9APiyRCemLjQPSBA1ZpMGnC80BFmWQCqrp 6BHp9hz+5zSiuF0pXs0WLA4mXyY7jLMGDY6YBBxzsyy4xI85imVlxUYgn2CVpUz2NJrv I3T0HnQDg9ueGpclifCzRN+GjMiJO/PuKr02PpyTepto0ucduuYFWksIwJpMa0N0RqqC 0Rj+T2iP3/1x0DUbgOhJ5tS3wqZ3K1wmcX8Ij/R1u+J0sWyy3Y697lCK3VY5+9bs8DTz rG2A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ZQJWnhNLnP6Awp7NjFB9t/P5znClGB7Yq+APmm7pGdg=; fh=UKhxFVXTmA/MSyUXE1AIYhOw+Kx1RJNNQTH/EivPAO8=; b=TxU3M3aTTiaGIAy/mPouQcm4tIdT+6XYxPXP7f5NAuQdCddvSSg8zrG+eR9Q9w6RBX qNfAIKJ+NoJQarQfD8qrIJmluz/ZQkZOw2qAUlRX3AputEYJ0pH4jVLPLnrkLgESoATH qmPOBp/NfA7RSvYvqYmJ8MXRzaCtE1I69fyRRMn+Vis84RqCkVv15CkL2V8NRGPNKIDb ubWg7R369t2SRDknnDxtwRMLASAwCw6280YGi2zUfq1Dq/KSTU8unG6fHhM9ca/Xbgue Dfa5ehx6jJ6YIxb98QnAazuvNowFIuUIRqAGQC8X5s8uzeS92x4idt+jhjV/zKIZsRo6 tJ0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LjBLuoAP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id j7-20020a654287000000b005bdf5961d87si752735pgp.266.2023.12.07.00.18.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 00:18:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LjBLuoAP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id CA15F808A975; Thu, 7 Dec 2023 00:18:35 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378106AbjLGISO (ORCPT + 99 others); Thu, 7 Dec 2023 03:18:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377935AbjLGISL (ORCPT ); Thu, 7 Dec 2023 03:18:11 -0500 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E986DD for ; Thu, 7 Dec 2023 00:18:18 -0800 (PST) Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1d06d42a58aso5577895ad.0 for ; Thu, 07 Dec 2023 00:18:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1701937097; x=1702541897; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZQJWnhNLnP6Awp7NjFB9t/P5znClGB7Yq+APmm7pGdg=; b=LjBLuoAPssi8cIJ+gHtc/QTgghFzaPFPz/1C1dFBW5qOcwglHbr6kTRwkOitD8g9Qt cBZccDzwhfyPjGw6wkpE9/A1Y9U8L5A8+BwhrCBjime8mhmoWKrs/jjEwQWraijPmEBi QPzMSgWG4eFx3bnCXI2YRJT2fArLKrxU0wLas= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701937097; x=1702541897; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZQJWnhNLnP6Awp7NjFB9t/P5znClGB7Yq+APmm7pGdg=; b=FMP3NT8ftGHwdgYN9nN3fCxkVPwZf/MhVyWkc/f4+/dhNQuK7MUxbBKCUFsJsry82l 9G5P9U8TDDB6bR12Pb+cWwvHAiYOO6UF2SkyrqQj8Jkk0yttdiK1ZBDZ43dfGkWVsNkp t4cErjXIaPlW/krYsLP39RPIivSo+wnidfuQnEG6y63JuV+lULRIByOGBvlfrLusu44e ZLujGJbzhT0zsEjZWnn+1n8CzD9NgLNJuVAwmVvA9vJByq8MUSYCoict9XdUnieIOtPP liN+erBQ9CHrKIjiDE48jt5Ucmb0plFSmtqSHwwmXMXftuibyO1UZ8Eq/p6G+3E6ac8I xiiw== X-Gm-Message-State: AOJu0YzkgrWZsinbf8nYNbEIqSSytGwHIwvAg9mQFsQaSW55joAf09kG kQ1TcTxEbWZHA0jn8DLR53pOJw== X-Received: by 2002:a17:902:dac5:b0:1d1:d939:159 with SMTP id q5-20020a170902dac500b001d1d9390159mr1890437plx.21.1701937097547; Thu, 07 Dec 2023 00:18:17 -0800 (PST) Received: from treapking.tpe.corp.google.com ([2401:fa00:1:10:663f:6f8e:5f2d:e06c]) by smtp.gmail.com with ESMTPSA id t23-20020a1709028c9700b001d09c5424d4sm748128plo.297.2023.12.07.00.18.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 00:18:17 -0800 (PST) From: Pin-yen Lin To: Douglas Anderson , Neil Armstrong , Jessica Zhang , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: linux-kernel@vger.kernel.org, Guenter Roeck , dri-devel@lists.freedesktop.org, Pin-yen Lin Subject: [PATCH v2 2/4] drm/panel-edp: Add powered_on_to_enable delay Date: Thu, 7 Dec 2023 16:17:36 +0800 Message-ID: <20231207081801.4049075-3-treapking@chromium.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231207081801.4049075-1-treapking@chromium.org> References: <20231207081801.4049075-1-treapking@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 07 Dec 2023 00:18:35 -0800 (PST) Add the support of powered_on_to_enable delay as the minimum time that needs to have passed between the panel powered on and enable may begin. This delay is seen in BOE panels as the minimum delay of T3+T4+T5+T6+T8 in the eDP timing diagrams. Signed-off-by: Pin-yen Lin --- (no changes since v1) drivers/gpu/drm/panel/panel-edp.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c index a0b6f69b916f..44acf9cacaf7 100644 --- a/drivers/gpu/drm/panel/panel-edp.c +++ b/drivers/gpu/drm/panel/panel-edp.c @@ -70,6 +70,21 @@ struct panel_delay { */ unsigned int hpd_absent; + /** + * @powered_on_to_enable: Time between panel powered on and enable. + * + * The minimum time, in milliseconds, that needs to have passed + * between when panel powered on and enable may begin. + * + * This is (T3+T4+T5+T6+T8)-min on eDP timing diagrams or after the + * power supply enabled until we can turn the backlight on and see + * valid data. + * + * This doesn't normally need to be set if timings are already met by + * prepare_to_enable or enable. + */ + unsigned int powered_on_to_enable; + /** * @prepare_to_enable: Time between prepare and enable. * @@ -216,6 +231,7 @@ struct panel_edp { bool prepared; ktime_t prepared_time; + ktime_t powered_on_time; ktime_t unprepared_time; const struct panel_desc *desc; @@ -455,6 +471,8 @@ static int panel_edp_prepare_once(struct panel_edp *p) gpiod_set_value_cansleep(p->enable_gpio, 1); + p->powered_on_time = ktime_get_boottime(); + delay = p->desc->delay.hpd_reliable; if (p->no_hpd) delay = max(delay, p->desc->delay.hpd_absent); @@ -579,6 +597,8 @@ static int panel_edp_enable(struct drm_panel *panel) panel_edp_wait(p->prepared_time, p->desc->delay.prepare_to_enable); + panel_edp_wait(p->powered_on_time, p->desc->delay.powered_on_to_enable); + p->enabled = true; return 0; -- 2.43.0.472.g3155946c3a-goog