Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp864554pxb; Thu, 9 Sep 2021 14:03:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrrZYQUlMiP+DOE0KPqEIy98mbZMOsJhsjz858Ik7wMEz64tHoJl9e2V3B3F5ioHBccyIO X-Received: by 2002:a6b:b883:: with SMTP id i125mr4305579iof.144.1631221428578; Thu, 09 Sep 2021 14:03:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631221428; cv=none; d=google.com; s=arc-20160816; b=OcO365DFM87mGL+dVy7ykPlYbU/KKIniJrPn3oTFRw91p/t55LreKoi7WD6LrGbKPa /A78n5wXtg1TCW3sC3cYSdjPq0ga4ngS6Kb623lxmw6jH6iHMDobPiW4UXiPfJ4ggWTT 1DCyCva0fgLqPb12HJTk4sttlunekkaKgtV6bi85R8dq56US/dGNXSvxVM65VwrCvfG1 h2BZFD0t0rwzSTi2/f2mo5q1sFB/DfbnBmsNM5DqAlN3kPu6xoaWf2o053UwN+srJ54P gdw10Nwkao7OopnCHCg9CLPGiDmR/fS5aF/JnIC12iYfcRaUv1i0WfhSP2MzZhhRhp7J ZuJA== 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=fMWHvQR66HlUTiOipezcLhpDlgppMVIEbGhzN+KejXE=; b=NcHnCcPlJlF8PzNFR2mNgWGhmhFzaQ6SPGtPtfk0t9+G3/fiAMbg+Yzjvw0uGXWvie 6K2Z/vha0CRQsVJc87XsEp8804/rSX01dWGlcF2XTSV1CEaMK92uhYbLiuksWS2v7lRX 3y1jXE2RP3A4R4r9m5NAleTse5ANzMSNIySDS3AM8qG4GlVtkkEA5BDFikZ+nRY1zFAK YUQe+2JAOJ/4tZEosp+relSxyRyWhLKYFaBs4SG68E2t2CEGV1p0IJpF8J4df89o0f8U Q7Kp91Aee4gvuWDPyCm6ocQVV8MxSGCQ+ijhfF+v8k3ypXRwuFXUcHdjK+og8fO3EnyY /RHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=T9tMYzY8; 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 x13si3232993ile.180.2021.09.09.14.03.30; Thu, 09 Sep 2021 14:03:48 -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=T9tMYzY8; 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 S1347732AbhIIVDN (ORCPT + 99 others); Thu, 9 Sep 2021 17:03:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346860AbhIIVCv (ORCPT ); Thu, 9 Sep 2021 17:02:51 -0400 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA511C0613C1 for ; Thu, 9 Sep 2021 14:01:41 -0700 (PDT) Received: by mail-pg1-x532.google.com with SMTP id t1so3122537pgv.3 for ; Thu, 09 Sep 2021 14:01:41 -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=fMWHvQR66HlUTiOipezcLhpDlgppMVIEbGhzN+KejXE=; b=T9tMYzY8lFGlrfPp7zINZ+knQJNVClqV9byWcw6AgudQ+WDEpCFAWCCPpYtyt3ZVEJ szye97oImQYsjzOQaTmr9i/Xkhkk65dQtfrC5xZ3zkBphkiHTdOBW8QuJ7/2kcEUZPLc 08sI54TBvGPT1hqXfVybZWLCWVo9ZetOAoqGI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fMWHvQR66HlUTiOipezcLhpDlgppMVIEbGhzN+KejXE=; b=zHe9hhjQuIkrSXpYrDgXCx6/+EqBNED4/MexF9VR6t49/I8T+OC4gpcE3S/nQE+BKm kto0DwCvwzoEmTZb1bq2BhzoEautjpMxmE3cYZWB8YoMIzz8DVpHGwa5pV2ruxGLrsAw kXmILQaFVOt0CqhGVGF9T8jqOKXq2XiOZPFAIVyigHKKzNxYhT0zimYwXaHFGB/bWSmr m2CrYRsGuOZCgkVi+d5QQ9gY7imY+Wyv/tOVWvA3xbG4FSDeoftC6Sk5C2ix/UAKpAyu i+edfiUcS/PythmT5xizlyBSyfnFHJD9yq0MAeJzXwecmMxL/YVm4J3Oa+yc11dlEEvU +U5A== X-Gm-Message-State: AOAM532bHPAUKpjz6L7yd6Zychq5M2nTzZCDc4e5rSSxNSLFnrDZ8Q4q +txXjEUx0zHbeY2dByPRvYxQ7YIIug2Fmw== X-Received: by 2002:a63:e516:: with SMTP id r22mr4374243pgh.197.1631221301217; Thu, 09 Sep 2021 14:01:41 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:201:8da3:b0fb:4261:2c10]) by smtp.gmail.com with ESMTPSA id l143sm177069pfd.60.2021.09.09.14.01.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Sep 2021 14:01:40 -0700 (PDT) From: Douglas Anderson To: Thierry Reding , Rob Herring , Sam Ravnborg Cc: devicetree@vger.kernel.org, Maxime Ripard , Thomas Zimmermann , Linus W , Daniel Vetter , linux-arm-msm@vger.kernel.org, Steev Klimaszewski , Maarten Lankhorst , Bjorn Andersson , David Airlie , dri-devel@lists.freedesktop.org, Douglas Anderson , linux-kernel@vger.kernel.org Subject: [PATCH v4 10/15] drm/panel-edp: Split the delay structure out Date: Thu, 9 Sep 2021 14:00:26 -0700 Message-Id: <20210909135838.v4.10.I24f3646dd09954958645cc05c538909f169bf362@changeid> X-Mailer: git-send-email 2.33.0.309.g3052b89438-goog In-Reply-To: <20210909210032.465570-1-dianders@chromium.org> References: <20210909210032.465570-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 Acked-by: Sam Ravnborg --- Changes in v4: - panel-simple-edp => panel-edp Changes in v3: - Split the delay structure out patch just on eDP now. drivers/gpu/drm/panel/panel-edp.c | 159 +++++++++++++++--------------- 1 file changed, 82 insertions(+), 77 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c index b698594ba43b..26f4ae7921e5 100644 --- a/drivers/gpu/drm/panel/panel-edp.c +++ b/drivers/gpu/drm/panel/panel-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.309.g3052b89438-goog