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 X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1CD8C76186 for ; Mon, 29 Jul 2019 19:27:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A9BF0217D6 for ; Mon, 29 Jul 2019 19:27:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564428420; bh=HMrFMfx9FRBx1x87FYuAdelbhrEu472Dp/Lip/dBYBo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=jIKgDCHEdT0ljl0Jz3HI2Bn4fCodiC84gwi8iTcMb8vklrO3be/aSRmcPh7jgOjO6 0z3ymlfJ9VqNTTu4ce85NXUeAj02S0KTeXSCNH994YXsuN0VLsSQ9Ic+YsnFic+IPY YBh1kfiNYfTgfnL3JTOBDocz2A6XUcBeuCzTXvNg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729858AbfG2T07 (ORCPT ); Mon, 29 Jul 2019 15:26:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:39386 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729842AbfG2T04 (ORCPT ); Mon, 29 Jul 2019 15:26:56 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 861D0217D6; Mon, 29 Jul 2019 19:26:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564428415; bh=HMrFMfx9FRBx1x87FYuAdelbhrEu472Dp/Lip/dBYBo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Lv99SiPQ5Lbx2QeV6KrkX9A12pAUMoV1MspmB4Kyjwm4MC1kwZMxQPsNSe3YsR3rb BIUBt01x4YtKG/J9LQ6LfUXVuMzfuU+snxX8mN4htIXjO9uSvz37qUt3lsDb620lfu s24o6oj52n0nj4WXJMySS32ciu+eVQ6ixt4seiAQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Philipp Zabel , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.14 069/293] media: coda: increment sequence offset for the last returned frame Date: Mon, 29 Jul 2019 21:19:20 +0200 Message-Id: <20190729190829.969512308@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit b3b7d96817cdb8b6fc353867705275dce8f41ccc ] If no more frames are decoded in bitstream end mode, and a previously decoded frame has been returned, the firmware still increments the frame number. To avoid a sequence number mismatch after decoder restart, increment the sequence_offset correction parameter. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/coda/coda-bit.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c index 43eb5d51cf23..f0f2175265a9 100644 --- a/drivers/media/platform/coda/coda-bit.c +++ b/drivers/media/platform/coda/coda-bit.c @@ -2091,6 +2091,9 @@ static void coda_finish_decode(struct coda_ctx *ctx) else if (ctx->display_idx < 0) ctx->hold = true; } else if (decoded_idx == -2) { + if (ctx->display_idx >= 0 && + ctx->display_idx < ctx->num_internal_frames) + ctx->sequence_offset++; /* no frame was decoded, we still return remaining buffers */ } else if (decoded_idx < 0 || decoded_idx >= ctx->num_internal_frames) { v4l2_err(&dev->v4l2_dev, -- 2.20.1