From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62512C433F5 for ; Thu, 11 Nov 2021 17:03:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4098F61075 for ; Thu, 11 Nov 2021 17:03:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234338AbhKKRF5 convert rfc822-to-8bit (ORCPT ); Thu, 11 Nov 2021 12:05:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233867AbhKKRFz (ORCPT ); Thu, 11 Nov 2021 12:05:55 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90F96C061766 for ; Thu, 11 Nov 2021 09:03:06 -0800 (PST) Received: from lupine.hi.pengutronix.de ([2001:67c:670:100:3ad5:47ff:feaf:1a17] helo=lupine) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mlDTb-0001Eq-7w; Thu, 11 Nov 2021 18:03:03 +0100 Received: from pza by lupine with local (Exim 4.94.2) (envelope-from ) id 1mlDTZ-000Kf5-V0; Thu, 11 Nov 2021 18:03:01 +0100 Message-ID: Subject: Re: [PATCH] media: coda: Keep metas sync with hardware fifo From: Philipp Zabel To: Benjamin Gaignard , mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com Date: Thu, 11 Nov 2021 18:03:01 +0100 In-Reply-To: <20211108142404.598968-1-benjamin.gaignard@collabora.com> References: <20211108142404.598968-1-benjamin.gaignard@collabora.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:3ad5:47ff:feaf:1a17 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Benjamin, On Mon, 2021-11-08 at 15:24 +0100, Benjamin Gaignard wrote: > After updating the output fifo position be sure that metas are also > synchronised with this position. > > Signed-off-by: Benjamin Gaignard > --- >  drivers/media/platform/coda/coda-bit.c | 6 ++++++ >  1 file changed, 6 insertions(+) > > diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c > index c484c008ab02..28c56286b0de 100644 > --- a/drivers/media/platform/coda/coda-bit.c > +++ b/drivers/media/platform/coda/coda-bit.c > @@ -2315,6 +2315,12 @@ static void coda_finish_decode(struct coda_ctx *ctx) >   /* Update kfifo out pointer from coda bitstream read pointer */ >   coda_kfifo_sync_from_device(ctx); > > + /* > + * After updating the read pointer, we need to check if > + * any metas are consumed and should be released. > + */ > + coda_decoder_drop_used_metas(ctx); > + This doesn't look right. If you drop all metas seen by the decoder right away, they can't be copied into the decoded picture's meta slot later in this function. I'd expect you run into the "empty timestamp list!" errors if you do this. regards Philipp