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=unavailable 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 CAB10C32750 for ; Fri, 2 Aug 2019 10:06:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9BD962067D for ; Fri, 2 Aug 2019 10:06:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564740384; bh=pciexHLHPTKBQ0bRSuZ1KyLA+O7ZNfCng+qeCHSWRRI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ci/HYLFMc3lbc0q4wtnwEQqajM/cjJzF5v5Yen7eIo+foR9ISdDPkSCuFDh+H8w/w DSg7gSMvoG9ff5ktabQDSd25IXiMrvbQEr5FP58VFSEm8AAWLuhk4e+XImWXvxHLaW LrFyOzwTqmzFv7fFbj9l6B7FNl8r+TN2foPIDrFQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391035AbfHBJbS (ORCPT ); Fri, 2 Aug 2019 05:31:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:57296 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390003AbfHBJbS (ORCPT ); Fri, 2 Aug 2019 05:31:18 -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 C7AE521783; Fri, 2 Aug 2019 09:31:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564738277; bh=pciexHLHPTKBQ0bRSuZ1KyLA+O7ZNfCng+qeCHSWRRI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qlv7/N36s4gfmeZAs0s00hhieCXb2UTQJJd1osEhUIqsWqwSinkp5pbK3Hl47yiH2 abaQOi9JN7MaUmqDgZuAQBstIOOrRipH5nE/xbDQcrp5JDEq7Ff4ns9zO1H+S2xfn8 xxbTBoAEQY1HzNXi7NeW/lM1HGmxJ8w2aSzSuEgE= 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.4 041/158] media: coda: increment sequence offset for the last returned frame Date: Fri, 2 Aug 2019 11:27:42 +0200 Message-Id: <20190802092212.391913782@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190802092203.671944552@linuxfoundation.org> References: <20190802092203.671944552@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 a7ed2dba7a0e..b19e70b83f4a 100644 --- a/drivers/media/platform/coda/coda-bit.c +++ b/drivers/media/platform/coda/coda-bit.c @@ -1967,6 +1967,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