Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp378853rwi; Mon, 31 Oct 2022 02:36:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ZVHEphV72b2ugIkEWTXHWVo8/horjNkThdt2dkOOGtuHD7n1XMaQ0Icmx/43UqSRJEEyS X-Received: by 2002:a17:907:8a24:b0:78d:cd60:1022 with SMTP id sc36-20020a1709078a2400b0078dcd601022mr12000803ejc.384.1667208980236; Mon, 31 Oct 2022 02:36:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667208980; cv=none; d=google.com; s=arc-20160816; b=tLswrAvOZrOtZNHSMp7AnjtQfe8mB4A2/RQRivI/SK1jPQABSV0v9M2J7g4cxixv5m NXR3RWsLyBJ+jj7oZz4ekugwkLSBzrpHUXN3sMH6s8RRRuIq7az2z63/7MQs1cUxkh2L KXbYoW5ZuPGP8x+4qhSZb6AItAcfq10MnG450aQ9o0TIW49xrCJYokvHQwA9nky3ZtNz WR4UFlJzbWAosZJS3ueox3vu87YpR3my3agJpJ68HXMabMsQfxqHpSYNURVH4WpJQhwo d9LAgz5BeLHRAuHg19aacvJWNPggZo5Lc2xxr+ZbIGsMdy1oj8hr5W05eGO1Uu3URAJh rtDw== 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=y7TwjvYNuBTQx7bSJpCvwsU7T5xZI7GJ6V6t+msfW3s=; b=W4aM7eemu8VYc9qKtCOyih+UAMbfWhB6L4Qz7kqSX10X9HXCeUPIHMU5iQKtikfcWG 2/STW6rYBw1Gxcs6XjbCRmWpf1Chx/OIdvyypcJ2ZVVDjNZmhtiunN7KN9tFXc0EanWp pn0balxQ2p6NbxVETK4x97/LE1Q8iwE3lsaYQg3JVnjXZr8p4F0x7MY8MVQsofLP0T+N oKPjAujZy8oMJzyIVuTkS7JVtIyOTxbMlw0rIanlykx+ab/tYc/XCR5J/1VLknlqpf/z 3bnI2zKE9tpuyj6yYZwXq9yUbrCPb38k24FdZvPiIsrce6nFE6bwyIO367fJnLpzSDpn 5IxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YtoDP2wW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x2-20020a05640225c200b00447eb58b921si6997188edb.38.2022.10.31.02.35.50; Mon, 31 Oct 2022 02:36:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YtoDP2wW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229743AbiJaJP0 (ORCPT + 99 others); Mon, 31 Oct 2022 05:15:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbiJaJPZ (ORCPT ); Mon, 31 Oct 2022 05:15:25 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27746D2E8; Mon, 31 Oct 2022 02:15:24 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id bj12so27675034ejb.13; Mon, 31 Oct 2022 02:15:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=y7TwjvYNuBTQx7bSJpCvwsU7T5xZI7GJ6V6t+msfW3s=; b=YtoDP2wWwbUmxTRehDOaGIGN1GnNV3a0NFQs7iFRYgfhjfaihmwLGTLxzQnbzQGXU5 EGaVEfJdwOPHRFbCjyT0wTdi9NbmUSrq3AbPOak0QFhG+KA/S7sG/tBbM1Q7tGoBFNBN V2YYvqTfLDIWoMx8r6oGP2Tb9cZ2F5AiF/ra9Fkb9AAU6Nu3OfTjkmSlp20L0PFHSVqf VaaINVD9CLuqnVeb1ov8fZ8nPWh5NQf8baw2TxRobi68SeSfb8oY1Ot30YxLR3j1uBUz s5mT+ca9et0ZA6v1W3u/TUqDjebHMnbZTraWZzrzIfIeQ/jmZtNHUveRBQN+SoDak3Nb +DoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=y7TwjvYNuBTQx7bSJpCvwsU7T5xZI7GJ6V6t+msfW3s=; b=z8ZBgOP0nJnH8th5K5H8Ta9E1An8rdZgpakx/Y0CGP/vRfE+G6fSgdUUxMJ2z+RIFU Akn7By0wkMKcyD4p6BrV6R51TsdrLoThEEVVPAPG78eqso+TvBHqPAftRCbb5ycC3rxQ mszQt1Ij6nWVNrOUBm054Zg3Z56jzVUKVYfxK8kof+UfM6Xsmv3wKfP/RvqI5NvdSpWI pyeiqbuUkdN1UsSg42MyUfqHRVibBkfwbhT7nqMGY0Ajxup7jZWVafYmhUcIkq7Tmc00 63uDwrj3kkbSBhytMtDD4ncmMV5RC0AY8HgJ5S9rq5t5EgWl0WyqOlvs7CpaPvBorYGE CAQg== X-Gm-Message-State: ACrzQf1OXuVWJONHIvfzE046YI+bgf3qpk/MCQEm7WBCvOSOKeDqPdnQ cYwHWMIQP/LEKy4ku+U/fEMMQSTapoc= X-Received: by 2002:a17:907:2e01:b0:78d:f24b:7330 with SMTP id ig1-20020a1709072e0100b0078df24b7330mr11763582ejc.604.1667207722748; Mon, 31 Oct 2022 02:15:22 -0700 (PDT) Received: from kista.localnet (82-149-19-102.dynamic.telemach.net. [82.149.19.102]) by smtp.gmail.com with ESMTPSA id gy8-20020a170906f24800b007317f017e64sm2741662ejb.134.2022.10.31.02.15.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 02:15:22 -0700 (PDT) From: Jernej =?utf-8?B?xaBrcmFiZWM=?= To: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, Paul Kocialkowski Cc: Yong Deng , Paul Kocialkowski , Mauro Carvalho Chehab , Chen-Yu Tsai , Samuel Holland , Laurent Pinchart , Maxime Ripard , Thomas Petazzoni Subject: Re: [PATCH v6 18/43] media: sun6i-csi: Add capture state using vsync for page flip Date: Mon, 31 Oct 2022 10:15:21 +0100 Message-ID: <4778394.31r3eYUQgx@kista> In-Reply-To: <20220826183240.604834-19-paul.kocialkowski@bootlin.com> References: <20220826183240.604834-1-paul.kocialkowski@bootlin.com> <20220826183240.604834-19-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dne petek, 26. avgust 2022 ob 20:32:15 CET je Paul Kocialkowski napisal(a): > The current implementation requires up to 3 buffers to properly > implement page flipping without losing frames: one is configured > before the video stream is started, one just after that and page > flipping is synchronized to the frame done interrupt. The comment in > the code mentions that "CSI will lookup the next dma buffer for next > frame before the current frame done IRQ triggered". > > Based on observations of the CSI unit behavior, it seems that the > buffer DMA address is sampled when the frame scan begins (in addition > to starting the stream), which corresponds to the vblank interrupt > that hits just before the frame-done interrupt of the previous frame. > > As a result, the address configured at the frame done interrupt is not > actually used for the next frame but for the one after that. > > This proposal changes the page flipping sync point to the vsync > interrupt, which allows the DMA address to be sampled for the next > frame instead and allows operating with only two buffers. > > In addition to the change in the sync point, the code is refactored > to introduce a notion of state that clarifies tracking of the buffers > with tidy functions. > > Signed-off-by: Paul Kocialkowski Acked-by: Jernej Skrabec Best regards, Jernej