From patchwork Sun Jul 9 13:52:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 13305829 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A760CEB64DD for ; Sun, 9 Jul 2023 13:52:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DAFBE10E0D2; Sun, 9 Jul 2023 13:52:44 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by gabe.freedesktop.org (Postfix) with ESMTPS id E47A510E0D2 for ; Sun, 9 Jul 2023 13:52:42 +0000 (UTC) Received: from tr.lan (ip-86-49-120-218.bb.vodafone.cz [86.49.120.218]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 4EAAE8509B; Sun, 9 Jul 2023 15:52:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1688910761; bh=tcMWqk4BjPRMtBDZ+wroHjmNDROv6omG5uAT50OSHBA=; h=From:To:Cc:Subject:Date:From; b=xrLJ72u0B9I3SnZ07VF74x7ljfnZuNEuLzpR6OdO7YojGn6IS6zyMgijfCc/DlCFH 6hy4VWgbxiU7uEouoHYtxSspy79m+LJVcac/4YgxveWFFe+P/1IaUyjE7TvOq6PwfZ bDVhs8a70NqfPA/+HvuhH/Q11LY3H7N32Boj6fpmoPBvd2H2yoe+TdR0GUt27l4FYr JSgoWn/CgCvw4gR8yYRXGcAfCOvzSEQIPHcVWfRJpVqytwlMIruLcZmSv9s60qtdBE U8Gw01SbJBADcCjZx4F5SjhAE9nsZS2HtE6bsJYR1w0u8E85Uftdv84zEA1uZOKqYt bLkS0fj02rA1g== From: Marek Vasut To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/panel: simple: Initialize unprepared_time in probe Date: Sun, 9 Jul 2023 15:52:31 +0200 Message-Id: <20230709135231.449636-1-marex@denx.de> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Neil Armstrong , Sam Ravnborg , Douglas Anderson Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The unprepared_time has to be initialized during probe to probe time ktime, otherwise panel_simple_resume() panel_simple_wait() call may wait too short time, or no time at all, which would violate the panel timing specification. Initializing the unprepared_time() to probe time ktime assures the delay is at least what the panel requires from the time kernel started. The unprepared_time is then updated every time the panel is suspended in panel_simple_suspend() too. Fixes: e5e30dfcf3db ("drm: panel: simple: Defer unprepare delay till next prepare to shorten it") Signed-off-by: Marek Vasut Reviewed-by: Sam Ravnborg --- Cc: Daniel Vetter Cc: David Airlie Cc: Douglas Anderson Cc: Neil Armstrong Cc: Sam Ravnborg Cc: dri-devel@lists.freedesktop.org --- drivers/gpu/drm/panel/panel-simple.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index d3238088b7f80..37afed67fea7e 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -567,6 +567,7 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) panel->enabled = false; panel->prepared_time = 0; + panel->unprepared_time = ktime_get_boottime(); panel->desc = desc; panel->supply = devm_regulator_get(dev, "power");