From patchwork Thu Jun 27 18:56:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11020343 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9F20C14C0 for ; Thu, 27 Jun 2019 18:57:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93BCE2793A for ; Thu, 27 Jun 2019 18:57:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8827F285A8; Thu, 27 Jun 2019 18:57:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F1B92793A for ; Thu, 27 Jun 2019 18:57:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726619AbfF0S5T (ORCPT ); Thu, 27 Jun 2019 14:57:19 -0400 Received: from mout.gmx.net ([212.227.15.15]:38093 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726601AbfF0S5R (ORCPT ); Thu, 27 Jun 2019 14:57:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561661815; bh=CxR7qSbQJEaTRwxTiS+9LyZFjaKPowlzspE7tanqC4o=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Pai7wbgycEoUg5qAS6HYlSD/ehYwSGEWsLpBVwiL2vYbs2SUgRAf/mvvIG1YeojoC InlMtIcI9wv2WuW1tOAXgahRoHOjmoOwK+toSBDunI/bffWKltwDNkGeXTXzts5nFp QnFFxfUQA+Q4deVBYSthIRhSfFWgTeK7HA4qK0k0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MgcTf-1ht0Hg2sy7-00O07w; Thu, 27 Jun 2019 20:56:55 +0200 From: Stefan Wahren To: Eric Anholt , Greg Kroah-Hartman , Dave Stevenson , Hans Verkuil , Mauro Carvalho Chehab Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-media@vger.kernel.org Subject: [PATCH 18/31] staging: bcm2835-camera: Set sequence number correctly Date: Thu, 27 Jun 2019 20:56:15 +0200 Message-Id: <1561661788-22744-19-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> References: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:uglTV20dj89zG+7dc69VnabOIsvQyrYIv6qLM7blISuaYJWxuhz 9njdmJ+t/4DkTqLssoOh56a7uaO872TVNVSzzECWQKF0YX6njhk42XhLpXCDcP8uIU5zzuB X6EDxNHPcSI3+qK58uzHanyRITAW1bwqMwAhZZoUOfFiP0wxHZ5ZlrrnbLAVWJAKeCayEsy T3Ws5NxW40gK9NyMmmZ2A== X-UI-Out-Filterresults: notjunk:1;V03:K0:9h9q/Aa03ak=:xIVl/nRJKGM6dJxwREUv+8 g87d2J8v35Vt8bnrGRUY9OFqWPBZPh6+ehE1KNyQEyxx/Q1f6Nmo9oE0kCCG0mpUgpuxnFi1X v6yAjUE74rywqEjaRThq0H4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ailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dave Stevenson Set the sequence number in vb2_v4l2_buffer mainly so the latest v4l2-ctl reports the frame rate correctly. Signed-off-by: Dave Stevenson --- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 4 ++++ drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h | 2 ++ 2 files changed, 6 insertions(+) -- 2.7.4 diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index f2e951c..9967df9 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -398,6 +398,7 @@ static void buffer_cb(struct vchiq_mmal_instance *instance, } } dev->capture.last_timestamp = buf->vb.vb2_buf.timestamp; + buf->vb.sequence = dev->capture.sequence++; vb2_set_plane_payload(&buf->vb.vb2_buf, 0, length); if (mmal_flags & MMAL_BUFFER_HEADER_FLAG_KEYFRAME) @@ -525,6 +526,9 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count) /* enable frame capture */ dev->capture.frame_count = 1; + /* reset sequence number */ + dev->capture.sequence = 0; + /* if the preview is not already running, wait for a few frames for AGC * to settle down. */ diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h index bbfe8fe..c821513 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h @@ -93,6 +93,8 @@ struct bm2835_mmal_dev { ktime_t kernel_start_ts; /* Timestamp of last frame */ u64 last_timestamp; + /* Sequence number of last buffer */ + u32 sequence; struct vchiq_mmal_port *port; /* port being used for capture */ /* camera port being used for capture */