Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3903033ybi; Mon, 29 Jul 2019 15:01:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzxnm9WSKh/0xnet6ND714c4aEzdRLnRHAPldXPcnY+F1Q5vW+YHQtm89sqQPT5+Pdi3et5 X-Received: by 2002:a63:61c6:: with SMTP id v189mr98781645pgb.36.1564437703857; Mon, 29 Jul 2019 15:01:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564437703; cv=none; d=google.com; s=arc-20160816; b=VglqvRIJJ6FSSLgAD0TP+npOQXFR1hCsnkcGXQ79vVF3EdKMCF7pD5A5VrrN1gKS7m rvxBozFzCj4ukLgf7G+UJeWNdYxHNkfa+Ncfq4CxKu6UcgOuHtGWfkZpca/fqwkn42cL qLLigZySMsG/8mUj8g0tMpdmLQ04BEFaSBlXvqHERZ7gEACseCpTF4/77C9NbljZhgRy gG2+O7S1FqHYynlkaHPApp9HKtrPBbFpTLIqhi2MdOgmRGsl5IKg2ASFSWQ2IE0j/WOK GGhBxJJVWXw5bZMiyhtMEz2mjQjs6KL8iF7L7vNsbAfLFHYw+uhHffZHlcHcbNI0T35I 8+6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4A0u5hlpnCnGmrS3Il08X/zZlGCagqNy2PBnZS3KYzM=; b=a8dCHu3fgfllv8UDZDv7gg6lRiacjoHglLUshyLNuvvBGWFAqs/ln+VVNjy09CccNo 1wJokGpq32qCffH1XGJDY9NzfkF/38r8cU+noic3cO38GRxPK7WMDFnfGYnCSuzhqxIc OAPnU2YvKTquz/AukIDCZAhmUlDYcoDHViWSXHvhhZcd7Qd83rrPTBa8WaAsuu4ZRqp5 58OzT87AyEmqA51DOijoqgxEZJhd4PNM9hO4BmK1/wSfPhDVxO54wUYkEX3Od/yDd3P9 aq0hEwxclkYPz4SUzFZKs1QjAjEKN5ulLyHyhgxIB0y+3N8WkjnkXIIF8b4h/s33idfF jFsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Lv99SiPQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n20si27123805plp.395.2019.07.29.15.01.28; Mon, 29 Jul 2019 15:01:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Lv99SiPQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729854AbfG2T07 (ORCPT + 99 others); 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