From patchwork Mon Apr 8 12:32:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Zabel X-Patchwork-Id: 10889517 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 C818114DB for ; Mon, 8 Apr 2019 12:33:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0CC22862A for ; Mon, 8 Apr 2019 12:33:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A557328644; Mon, 8 Apr 2019 12:33:14 +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=-7.9 required=2.0 tests=BAYES_00,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 4212C2862A for ; Mon, 8 Apr 2019 12:33:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726629AbfDHMdK (ORCPT ); Mon, 8 Apr 2019 08:33:10 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:48479 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726599AbfDHMdK (ORCPT ); Mon, 8 Apr 2019 08:33:10 -0400 Received: from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28] helo=dude02.pengutronix.de.) by metis.ext.pengutronix.de with esmtp (Exim 4.89) (envelope-from ) id 1hDTSW-00005P-JH; Mon, 08 Apr 2019 14:33:08 +0200 From: Philipp Zabel To: linux-media@vger.kernel.org Cc: kernel@pengutronix.de Subject: [PATCH 10/10] media: coda: require all decoder command flags to be cleared Date: Mon, 8 Apr 2019 14:32:56 +0200 Message-Id: <20190408123256.22868-10-p.zabel@pengutronix.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190408123256.22868-1-p.zabel@pengutronix.de> References: <20190408123256.22868-1-p.zabel@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::28 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-media@vger.kernel.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The memory-to-memory stateful video decoder interface documentation requires the decoder stop command initiating the drain sequence to have flags set to zero. Stop to black makes no sense as stopped memory-to-memory decoders do not produce any frames, and stopping immediately can be achieved by stopping the output video queue with VIDIOC_STREAMOFF. The mute audio start command flag serves no purpose as the coda driver does not handle any audio formats, and does not support playback at non-standard speeds. Signed-off-by: Philipp Zabel --- drivers/media/platform/coda/coda-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c index 318f0be103bb..96798f98734a 100644 --- a/drivers/media/platform/coda/coda-common.c +++ b/drivers/media/platform/coda/coda-common.c @@ -1050,10 +1050,10 @@ static int coda_try_decoder_cmd(struct file *file, void *fh, if (dc->cmd != V4L2_DEC_CMD_STOP) return -EINVAL; - if (dc->flags & V4L2_DEC_CMD_STOP_TO_BLACK) + if (dc->stop.pts != 0) return -EINVAL; - if (!(dc->flags & V4L2_DEC_CMD_STOP_IMMEDIATELY) && (dc->stop.pts != 0)) + if (dc->flags != 0) return -EINVAL; return 0;