From patchwork Mon Jan 30 14:16:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 50318 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2204408wrn; Mon, 30 Jan 2023 06:20:24 -0800 (PST) X-Google-Smtp-Source: AMrXdXuEAYs7y89JyRRG5lOn83HpOl6ajIg2awFwT2iOkN48GtLdDHczmET9IZ9flsP4bOSsR1b3 X-Received: by 2002:a05:6402:270b:b0:498:18e7:1667 with SMTP id y11-20020a056402270b00b0049818e71667mr71465795edd.10.1675088424100; Mon, 30 Jan 2023 06:20:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675088424; cv=none; d=google.com; s=arc-20160816; b=JKwfry7tUXPpeOcr9Tb9BTP6b+2NhCB8Ig1SfbQuHlCd6hf8VTiqvVtciOkWXVtiAB AgmFZDxOc6d81Yu/eSJJjYo3inpf/+Ym6uZkOruQbeowBvceY4rUMNnh2wIvXKt1fKso YSo/4X6TYYHMnuFbLpKlKizgPdWvofSvJk+s8juFho5Thl/HhMD/J6K1rj4MhNoo/hgS nSehUJC+VSW/ZpZ6BTeob+xIlULiAMzRjYe85ASKGZkGkhvdRsW9LVqLkSuM95DKKezF XarEmbV8Gob8E/iMnpYFEec9XqGAbS7zD4073SIK14AWFqoyhRhv7eDZwALd0OopHHVJ kdDA== 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=W/OR7OgnmlOPfrWXLXRWbh6OKG8j6mLzoFN0/Tk8wec=; b=AhacVIqyNLEEuPKaS5toX6JD10DfwyMB7+NOAm96nWe5hEQJJOwdCVQwXTUL1iakYx /u1BUI4hvYYU+9muwcihHfre6btkJxDXFpm2VzTJHKvUpCDGFLhm24Ujh3LcbHCNlZbA kqXZZ+DR3ded/OYIz2TNwDzeMPtgBVYKA3PZS+8rzww9hchlwXJVd7B1EgnXW15oH22U ROwccktWokRGoPxXYbX+YYh4x+9fhB0oTqhNprKFJ63yJ4SVfXpqwlacb6yIKwdTfDQP BePOE4H18lORjYb7NrfpZ35osm+SAzyTdt+JUh8x1h7gMJX4EflZFwACYuepFMdRVbD5 9yXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=f6dnGhWW; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fi16-20020a056402551000b004a21d031559si8241760edb.476.2023.01.30.06.19.58; Mon, 30 Jan 2023 06:20:24 -0800 (PST) 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=@bootlin.com header.s=gm1 header.b=f6dnGhWW; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237520AbjA3OTW (ORCPT + 99 others); Mon, 30 Jan 2023 09:19:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237633AbjA3OS4 (ORCPT ); Mon, 30 Jan 2023 09:18:56 -0500 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [IPv6:2001:4b98:dc4:8::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F00686AE; Mon, 30 Jan 2023 06:17:53 -0800 (PST) Received: from booty.fritz.box (unknown [77.244.183.192]) (Authenticated sender: luca.ceresoli@bootlin.com) by mail.gandi.net (Postfix) with ESMTPA id 4B36C100009; Mon, 30 Jan 2023 14:17:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1675088271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=W/OR7OgnmlOPfrWXLXRWbh6OKG8j6mLzoFN0/Tk8wec=; b=f6dnGhWWi2yTxfpnVtHrV1hA+zfhqtgdZ7SyYQWl8itrh2hIgU56R+ggF6MMAOI0WCqHzN 63sqALvxJJlZn+3d34aEnYxwLLmmCiJXXdMuZOvnARd/HLFbryeifsp/CB/9/c5zgjt35u RNcNKo1UXhehVUaCBX5EXsunSBpBjsAvivq6pDrKFZgHi87W8BWJ584+ebppBkm6lBNKVA +5afKBqCRbvKwYSUsbbM8kMw5+X8CTCS0i2luoQMqwRCT2BbmaqzxHR+2AT/+U0+nrfpNQ +IYAOArKdSaNcDqA0vGsdDngu3dDG8LhbtjjNA5aUqcyXhtXww1QUdiI4U6REw== From: Luca Ceresoli To: Thierry Reding , Jonathan Hunter , Sowjanya Komatineni , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Mauro Carvalho Chehab , Greg Kroah-Hartman , Dmitry Osipenko , Hans Verkuil Cc: Luca Ceresoli , linux-media@vger.kernel.org, linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, Thomas Petazzoni , Paul Kocialkowski , Richard Leitner Subject: [PATCH v4 18/21] staging: media: tegra-video: add syncpts for Tegra20 to struct tegra_vi Date: Mon, 30 Jan 2023 15:16:00 +0100 Message-Id: <20230130141603.323221-19-luca.ceresoli@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230130141603.323221-1-luca.ceresoli@bootlin.com> References: <20230130141603.323221-1-luca.ceresoli@bootlin.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756457519751195345?= X-GMAIL-MSGID: =?utf-8?q?1756457519751195345?= In preparation to implement Tegra20 parallel video capture, add a variable to hold the required syncpt and document all the syncpt variables. Signed-off-by: Luca Ceresoli Reviewed-by: Dmitry Osipenko --- Changed in v4: - Added review tags Changed in v3: - recycle mw_ack_sp[0] instead of adding out_sp No changes in v2 --- drivers/staging/media/tegra-video/vi.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/tegra-video/vi.h b/drivers/staging/media/tegra-video/vi.h index 8fadca33bcc9..d5e1ed4217e0 100644 --- a/drivers/staging/media/tegra-video/vi.h +++ b/drivers/staging/media/tegra-video/vi.h @@ -117,11 +117,13 @@ struct tegra_vi { * @vi: Tegra video input device structure * @frame_start_sp: host1x syncpoint pointer to synchronize programmed capture * start condition with hardware frame start events through host1x - * syncpoint counters. + * syncpoint counters. (Tegra210) * @mw_ack_sp: host1x syncpoint pointer to synchronize programmed memory write * ack trigger condition with hardware memory write done at end of - * frame through host1x syncpoint counters. + * frame through host1x syncpoint counters (On Tegra20 used for the + * OUT_1 syncpt) * @sp_incr_lock: protects cpu syncpoint increment. + * @next_out_sp_idx: next expected value for mw_ack_sp[0], i.e. OUT_1 (Tegra20) * * @kthread_start_capture: kthread to start capture of single frame when * vb buffer is available. This thread programs VI CSI hardware @@ -173,6 +175,7 @@ struct tegra_vi_channel { struct host1x_syncpt *mw_ack_sp[GANG_PORTS_MAX]; /* protects the cpu syncpoint increment */ spinlock_t sp_incr_lock[GANG_PORTS_MAX]; + u32 next_out_sp_idx; struct task_struct *kthread_start_capture; wait_queue_head_t start_wait;