Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1030313pxb; Wed, 1 Sep 2021 15:45:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzVBi6B0IR698vOlAW5XGhRhjJQc0cYbeJGxWeB+PW6GCCJkPctDO0u8TH+5JVsAXJrSGv X-Received: by 2002:a17:906:314e:: with SMTP id e14mr194731eje.165.1630536354500; Wed, 01 Sep 2021 15:45:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630536354; cv=none; d=google.com; s=arc-20160816; b=0I4yXXI1fzk4Rhst9t99ooUQZtAUsQeCa0US/QJowOg3zPsphCHNyh/oFE9pw5Xkpe iV2CqayWsrBhiZzIZRQ+es81BRo8dJjc31Fv0RlGL9BjfXCnaEwRNdVxKsHigXQFsHvP Wak1qPPpAiOwbjC7TzqG/Cj7BqTJ+WFuOHy81inFFCN8qQDr4qlca7XMu/R8FqKBXXQj 1zY04aba7s8s1p2OuiODYggQJ9EGSm5u6YvMGjSwKLXQFdZCCV+GlWAvpY2qIjXVjUKa ScAq26Ggj+gfQjS9f5F1Nf7gDZeJNnErNirPDUmup35z9u9oAU1wD9+vWZU8TeOCOiI0 Cm7g== 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=i1im4UHDwHD6p4GzCZKCTDP08FtYCagwzpu+zQ6nqGs=; b=nvCpB3MWCvVlB5w97lZKMg3WKCP2zjtPXTpnwdPUAoagjqrEdvEVkVaVKtBAa8WyIt o2bQOqthMvMNoWqSdyoZAGDSkmQDRps0FwwKgJHqz1N/P3uv1UUMOiRTqfOYUMfoLuSc PctXBEL3fdqfT5DbNskJeQqj4cWwNyMYd7j/1JArn1Ksa5dA5/KPu4dYpPKr5h5eOweO 0DaM2B8/1UvO6B2p8ueHMPlACdO5wSh3/DF67Ajzl+V2K3bV/uSL5A6OI9paqHBYy+cT IDJTf6iBenonbXffHlOM+90d8NlOYuXDzrjTOfPhzy7afg2IzMSyNNfMsb85feaqFwLQ b7rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TgW3NsTc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id js1si1211587ejc.712.2021.09.01.15.45.30; Wed, 01 Sep 2021 15:45:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TgW3NsTc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344618AbhIAUWS (ORCPT + 99 others); Wed, 1 Sep 2021 16:22:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344169AbhIAUVp (ORCPT ); Wed, 1 Sep 2021 16:21:45 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 554BDC061796 for ; Wed, 1 Sep 2021 13:20:48 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id mw10-20020a17090b4d0a00b0017b59213831so582333pjb.0 for ; Wed, 01 Sep 2021 13:20:48 -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=i1im4UHDwHD6p4GzCZKCTDP08FtYCagwzpu+zQ6nqGs=; b=TgW3NsTcvZmbZZko0YfccImopgwbwJhLn6VtdSQluJDIfiZcuYN6vHKXuYOmLPoxyI I1yTs3QqXNt16PslnBtBmvHR6rHO1wAiCe9d/h5pJdf4P6g2F1kCds79KeRYv7/HkdRt iSF66yUHBQWRb7Ex3kyRNAtQCxg4RqQIKT6Rc= 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=i1im4UHDwHD6p4GzCZKCTDP08FtYCagwzpu+zQ6nqGs=; b=MenRszJGP4IPB+fi6sn+6cLwcnSPMJWlp6FSn5oM075wHMtNZBY9GNKjojMy5PBpur DtEhfAn3ph+z75SDRLTx7GMaicS7dDOusVAgHKBsidqNLnEeg9CQFLDhlm4eL15ppjTp i9e77VdkQAgDkrSWfHZ8XhgW+XXxDGCmqHPtYzaPvmz8cgnFXPkN2TnZfamgsPT7cNym QIBkeE9lGRwVwV9KrrHiyNHkPqgRI4E77uwF4uCiS7U9MaR74LLReUxE0g1BCaUeUdl8 cgrfC4IVlf6/6S/lERV/zZJ0JIvLIPI6YTLsFXfSAjcOTsgVRK2dQ9mrz5Aw6HoBJV0L PwcA== X-Gm-Message-State: AOAM531hAPOxwzlLiE8f+sWt74jB9TeuTRTJV8SRH1enavlxXWYjRiNF 5HRlUA03ibR8tf6QDMb0VA8ySRZFcZrI5w== X-Received: by 2002:a17:902:bb92:b0:12d:ad99:7fb6 with SMTP id m18-20020a170902bb9200b0012dad997fb6mr1149518pls.49.1630527647868; Wed, 01 Sep 2021 13:20:47 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:201:958b:b561:a735:e774]) by smtp.gmail.com with ESMTPSA id x15sm321178pfq.31.2021.09.01.13.20.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Sep 2021 13:20:47 -0700 (PDT) From: Douglas Anderson To: Thierry Reding , Rob Herring , Sam Ravnborg Cc: Maarten Lankhorst , linux-arm-msm@vger.kernel.org, Bjorn Andersson , Linus W , Daniel Vetter , devicetree@vger.kernel.org, Steev Klimaszewski , Thomas Zimmermann , Maxime Ripard , David Airlie , dri-devel@lists.freedesktop.org, Douglas Anderson , linux-kernel@vger.kernel.org Subject: [PATCH v3 11/16] drm/panel-simple-edp: Split the delay structure out Date: Wed, 1 Sep 2021 13:19:29 -0700 Message-Id: <20210901131531.v3.11.I24f3646dd09954958645cc05c538909f169bf362@changeid> X-Mailer: git-send-email 2.33.0.259.gc128427fd7-goog In-Reply-To: <20210901201934.1084250-1-dianders@chromium.org> References: <20210901201934.1084250-1-dianders@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the case where we can read an EDID for a panel the only part of the panel description that can't be found directly from the EDID is the description of the delays. Let's break the delay structure out so that we can specify just the delays for panels that are detected by EDID. This is simple code motion. No functional change is intended. Signed-off-by: Douglas Anderson --- Changes in v3: - Split the delay structure out patch just on eDP now. drivers/gpu/drm/panel/panel-simple-edp.c | 159 ++++++++++++----------- 1 file changed, 82 insertions(+), 77 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple-edp.c b/drivers/gpu/drm/panel/panel-simple-edp.c index 8acac5bb792e..d227adba92ec 100644 --- a/drivers/gpu/drm/panel/panel-simple-edp.c +++ b/drivers/gpu/drm/panel/panel-simple-edp.c @@ -40,6 +40,87 @@ #include #include +/** + * struct panel_delay - Describes delays for a simple panel. + */ +struct panel_delay { + /** + * @prepare: Time for the panel to become ready. + * + * The time (in milliseconds) that it takes for the panel to + * become ready and start receiving video data + */ + unsigned int prepare; + + /** + * @hpd_absent_delay: Time to wait if HPD isn't hooked up. + * + * Add this to the prepare delay if we know Hot Plug Detect + * isn't used. + */ + unsigned int hpd_absent_delay; + + /** + * @prepare_to_enable: Time between prepare and enable. + * + * The minimum time, in milliseconds, that needs to have passed + * between when prepare finished and enable may begin. If at + * enable time less time has passed since prepare finished, + * the driver waits for the remaining time. + * + * If a fixed enable delay is also specified, we'll start + * counting before delaying for the fixed delay. + * + * If a fixed prepare delay is also specified, we won't start + * counting until after the fixed delay. We can't overlap this + * fixed delay with the min time because the fixed delay + * doesn't happen at the end of the function if a HPD GPIO was + * specified. + * + * In other words: + * prepare() + * ... + * // do fixed prepare delay + * // wait for HPD GPIO if applicable + * // start counting for prepare_to_enable + * + * enable() + * // do fixed enable delay + * // enforce prepare_to_enable min time + */ + unsigned int prepare_to_enable; + + /** + * @enable: Time for the panel to display a valid frame. + * + * The time (in milliseconds) that it takes for the panel to + * display the first valid frame after starting to receive + * video data. + */ + unsigned int enable; + + /** + * @disable: Time for the panel to turn the display off. + * + * The time (in milliseconds) that it takes for the panel to + * turn the display off (no content is visible). + */ + unsigned int disable; + + /** + * @unprepare: Time to power down completely. + * + * The time (in milliseconds) that it takes for the panel + * to power itself down completely. + * + * This time is used to prevent a future "prepare" from + * starting until at least this many milliseconds has passed. + * If at prepare time less time has passed since unprepare + * finished, the driver waits for the remaining time. + */ + unsigned int unprepare; +}; + /** * struct panel_desc - Describes a simple panel. */ @@ -84,83 +165,7 @@ struct panel_desc { } size; /** @delay: Structure containing various delay values for this panel. */ - struct { - /** - * @delay.prepare: Time for the panel to become ready. - * - * The time (in milliseconds) that it takes for the panel to - * become ready and start receiving video data - */ - unsigned int prepare; - - /** - * @delay.hpd_absent_delay: Time to wait if HPD isn't hooked up. - * - * Add this to the prepare delay if we know Hot Plug Detect - * isn't used. - */ - unsigned int hpd_absent_delay; - - /** - * @delay.prepare_to_enable: Time between prepare and enable. - * - * The minimum time, in milliseconds, that needs to have passed - * between when prepare finished and enable may begin. If at - * enable time less time has passed since prepare finished, - * the driver waits for the remaining time. - * - * If a fixed enable delay is also specified, we'll start - * counting before delaying for the fixed delay. - * - * If a fixed prepare delay is also specified, we won't start - * counting until after the fixed delay. We can't overlap this - * fixed delay with the min time because the fixed delay - * doesn't happen at the end of the function if a HPD GPIO was - * specified. - * - * In other words: - * prepare() - * ... - * // do fixed prepare delay - * // wait for HPD GPIO if applicable - * // start counting for prepare_to_enable - * - * enable() - * // do fixed enable delay - * // enforce prepare_to_enable min time - */ - unsigned int prepare_to_enable; - - /** - * @delay.enable: Time for the panel to display a valid frame. - * - * The time (in milliseconds) that it takes for the panel to - * display the first valid frame after starting to receive - * video data. - */ - unsigned int enable; - - /** - * @delay.disable: Time for the panel to turn the display off. - * - * The time (in milliseconds) that it takes for the panel to - * turn the display off (no content is visible). - */ - unsigned int disable; - - /** - * @delay.unprepare: Time to power down completely. - * - * The time (in milliseconds) that it takes for the panel - * to power itself down completely. - * - * This time is used to prevent a future "prepare" from - * starting until at least this many milliseconds has passed. - * If at prepare time less time has passed since unprepare - * finished, the driver waits for the remaining time. - */ - unsigned int unprepare; - } delay; + struct panel_delay delay; }; struct panel_edp { -- 2.33.0.259.gc128427fd7-goog