Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp996456iob; Fri, 13 May 2022 19:02:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaSiOye+jKS7mdjqAcQjxGrZq/zQf3ystmuZxAfkeYRNbWfwMwZDPlxXtikeziYuyusSz1 X-Received: by 2002:adf:e5cd:0:b0:20a:f3d9:3376 with SMTP id a13-20020adfe5cd000000b0020af3d93376mr5943283wrn.228.1652493723375; Fri, 13 May 2022 19:02:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652493723; cv=none; d=google.com; s=arc-20160816; b=yISo0OES9cP4IPf4EtEZCdkeJcT+NU3+q84owdC5oLgOLXgLj7WXHI7bxvPu+7936+ 7F2LwpkI6c6ss/DQSFWf0RXofv3QjOP1v6HEvLhFZUu5n1CymAbndjYZiWzm4C7ruPyR /xSBVw8hLMFDr7lp/Bv2/ouyYFnojTBkFMUoDjQRhrQUn09hELN0klpOibYSZZ0hCr4r x2JzhBoUw9vkJkf+YJr0xHGIeu/25yaJgsGRvCCZkD1zohHDUyRt0hONTco9gCcCj452 5nyZqQDhiyiVf2NmRtXLafVeXg+AB0BF7MD6BF3G8gvespK8EDLmwiVWlxAivQmbDelZ jJgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=W3u4xI2aJW8qe5yv4b8CanPHAy+LqZ6naxE08CT0+AI=; b=YhaaGPMkcL64IiX0cNkQAccWjIu8pr9EJkIti7Cyj/r1ulfuATfCKrvp4dGxcfweB0 nJEiGVPBR5+BOpBuukZx1kgFsL5NJ09fxJGVCcbC4bBsbFqMxyu9D3QbGCPQXsMus2sm 81hNiB3B49oi8ocH3fd6W0p5UxpYymoUTD9Y7/2rF7UhRrl/Qf1+FCBdSB9SqbePjRS7 LtaHnOx1KBQwx1yatHBA/0ogKiPLxpfxJxj1Y27kdkg+DtCecuMyS9kaZKS/u9LHTnUB XwaV4/SmgfhFrXkRU4dxQFQOlFFuoEQ4pT8VFeQIZkiKRjjfkb64gIR89kNWMZahDzyh DZxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=fAOU94Qv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f9-20020a5d6649000000b0020cd58d7b4esi3261435wrw.777.2022.05.13.19.02.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 19:02:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=fAOU94Qv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 27B64477CD4; Fri, 13 May 2022 17:23:31 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384443AbiEMUcR (ORCPT + 99 others); Fri, 13 May 2022 16:32:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384489AbiEMUat (ORCPT ); Fri, 13 May 2022 16:30:49 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B01FB7B126; Fri, 13 May 2022 13:30:15 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: nicolas) with ESMTPSA id 556061F46480 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1652473801; bh=97qH9MAwt4IfrnTZaZQXT3dbPZPKSF1LMKpA5X+Ai/k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fAOU94QvsZuULWUCMD5y91dOEGbHjkpuyz4xFLajyvtMqF2+bqnHjaVjUQ6TmsEF1 PbOCu26qy7SRC13hkZwUCHq0+1mreVQyQHIJxwGvgvJBrtHtV+Qyw0VbLlyygkNTNh zDkqYi2Rq3Mj9NCP0QZA6tOS7YUK1EMBpXk7DXhwK2BrcDJ88oQbNadoZcMnG7WE+2 OCmqL1SknN71gqGccgItegAPjfq2HJRlL7LM6HeNOOjlDv7nsVa7ljQTaF3uI1Rcbm Nye7rk42/XaiF6/9mjjdVW63YpqNH7OKF7FC54UBpzBZnokZq0eivHSGmqFbxBETnL HdZ7HEA+rXMOw== From: Nicolas Dufresne To: Ezequiel Garcia , Mauro Carvalho Chehab , Greg Kroah-Hartman Cc: nicolas@ndufresne.ca, linux-media@vger.kernel.org, Sebastian Fricke , Hans Verkuil , linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v5 16/20] media: rkvdec: Enable capture buffer holding for H264 Date: Fri, 13 May 2022 16:29:18 -0400 Message-Id: <20220513202922.13846-17-nicolas.dufresne@collabora.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220513202922.13846-1-nicolas.dufresne@collabora.com> References: <20220513202922.13846-1-nicolas.dufresne@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 Signed-off-by: Hans Verkuil --- 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 2bc4b1a40989..7bab7586918c 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -127,6 +127,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, @@ -385,6 +386,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 9df0fba799a4..633335ebb9c4 100644 --- a/drivers/staging/media/rkvdec/rkvdec.h +++ b/drivers/staging/media/rkvdec/rkvdec.h @@ -82,6 +82,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 { -- 2.34.3