Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2100030pxb; Sat, 22 Jan 2022 16:15:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5qZj4EYCsS2xcdY88DxzTbI1HvhXB9HzKFHVIdGbm1LoIxc4pLhNFWFudTFw9aepTjqGo X-Received: by 2002:aa7:8d57:0:b0:4c8:fd85:665b with SMTP id s23-20020aa78d57000000b004c8fd85665bmr119341pfe.49.1642896944856; Sat, 22 Jan 2022 16:15:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642896944; cv=none; d=google.com; s=arc-20160816; b=JGvK+gu35dJzNxfcfw2MB02D+zdfISemjhexgTpxvmCTbI4+BOV4Jq+ZdVIj/t2Xkw tnP9kKv5uC0a1I1DU+Hdq8c7h44mgNcSt0i4oZWGHZruyqzVztICHzT8KQ528dq/RIHZ h3x3QOMEgLanINv30o9e1J3a7gxFF6KdD5uu5VwTUCtb+2S+K4Z7nvz72IGclFQYKj89 qewJ5zplDHtR5/rbDg3YV55Aqt724GTN5ImtiBbxH5TiUkR1vFlsquwe991qstVuXu9a PE9vd5SmrfQ861RzsGqSb1D7htr+8sFZ3ZvF73maopy1NCUYzdFwgr4TA4HaIo2hfJtZ EbNg== 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; bh=9yNgu/9nuOhAjWyduo831fLxCCvawcsIf/Cwa4nxuZs=; b=a2LV/Gx4ve9/Bn54kHuSWzyN54iYy4UmNhjqrZ69nUqNQ2XKuatd44lesPoCAWw2wh KR1YhDAqlG/d+OkOH7gYMpZpHBDQjw3wIHHXnFAFJ0iXtJaIE83V2WZFg8YyC4poKUo7 nWxpxDacF7PXAEN1sN+jL6g1HqhKiYTnobZFSFv1pNSRs+He5wyc5pZ3nBCdPY8gRgyp /MAvAUlwR74dnlttacKkQUCFWkbiGE4iVXXYMnKDEaHUWPSKGRAj4DyWnXvhlXHhcfsq d5PCCGIZeRey4GemD56I5PZvlXxvi9YFjPcHYWBj+MjEIhQWiN7eoV6lpmb2Qr3Z+X66 HQ1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f23si9787329pgm.194.2022.01.22.16.15.32; Sat, 22 Jan 2022 16:15:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232957AbiAVDxz (ORCPT + 99 others); Fri, 21 Jan 2022 22:53:55 -0500 Received: from mailgw01.mediatek.com ([60.244.123.138]:58278 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S232642AbiAVDxm (ORCPT ); Fri, 21 Jan 2022 22:53:42 -0500 X-UUID: 18bb84f006674360a7cfc65dffd72b60-20220122 X-UUID: 18bb84f006674360a7cfc65dffd72b60-20220122 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 923439829; Sat, 22 Jan 2022 11:53:38 +0800 Received: from mtkexhb01.mediatek.inc (172.21.101.102) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.3; Sat, 22 Jan 2022 11:53:36 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkexhb01.mediatek.inc (172.21.101.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 22 Jan 2022 11:53:36 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sat, 22 Jan 2022 11:53:34 +0800 From: Yunfei Dong To: Yunfei Dong , Alexandre Courbot , Hans Verkuil , "Tzung-Bi Shih" , Tiffany Lin , Andrew-CT Chen , Mauro Carvalho Chehab , Rob Herring , Matthias Brugger , Tomasz Figa CC: George Sun , Xiaoyong Lu , Hsin-Yi Wang , Fritz Koenig , Dafna Hirschfeld , Benjamin Gaignard , Daniel Vetter , dri-devel , Irui Wang , AngeloGioacchino Del Regno , Steve Cho , , , , , , , Subject: [PATCH v6, 11/15] media: mtk-vcodec: record capture queue format type Date: Sat, 22 Jan 2022 11:53:12 +0800 Message-ID: <20220122035316.18179-12-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220122035316.18179-1-yunfei.dong@mediatek.com> References: <20220122035316.18179-1-yunfei.dong@mediatek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Capture queue format type is difference for different platform, need to calculate capture buffer size according to capture queue format type in scp. Signed-off-by: Yunfei Dong --- drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c | 2 ++ drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c index 5a429ed83ed4..6ad17e69e32d 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c @@ -468,6 +468,8 @@ static int vidioc_vdec_s_fmt(struct file *file, void *priv, } ctx->state = MTK_STATE_INIT; } + } else { + ctx->capture_fourcc = fmt->fourcc; } /* diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h index aa608ab0a247..fde79684106d 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h @@ -277,6 +277,7 @@ struct vdec_pic_info { * to be used with encoder and stateful decoder. * @is_flushing: set to true if flushing is in progress. * @current_codec: current set input codec, in V4L2 pixel format + * @capture_fourcc: capture queue type in V4L2 pixel format * * @colorspace: enum v4l2_colorspace; supplemental to pixelformat * @ycbcr_enc: enum v4l2_ycbcr_encoding, Y'CbCr encoding @@ -324,6 +325,7 @@ struct mtk_vcodec_ctx { bool is_flushing; u32 current_codec; + u32 capture_fourcc; enum v4l2_colorspace colorspace; enum v4l2_ycbcr_encoding ycbcr_enc; -- 2.25.1