From patchwork Mon Oct 6 20:58:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 518 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759784360; bh=TfPH7pfbajKuqOU4UqRTEB89NiwMaRL9lnEN0PU2SvQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=K/5BIlk4aRLjD+KEqdkBL+f77VnwyJoImMq0aMb9Pjaf9O1mZsCWrZr1xVSGW9Q7n mjiEtV+rIBmzPeMu1h7f32aVgYyRUA1Cr3KF0t+vYwNsAFliPeClBqGpyTHouf8wWc xHs8AazJ/B+UkGca3716DCl67ay1aCSR3a/kC6XLSVSGbGM1JLKGADsVLHSPmT6IMz jnFMWapFNIUz16XBvLbG7SToAyVl5pxZySRLCsFRAT+cXhEe2/keXsaqEVFpy97TfH 2RNr6BegpktiqwMb47YZzspOMRcye2qrH1mpYjF3QFZHl/pLqBsOBgWakaAhhQntei LpKDrwbtI9HFA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E02CB67EE4 for ; Mon, 6 Oct 2025 14:59:20 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id vlOrWIaEoAh9 for ; Mon, 6 Oct 2025 14:59:20 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759784359; bh=TfPH7pfbajKuqOU4UqRTEB89NiwMaRL9lnEN0PU2SvQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=pTrE8DlBE7EoFvFKaSXGhbX8oP728vPigO36LZLCR2TvbYlcRGPGq/11fUNWO6n3c Otf0ZtRWaSl73Tt+LhTq4T5sj/FQ8kzfPdJWxkuskMh9o5r+5bU7H2WCJCqaDnEbBK 8ofGCcSklifDegzt1zXWOvWhpT7zvLrFsZ0RJQKCyf6L1TECHCqDOniClBzn5DkJqI Y2xLaqN35Qcx3eTTAtduVXYA/tnCRidEQlInH1po4QA47L8JsSOFPicwradIAZjifZ k+gRUgibH2nramf6IxkbqlRbUQPi4nZtIc7LLQLWKArE+APnbe1JQIxLP/y//OJQEL DwBRNkTdFxCsA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C5EEB67F03 for ; Mon, 6 Oct 2025 14:59:19 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759784358; bh=YuyPZ+V7W2M1TxaCLekT5nvEKLtO9AyWcrEvjK23dgA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FKSFy9sSDia9E6zDdPpq/WxIP4Yk2PBQBN6K1GXTSfaLypGnoMlsoXpnXcaXtseJo W7h7WVbENdnLX6TkE+VZKssQfyXNR4dhvahq1HgWhaQinYuhaGHaEGj/bSU8Jey6lm f0PcacqvsUeyyqdPShMRa2omuJweX0H8vh/zzB0HeQv/P/9IfsIIwQw2+7uxu5bD9h 8Wh397ExyVz9jpm43OLMnJSkqTwYivO9CI2hLQN225BT+HVqFvEUPYzncucP6HXko3 y9ND+0XgsbSaZwYGsK00GygE5awIBa1wSIgiXS/1GZVNsvrxwUXNZnjJAhMbkxHuxR 0YbEFg4d327iQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0FF5567EE4; Mon, 6 Oct 2025 14:59:18 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id DOBN8p-0r2a0; Mon, 6 Oct 2025 14:59:17 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759784357; bh=Kj8jdphRew8k99O9s6pFTaUIhfIVnUmkje8zgBPbE0k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vLRPTnuH3IPUOra2E5Ty3MeG5vC7GaGG7sD6LjsW3tmAasPFuOvN0tX/elOKtB/Nb UFUpp45w2lgu9ZgHe+BFDS/rqVsMsq92KxEQIfmgV0BOWLsfUkG7bdVxEELtZakoRI sv2z+sh50ap3uFr8RbSMmvWO4GIei3Y1q5zZpoR5if4v48WSS9xF+ZxdahevcMX8jB QYdmlGaW6yqOsvHAa1ZF2Onff0jmHeb2DOnwHVOc/5718TGwsiSOdqRSYiXQcT8JDj zRpurYIznyVZY/KhFwofLxfK5IpCp1q7gRY/Fusz5lZidcI78bWdbsFMyLjW7wu59B RndF7n99KLq1g== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id F3F0067F03; Mon, 6 Oct 2025 14:59:16 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 6 Oct 2025 14:58:35 -0600 Message-ID: <20251006205856.2009292-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251006205856.2009292-1-sjg@u-boot.org> References: <20251006205856.2009292-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: K4JPTMAVBICLDCRCEI5NZP5IF36NBXOY X-Message-ID-Hash: K4JPTMAVBICLDCRCEI5NZP5IF36NBXOY X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 01/14] video: Do the sync timing within video_sync() List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The timer is used in a different function from that where it is set up. Move setup into video_sync() so that the code is all together. Signed-off-by: Simon Glass --- drivers/video/video-uclass.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index 500a04a0442..37171f6b2da 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -519,11 +519,6 @@ int video_manual_sync(struct udevice *vid, uint flags) video_flush_dcache(vid, false); - if (IS_ENABLED(CONFIG_VIDEO_COPY) && (flags & VIDSYNC_COPY)) - video_flush_dcache(vid, true); - - priv->last_sync = get_timer(0); - if (IS_ENABLED(CONFIG_VIDEO_DAMAGE)) { struct vid_bbox *damage = &priv->damage; @@ -542,6 +537,7 @@ int video_sync(struct udevice *vid, bool force) struct video_priv *priv = dev_get_uclass_priv(vid); struct video_uc_priv *uc_priv = uclass_get_priv(vid->uclass); uint flags = 0; + int ret; /* Skip sync if manual-sync mode is active */ if (uc_priv->manual_sync) @@ -558,7 +554,13 @@ int video_sync(struct udevice *vid, bool force) if (IS_ENABLED(CONFIG_VIDEO_COPY)) flags |= VIDSYNC_COPY; - return video_manual_sync(vid, flags); + ret = video_manual_sync(vid, flags); + if (ret) + return ret; + + priv->last_sync = get_timer(0); + + return 0; } void video_sync_all(void)