From patchwork Thu Mar 31 19:37:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne X-Patchwork-Id: 12797631 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8A82EC4332F for ; Thu, 31 Mar 2022 19:38:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5nCsNNAjE1T2T8g3xdzaIqdHf0EA0X9u7hEIw74GAiw=; b=2hbmmegBpahPPl 7/gE5YFUWIM4Ae4hcscoaB0+axOiUfZv1zv5DOpp03AUVXhTFgKxsmTJEzRIs8kOa1siQ+txQnw4X UAEegnBxm/VU9BfCgDSv0waLAfnVukE9XrhRObL+LIYbcZKoUI/x1rnfKc4S03cKCKWbTzlUI9lE0 ku/74kHmT3TY0tZgzBEAfvFlMmPaR89+3LzmQLT7r/WNqpM3fqiW4Vo816lmZamJgx9WMdGz7U1mR BtXASCs8MCccy/zuQ/bPIqd9EfE5ixBkx8/sQ7fUpr9J7pTQgfYt2FqGFXLj8IihLXOn/L+A08XTX tjLkz8z5SzMnY8QM/ecQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1na0cW-003RWw-Pq; Thu, 31 Mar 2022 19:38:12 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1na0cN-003RMt-81 for linux-rockchip@lists.infradead.org; Thu, 31 Mar 2022 19:38:05 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: nicolas) with ESMTPSA id 006D21F47261 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1648755482; bh=L/IEg8/gRB+ksIPpqGEbacLI5hKb4dkPkUIdTUf313k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W/QXCvRIJgWwkAyOdtpt3s+KdDjWzN0fnPFot3fGjyCOCG30P5KLMKziHPG2YxxPu DCoIhPqN3ATybHM3LGenjmN6zIDzeqdiPnoipRBZ/XkCZKVB2azOdDKNRk3MjVN99i CVw8tH6n6PiMGaBeQOpGOtIGhigO8Ec5KFKEk//TOgFm99TVrRqxl1wB4+W4Xb01JF g85nox2wUHoGKIVDmso4qQPZJcCvzKO85vJmaLJRxLuNvbSXjg3f6r03C/Ns/7edvC daZGOIkiSguY/SqYhgNZ7N18UdZ97Y0Kso0OcjYhay8Wz7oC36QCaQnt8y7+bk83OK 8r1MuPnkntV7Q== From: Nicolas Dufresne To: Ezequiel Garcia , Mauro Carvalho Chehab , Greg Kroah-Hartman Cc: kernel@collabora.com, Sebastian Fricke , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v2 17/23] media: rkvdec: Enable capture buffer holding for H264 Date: Thu, 31 Mar 2022 15:37:19 -0400 Message-Id: <20220331193726.289559-18-nicolas.dufresne@collabora.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220331193726.289559-1-nicolas.dufresne@collabora.com> References: <20220331193726.289559-1-nicolas.dufresne@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220331_123803_519662_3927A228 X-CRM114-Status: GOOD ( 11.86 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org In order to support interlaced video decoding, the driver must allow holding the capture buffer so that the second field can be decoded into it. Signed-off-by: Nicolas Dufresne Reviewed-by: Sebastian Fricke --- drivers/staging/media/rkvdec/rkvdec.c | 4 ++++ drivers/staging/media/rkvdec/rkvdec.h | 1 + 2 files changed, 5 insertions(+) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c index 1b805710e195..b6376eaa92d7 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -148,6 +148,7 @@ static const struct rkvdec_coded_fmt_desc rkvdec_coded_fmts[] = { .ops = &rkvdec_h264_fmt_ops, .num_decoded_fmts = ARRAY_SIZE(rkvdec_h264_vp9_decoded_fmts), .decoded_fmts = rkvdec_h264_vp9_decoded_fmts, + .subsystem_flags = VB2_V4L2_FL_SUPPORTS_M2M_HOLD_CAPTURE_BUF, }, { .fourcc = V4L2_PIX_FMT_VP9_FRAME, @@ -404,6 +405,9 @@ static int rkvdec_s_output_fmt(struct file *file, void *priv, cap_fmt->fmt.pix_mp.ycbcr_enc = f->fmt.pix_mp.ycbcr_enc; cap_fmt->fmt.pix_mp.quantization = f->fmt.pix_mp.quantization; + /* Enable format specific queue features */ + vq->subsystem_flags |= desc->subsystem_flags; + return 0; } diff --git a/drivers/staging/media/rkvdec/rkvdec.h b/drivers/staging/media/rkvdec/rkvdec.h index 2f4ea1786b93..e37f1a015fa0 100644 --- a/drivers/staging/media/rkvdec/rkvdec.h +++ b/drivers/staging/media/rkvdec/rkvdec.h @@ -81,6 +81,7 @@ struct rkvdec_coded_fmt_desc { const struct rkvdec_coded_fmt_ops *ops; unsigned int num_decoded_fmts; const u32 *decoded_fmts; + u32 subsystem_flags; }; struct rkvdec_dev {