From nobody Thu Nov 14 05:54:24 2024 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C5F9EB64D9 for ; Tue, 4 Jul 2023 11:14:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230383AbjGDLO3 (ORCPT ); Tue, 4 Jul 2023 07:14:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231626AbjGDLN6 (ORCPT ); Tue, 4 Jul 2023 07:13:58 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66F3D10D5; Tue, 4 Jul 2023 04:13:48 -0700 (PDT) X-UUID: d59e4ea01a5b11ee9cb5633481061a41-20230704 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=/3W07IN0Dm+LWDFxMaYxCE+fSeL0MrbJUBJsDy0fKkk=; b=odcUJimL0Q+K76GET7b8yx/hSTEQgPxha+zXmdc6Y9piz3gnDchDhtGL/T5SqnN3deWBY/aRNWyeiz/gZWhnKDrEIYrJQwiWD442onZvhDDFAmZcqhyk0RXvF+f8qGg35T6zKrrHLZbCJp/cDwrdfP2YJ4TaMi3Y3l4HHACicyU=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.27,REQID:025fbfa5-83d2-4fb6-8426-4b09bc1005e2,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:70 X-CID-INFO: VERSION:1.1.27,REQID:025fbfa5-83d2-4fb6-8426-4b09bc1005e2,IP:0,URL :0,TC:0,Content:-25,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTI ON:quarantine,TS:70 X-CID-META: VersionHash:01c9525,CLOUDID:8a979cda-b4fa-43c8-9c3e-0d3fabd03ec0,B ulkID:2307041913447MZL42QK,BulkQuantity:0,Recheck:0,SF:17|19|48|38|29|28,T C:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 ,OSI:0,OSA:0,AV:0,LES:1,SPR:NO X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_FSD,TF_CID_SPAM_SNR,TF_CID_SPAM_SDM,TF_CID_SPAM_ASC, TF_CID_SPAM_FAS X-UUID: d59e4ea01a5b11ee9cb5633481061a41-20230704 Received: from mtkmbs14n2.mediatek.inc [(172.21.101.76)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1375567719; Tue, 04 Jul 2023 19:13:42 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Tue, 4 Jul 2023 19:13:40 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Tue, 4 Jul 2023 19:13:40 +0800 From: Yunfei Dong To: =?UTF-8?q?N=C3=ADcolas=20F=20=2E=20R=20=2E=20A=20=2E=20Prado?= , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Nathan Hebert CC: Yunfei Dong , Chen-Yu Tsai , Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , , , , , , Subject: [PATCH v5,11/11] media: mediatek: vcodec: separete decoder and encoder Date: Tue, 4 Jul 2023 19:13:27 +0800 Message-ID: <20230704111327.7140-12-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230704111327.7140-1-yunfei.dong@mediatek.com> References: <20230704111327.7140-1-yunfei.dong@mediatek.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Move all decoder files to folder video-decoder. Move all encoder files to folder video-encoder. Move common files which shared for encoder and decoder to folder video-comm= on. Change include header files and Makefile to fix build error. Signed-off-by: Yunfei Dong Reviewed-by: Nicolas Dufresne Reviewed-by: AngeloGioacchino Del Regno --- .../media/platform/mediatek/vcodec/Makefile | 55 +------------------ .../platform/mediatek/vcodec/common/Makefile | 21 +++++++ .../vcodec/{ =3D> common}/mtk_vcodec_com_drv.h | 0 .../vcodec/{ =3D> common}/mtk_vcodec_dbgfs.c | 4 +- .../vcodec/{ =3D> common}/mtk_vcodec_dbgfs.h | 0 .../vcodec/{ =3D> common}/mtk_vcodec_fw.c | 4 +- .../vcodec/{ =3D> common}/mtk_vcodec_fw.h | 2 +- .../vcodec/{ =3D> common}/mtk_vcodec_fw_priv.h | 0 .../vcodec/{ =3D> common}/mtk_vcodec_fw_scp.c | 4 +- .../vcodec/{ =3D> common}/mtk_vcodec_fw_vpu.c | 4 +- .../vcodec/{ =3D> common}/mtk_vcodec_intr.c | 4 +- .../vcodec/{ =3D> common}/mtk_vcodec_intr.h | 0 .../vcodec/{ =3D> common}/mtk_vcodec_util.c | 6 +- .../vcodec/{ =3D> common}/mtk_vcodec_util.h | 22 -------- .../platform/mediatek/vcodec/decoder/Makefile | 25 +++++++++ .../vcodec/{ =3D> decoder}/mtk_vcodec_dec.c | 0 .../vcodec/{ =3D> decoder}/mtk_vcodec_dec.h | 0 .../vcodec/{ =3D> decoder}/mtk_vcodec_dec_drv.c | 2 +- .../vcodec/{ =3D> decoder}/mtk_vcodec_dec_drv.h | 19 +++++-- .../vcodec/{ =3D> decoder}/mtk_vcodec_dec_hw.c | 2 +- .../vcodec/{ =3D> decoder}/mtk_vcodec_dec_hw.h | 0 .../vcodec/{ =3D> decoder}/mtk_vcodec_dec_pm.c | 0 .../vcodec/{ =3D> decoder}/mtk_vcodec_dec_pm.h | 0 .../{ =3D> decoder}/mtk_vcodec_dec_stateful.c | 0 .../{ =3D> decoder}/mtk_vcodec_dec_stateless.c | 0 .../{ =3D> decoder}/vdec/vdec_av1_req_lat_if.c | 2 +- .../vcodec/{ =3D> decoder}/vdec/vdec_h264_if.c | 2 +- .../{ =3D> decoder}/vdec/vdec_h264_req_common.c | 0 .../{ =3D> decoder}/vdec/vdec_h264_req_common.h | 0 .../{ =3D> decoder}/vdec/vdec_h264_req_if.c | 2 +- .../vdec/vdec_h264_req_multi_if.c | 2 +- .../vdec/vdec_hevc_req_multi_if.c | 2 +- .../vcodec/{ =3D> decoder}/vdec/vdec_vp8_if.c | 2 +- .../{ =3D> decoder}/vdec/vdec_vp8_req_if.c | 2 +- .../vcodec/{ =3D> decoder}/vdec/vdec_vp9_if.c | 2 +- .../{ =3D> decoder}/vdec/vdec_vp9_req_lat_if.c | 2 +- .../vcodec/{ =3D> decoder}/vdec_drv_base.h | 0 .../vcodec/{ =3D> decoder}/vdec_drv_if.c | 0 .../vcodec/{ =3D> decoder}/vdec_drv_if.h | 0 .../vcodec/{ =3D> decoder}/vdec_ipi_msg.h | 0 .../vcodec/{ =3D> decoder}/vdec_msg_queue.c | 0 .../vcodec/{ =3D> decoder}/vdec_msg_queue.h | 0 .../vcodec/{ =3D> decoder}/vdec_vpu_if.c | 0 .../vcodec/{ =3D> decoder}/vdec_vpu_if.h | 0 .../platform/mediatek/vcodec/encoder/Makefile | 11 ++++ .../vcodec/{ =3D> encoder}/mtk_vcodec_enc.c | 0 .../vcodec/{ =3D> encoder}/mtk_vcodec_enc.h | 0 .../vcodec/{ =3D> encoder}/mtk_vcodec_enc_drv.c | 2 +- .../vcodec/{ =3D> encoder}/mtk_vcodec_enc_drv.h | 19 +++++-- .../vcodec/{ =3D> encoder}/mtk_vcodec_enc_pm.c | 0 .../vcodec/{ =3D> encoder}/mtk_vcodec_enc_pm.h | 0 .../vcodec/{ =3D> encoder}/venc/venc_h264_if.c | 2 +- .../vcodec/{ =3D> encoder}/venc/venc_vp8_if.c | 2 +- .../vcodec/{ =3D> encoder}/venc_drv_base.h | 0 .../vcodec/{ =3D> encoder}/venc_drv_if.c | 0 .../vcodec/{ =3D> encoder}/venc_drv_if.h | 0 .../vcodec/{ =3D> encoder}/venc_ipi_msg.h | 0 .../vcodec/{ =3D> encoder}/venc_vpu_if.c | 0 .../vcodec/{ =3D> encoder}/venc_vpu_if.h | 0 59 files changed, 118 insertions(+), 110 deletions(-) create mode 100644 drivers/media/platform/mediatek/vcodec/common/Makefile rename drivers/media/platform/mediatek/vcodec/{ =3D> common}/mtk_vcodec_co= m_drv.h (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> common}/mtk_vcodec_db= gfs.c (98%) rename drivers/media/platform/mediatek/vcodec/{ =3D> common}/mtk_vcodec_db= gfs.h (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> common}/mtk_vcodec_fw= .c (95%) rename drivers/media/platform/mediatek/vcodec/{ =3D> common}/mtk_vcodec_fw= .h (97%) rename drivers/media/platform/mediatek/vcodec/{ =3D> common}/mtk_vcodec_fw= _priv.h (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> common}/mtk_vcodec_fw= _scp.c (96%) rename drivers/media/platform/mediatek/vcodec/{ =3D> common}/mtk_vcodec_fw= _vpu.c (97%) rename drivers/media/platform/mediatek/vcodec/{ =3D> common}/mtk_vcodec_in= tr.c (95%) rename drivers/media/platform/mediatek/vcodec/{ =3D> common}/mtk_vcodec_in= tr.h (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> common}/mtk_vcodec_ut= il.c (96%) rename drivers/media/platform/mediatek/vcodec/{ =3D> common}/mtk_vcodec_ut= il.h (72%) create mode 100644 drivers/media/platform/mediatek/vcodec/decoder/Makefile rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/mtk_vcodec_d= ec.c (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/mtk_vcodec_d= ec.h (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/mtk_vcodec_d= ec_drv.c (99%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/mtk_vcodec_d= ec_drv.h (93%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/mtk_vcodec_d= ec_hw.c (99%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/mtk_vcodec_d= ec_hw.h (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/mtk_vcodec_d= ec_pm.c (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/mtk_vcodec_d= ec_pm.h (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/mtk_vcodec_d= ec_stateful.c (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/mtk_vcodec_d= ec_stateless.c (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/vdec/vdec_av= 1_req_lat_if.c (99%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/vdec/vdec_h2= 64_if.c (99%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/vdec/vdec_h2= 64_req_common.c (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/vdec/vdec_h2= 64_req_common.h (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/vdec/vdec_h2= 64_req_if.c (99%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/vdec/vdec_h2= 64_req_multi_if.c (99%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/vdec/vdec_he= vc_req_multi_if.c (99%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/vdec/vdec_vp= 8_if.c (99%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/vdec/vdec_vp= 8_req_if.c (99%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/vdec/vdec_vp= 9_if.c (99%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/vdec/vdec_vp= 9_req_lat_if.c (99%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/vdec_drv_bas= e.h (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/vdec_drv_if.= c (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/vdec_drv_if.= h (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/vdec_ipi_msg= .h (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/vdec_msg_que= ue.c (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/vdec_msg_que= ue.h (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/vdec_vpu_if.= c (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> decoder}/vdec_vpu_if.= h (100%) create mode 100644 drivers/media/platform/mediatek/vcodec/encoder/Makefile rename drivers/media/platform/mediatek/vcodec/{ =3D> encoder}/mtk_vcodec_e= nc.c (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> encoder}/mtk_vcodec_e= nc.h (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> encoder}/mtk_vcodec_e= nc_drv.c (99%) rename drivers/media/platform/mediatek/vcodec/{ =3D> encoder}/mtk_vcodec_e= nc_drv.h (91%) rename drivers/media/platform/mediatek/vcodec/{ =3D> encoder}/mtk_vcodec_e= nc_pm.c (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> encoder}/mtk_vcodec_e= nc_pm.h (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> encoder}/venc/venc_h2= 64_if.c (99%) rename drivers/media/platform/mediatek/vcodec/{ =3D> encoder}/venc/venc_vp= 8_if.c (99%) rename drivers/media/platform/mediatek/vcodec/{ =3D> encoder}/venc_drv_bas= e.h (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> encoder}/venc_drv_if.= c (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> encoder}/venc_drv_if.= h (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> encoder}/venc_ipi_msg= .h (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> encoder}/venc_vpu_if.= c (100%) rename drivers/media/platform/mediatek/vcodec/{ =3D> encoder}/venc_vpu_if.= h (100%) diff --git a/drivers/media/platform/mediatek/vcodec/Makefile b/drivers/medi= a/platform/mediatek/vcodec/Makefile index 5f4c30fec85a..014abbfbd993 100644 --- a/drivers/media/platform/mediatek/vcodec/Makefile +++ b/drivers/media/platform/mediatek/vcodec/Makefile @@ -1,54 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 =20 -obj-$(CONFIG_VIDEO_MEDIATEK_VCODEC) +=3D mtk-vcodec-dec.o \ - mtk-vcodec-enc.o \ - mtk-vcodec-common.o \ - mtk-vcodec-dec-hw.o - -mtk-vcodec-dec-y :=3D vdec/vdec_h264_if.o \ - vdec/vdec_vp8_if.o \ - vdec/vdec_vp8_req_if.o \ - vdec/vdec_vp9_if.o \ - vdec/vdec_vp9_req_lat_if.o \ - vdec/vdec_av1_req_lat_if.o \ - vdec/vdec_h264_req_if.o \ - vdec/vdec_h264_req_common.o \ - vdec/vdec_h264_req_multi_if.o \ - vdec/vdec_hevc_req_multi_if.o \ - mtk_vcodec_dec_drv.o \ - vdec_drv_if.o \ - vdec_vpu_if.o \ - vdec_msg_queue.o \ - mtk_vcodec_dec.o \ - mtk_vcodec_dec_stateful.o \ - mtk_vcodec_dec_stateless.o \ - mtk_vcodec_dec_pm.o \ - -mtk-vcodec-dec-hw-y :=3D mtk_vcodec_dec_hw.o - -mtk-vcodec-enc-y :=3D venc/venc_vp8_if.o \ - venc/venc_h264_if.o \ - mtk_vcodec_enc.o \ - mtk_vcodec_enc_drv.o \ - mtk_vcodec_enc_pm.o \ - venc_drv_if.o \ - venc_vpu_if.o \ - - -mtk-vcodec-common-y :=3D mtk_vcodec_intr.o \ - mtk_vcodec_util.o \ - mtk_vcodec_fw.o \ - -ifneq ($(CONFIG_VIDEO_MEDIATEK_VCODEC_VPU),) -mtk-vcodec-common-y +=3D mtk_vcodec_fw_vpu.o -endif - -ifneq ($(CONFIG_VIDEO_MEDIATEK_VCODEC_SCP),) -mtk-vcodec-common-y +=3D mtk_vcodec_fw_scp.o -endif - -ifneq ($(CONFIG_DEBUG_FS),) -obj-$(CONFIG_VIDEO_MEDIATEK_VCODEC) +=3D mtk-vcodec-dbgfs.o - -mtk-vcodec-dbgfs-y :=3D mtk_vcodec_dbgfs.o -endif \ No newline at end of file +obj-y +=3D common/ +obj-y +=3D encoder/ +obj-y +=3D decoder/ diff --git a/drivers/media/platform/mediatek/vcodec/common/Makefile b/drive= rs/media/platform/mediatek/vcodec/common/Makefile new file mode 100644 index 000000000000..d0479914dfb3 --- /dev/null +++ b/drivers/media/platform/mediatek/vcodec/common/Makefile @@ -0,0 +1,21 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-$(CONFIG_VIDEO_MEDIATEK_VCODEC) +=3D mtk-vcodec-common.o + +mtk-vcodec-common-y :=3D mtk_vcodec_intr.o \ + mtk_vcodec_util.o \ + mtk_vcodec_fw.o \ + +ifneq ($(CONFIG_VIDEO_MEDIATEK_VCODEC_VPU),) +mtk-vcodec-common-y +=3D mtk_vcodec_fw_vpu.o +endif + +ifneq ($(CONFIG_VIDEO_MEDIATEK_VCODEC_SCP),) +mtk-vcodec-common-y +=3D mtk_vcodec_fw_scp.o +endif + +ifneq ($(CONFIG_DEBUG_FS),) +obj-$(CONFIG_VIDEO_MEDIATEK_VCODEC) +=3D mtk-vcodec-dbgfs.o + +mtk-vcodec-dbgfs-y :=3D mtk_vcodec_dbgfs.o +endif \ No newline at end of file diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_com_drv.h b/= drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_com_drv.h similarity index 100% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_com_drv.h rename to drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_com_drv.h diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c b/dr= ivers/media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c similarity index 98% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c rename to drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c index c6a02b33cc74..54d5accf87d2 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c +++ b/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c @@ -7,8 +7,8 @@ #include =20 #include "mtk_vcodec_dbgfs.h" -#include "mtk_vcodec_dec_drv.h" -#include "mtk_vcodec_enc_drv.h" +#include "../decoder/mtk_vcodec_dec_drv.h" +#include "../encoder/mtk_vcodec_enc_drv.h" #include "mtk_vcodec_util.h" =20 static void mtk_vdec_dbgfs_get_format_type(struct mtk_vcodec_dec_ctx *ctx,= char *buf, diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.h b/dr= ivers/media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.h similarity index 100% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.h rename to drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.h diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw.c b/drive= rs/media/platform/mediatek/vcodec/common/mtk_vcodec_fw.c similarity index 95% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw.c rename to drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw.c index de77c71f7e87..08949b08fbc6 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw.c +++ b/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 =20 -#include "mtk_vcodec_dec_drv.h" -#include "mtk_vcodec_enc_drv.h" +#include "../decoder/mtk_vcodec_dec_drv.h" +#include "../encoder/mtk_vcodec_enc_drv.h" #include "mtk_vcodec_fw_priv.h" =20 struct mtk_vcodec_fw *mtk_vcodec_fw_select(void *priv, enum mtk_vcodec_fw_= type type, diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw.h b/drive= rs/media/platform/mediatek/vcodec/common/mtk_vcodec_fw.h similarity index 97% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw.h rename to drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw.h index 83479ab70385..300363a40158 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw.h +++ b/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw.h @@ -6,7 +6,7 @@ #include #include =20 -#include "../vpu/mtk_vpu.h" +#include "../../vpu/mtk_vpu.h" =20 struct mtk_vcodec_dec_dev; struct mtk_vcodec_enc_dev; diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw_priv.h b/= drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_priv.h similarity index 100% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw_priv.h rename to drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_priv.h diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw_scp.c b/d= rivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_scp.c similarity index 96% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw_scp.c rename to drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_scp.c index 3cb5a5befd24..9e744d07a1e8 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw_scp.c +++ b/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_scp.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 =20 -#include "mtk_vcodec_dec_drv.h" -#include "mtk_vcodec_enc_drv.h" +#include "../decoder/mtk_vcodec_dec_drv.h" +#include "../encoder/mtk_vcodec_enc_drv.h" #include "mtk_vcodec_fw_priv.h" =20 static int mtk_vcodec_scp_load_firmware(struct mtk_vcodec_fw *fw) diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw_vpu.c b/d= rivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_vpu.c similarity index 97% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw_vpu.c rename to drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_vpu.c index 18274a51a8f8..5e03b0886559 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_fw_vpu.c +++ b/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_fw_vpu.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 =20 -#include "mtk_vcodec_dec_drv.h" -#include "mtk_vcodec_enc_drv.h" +#include "../decoder/mtk_vcodec_dec_drv.h" +#include "../encoder/mtk_vcodec_enc_drv.h" #include "mtk_vcodec_fw_priv.h" =20 static int mtk_vcodec_vpu_load_firmware(struct mtk_vcodec_fw *fw) diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_intr.c b/dri= vers/media/platform/mediatek/vcodec/common/mtk_vcodec_intr.c similarity index 95% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_intr.c rename to drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_intr.c index 1c63fbbec653..3c4e79bf04de 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_intr.c +++ b/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_intr.c @@ -7,8 +7,8 @@ #include #include =20 -#include "mtk_vcodec_dec_drv.h" -#include "mtk_vcodec_enc_drv.h" +#include "../decoder/mtk_vcodec_dec_drv.h" +#include "../encoder/mtk_vcodec_enc_drv.h" #include "mtk_vcodec_intr.h" =20 int mtk_vcodec_wait_for_done_ctx(void *priv, int command, unsigned int tim= eout_ms, diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_intr.h b/dri= vers/media/platform/mediatek/vcodec/common/mtk_vcodec_intr.h similarity index 100% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_intr.h rename to drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_intr.h diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.c b/dri= vers/media/platform/mediatek/vcodec/common/mtk_vcodec_util.c similarity index 96% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.c rename to drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_util.c index f6eba7163fdf..de6857ab6502 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.c +++ b/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_util.c @@ -9,9 +9,9 @@ #include #include =20 -#include "mtk_vcodec_dec_drv.h" -#include "mtk_vcodec_enc_drv.h" -#include "mtk_vcodec_dec_hw.h" +#include "../decoder/mtk_vcodec_dec_drv.h" +#include "../encoder/mtk_vcodec_enc_drv.h" +#include "../decoder/mtk_vcodec_dec_hw.h" =20 #if defined(CONFIG_DEBUG_FS) int mtk_vcodec_dbg; diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.h b/dri= vers/media/platform/mediatek/vcodec/common/mtk_vcodec_util.h similarity index 72% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.h rename to drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_util.h index 27fe2363373a..af87c2606dcc 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.h +++ b/drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_util.h @@ -61,28 +61,6 @@ extern int mtk_vcodec_dbg; dev_dbg(&(plat_dev)->dev, "[MTK_VCODEC][%d]: " fmt "\n", inst_id, ##args) #endif =20 -#define mtk_vdec_err(ctx, fmt, args...) \ - mtk_vcodec_err((ctx)->id, (ctx)->dev->plat_dev, fmt, ##args) - -#define mtk_vdec_debug(ctx, fmt, args...) \ - mtk_vcodec_debug((ctx)->id, (ctx)->dev->plat_dev, fmt, ##args) - -#define mtk_venc_err(ctx, fmt, args...) \ - mtk_vcodec_err((ctx)->id, (ctx)->dev->plat_dev, fmt, ##args) - -#define mtk_venc_debug(ctx, fmt, args...) \ - mtk_vcodec_debug((ctx)->id, (ctx)->dev->plat_dev, fmt, ##args) - -#define mtk_v4l2_vdec_err(ctx, fmt, args...) mtk_v4l2_err((ctx)->dev->plat= _dev, fmt, ##args) - -#define mtk_v4l2_vdec_dbg(level, ctx, fmt, args...) \ - mtk_v4l2_debug((ctx)->dev->plat_dev, level, fmt, ##args) - -#define mtk_v4l2_venc_err(ctx, fmt, args...) mtk_v4l2_err((ctx)->dev->plat= _dev, fmt, ##args) - -#define mtk_v4l2_venc_dbg(level, ctx, fmt, args...) \ - mtk_v4l2_debug((ctx)->dev->plat_dev, level, fmt, ##args) - void __iomem *mtk_vcodec_get_reg_addr(void __iomem **reg_base, unsigned in= t reg_idx); int mtk_vcodec_mem_alloc(void *priv, struct mtk_vcodec_mem *mem); void mtk_vcodec_mem_free(void *priv, struct mtk_vcodec_mem *mem); diff --git a/drivers/media/platform/mediatek/vcodec/decoder/Makefile b/driv= ers/media/platform/mediatek/vcodec/decoder/Makefile new file mode 100644 index 000000000000..904cd22def84 --- /dev/null +++ b/drivers/media/platform/mediatek/vcodec/decoder/Makefile @@ -0,0 +1,25 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-$(CONFIG_VIDEO_MEDIATEK_VCODEC) +=3D mtk-vcodec-dec.o \ + mtk-vcodec-dec-hw.o + +mtk-vcodec-dec-y :=3D vdec/vdec_h264_if.o \ + vdec/vdec_vp8_if.o \ + vdec/vdec_vp8_req_if.o \ + vdec/vdec_vp9_if.o \ + vdec/vdec_vp9_req_lat_if.o \ + vdec/vdec_av1_req_lat_if.o \ + vdec/vdec_h264_req_if.o \ + vdec/vdec_h264_req_common.o \ + vdec/vdec_h264_req_multi_if.o \ + vdec/vdec_hevc_req_multi_if.o \ + mtk_vcodec_dec_drv.o \ + vdec_drv_if.o \ + vdec_vpu_if.o \ + vdec_msg_queue.o \ + mtk_vcodec_dec.o \ + mtk_vcodec_dec_stateful.o \ + mtk_vcodec_dec_stateless.o \ + mtk_vcodec_dec_pm.o \ + +mtk-vcodec-dec-hw-y :=3D mtk_vcodec_dec_hw.o diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c b/driv= ers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec.c similarity index 100% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c rename to drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec.c diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.h b/driv= ers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec.h similarity index 100% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.h rename to drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec.h diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c b/= drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c similarity index 99% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c rename to drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv= .c index 36970113d069..6ee319762418 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c @@ -20,7 +20,7 @@ #include "mtk_vcodec_dec.h" #include "mtk_vcodec_dec_hw.h" #include "mtk_vcodec_dec_pm.h" -#include "mtk_vcodec_intr.h" +#include "../common/mtk_vcodec_intr.h" =20 static int mtk_vcodec_get_hw_count(struct mtk_vcodec_dec_ctx *ctx, struct = mtk_vcodec_dec_dev *dev) { diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.h b/= drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.h similarity index 93% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.h rename to drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv= .h index 36a4cfa622f5..160f8da56293 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.h +++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.h @@ -7,10 +7,10 @@ #ifndef _MTK_VCODEC_DEC_DRV_H_ #define _MTK_VCODEC_DEC_DRV_H_ =20 -#include "mtk_vcodec_com_drv.h" -#include "mtk_vcodec_dbgfs.h" -#include "mtk_vcodec_fw_priv.h" -#include "mtk_vcodec_util.h" +#include "../common/mtk_vcodec_com_drv.h" +#include "../common/mtk_vcodec_dbgfs.h" +#include "../common/mtk_vcodec_fw_priv.h" +#include "../common/mtk_vcodec_util.h" #include "vdec_msg_queue.h" =20 #define MTK_VCODEC_DEC_NAME "mtk-vcodec-dec" @@ -301,4 +301,15 @@ wake_up_dec_ctx(struct mtk_vcodec_dec_ctx *ctx, unsign= ed int reason, unsigned in wake_up_interruptible(&ctx->queue[hw_id]); } =20 +#define mtk_vdec_err(ctx, fmt, args...) \ + mtk_vcodec_err((ctx)->id, (ctx)->dev->plat_dev, fmt, ##args) + +#define mtk_vdec_debug(ctx, fmt, args...) \ + mtk_vcodec_debug((ctx)->id, (ctx)->dev->plat_dev, fmt, ##args) + +#define mtk_v4l2_vdec_err(ctx, fmt, args...) mtk_v4l2_err((ctx)->dev->plat= _dev, fmt, ##args) + +#define mtk_v4l2_vdec_dbg(level, ctx, fmt, args...) \ + mtk_v4l2_debug((ctx)->dev->plat_dev, level, fmt, ##args) + #endif /* _MTK_VCODEC_DEC_DRV_H_ */ diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c b/d= rivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_hw.c similarity index 99% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c rename to drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_hw.c index fa02fcf4e8c2..4f05a179970c 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_hw.c @@ -15,7 +15,7 @@ #include "mtk_vcodec_dec.h" #include "mtk_vcodec_dec_hw.h" #include "mtk_vcodec_dec_pm.h" -#include "mtk_vcodec_intr.h" +#include "../common/mtk_vcodec_intr.h" =20 static const struct of_device_id mtk_vdec_hw_match[] =3D { { diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.h b/d= rivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_hw.h similarity index 100% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.h rename to drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_hw.h diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_pm.c b/d= rivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_pm.c similarity index 100% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_pm.c rename to drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_pm.c diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_pm.h b/d= rivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_pm.h similarity index 100% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_pm.h rename to drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_pm.h diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateful= .c b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateful= .c similarity index 100% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateful.c rename to drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_sta= teful.c diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateles= s.c b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_statele= ss.c similarity index 100% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateless= .c rename to drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_sta= teless.c diff --git a/drivers/media/platform/mediatek/vcodec/vdec/vdec_av1_req_lat_i= f.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_av1_req_lat_= if.c similarity index 99% rename from drivers/media/platform/mediatek/vcodec/vdec/vdec_av1_req_lat_if= .c rename to drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_av1_req_= lat_if.c index e7ae2dc8f6bf..cc267589d192 100644 --- a/drivers/media/platform/mediatek/vcodec/vdec/vdec_av1_req_lat_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_av1_req_lat_= if.c @@ -9,7 +9,7 @@ #include =20 #include "../mtk_vcodec_dec.h" -#include "../mtk_vcodec_intr.h" +#include "../../common/mtk_vcodec_intr.h" #include "../vdec_drv_base.h" #include "../vdec_drv_if.h" #include "../vdec_vpu_if.h" diff --git a/drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_if.c b/d= rivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_if.c similarity index 99% rename from drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_if.c rename to drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_if.c index a8175f977ed2..bf7dffe60d07 100644 --- a/drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_if.c @@ -9,7 +9,7 @@ =20 #include "../vdec_drv_if.h" #include "../mtk_vcodec_dec.h" -#include "../mtk_vcodec_intr.h" +#include "../../common/mtk_vcodec_intr.h" #include "../vdec_vpu_if.h" #include "../vdec_drv_base.h" =20 diff --git a/drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_req_comm= on.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_co= mmon.c similarity index 100% rename from drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_req_commo= n.c rename to drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req= _common.c diff --git a/drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_req_comm= on.h b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_co= mmon.h similarity index 100% rename from drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_req_commo= n.h rename to drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req= _common.h diff --git a/drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_req_if.c= b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_if.c similarity index 99% rename from drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_req_if.c rename to drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req= _if.c index 4c5ef35199a1..5600f1df653d 100644 --- a/drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_req_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_if.c @@ -7,7 +7,7 @@ #include =20 #include "../mtk_vcodec_dec.h" -#include "../mtk_vcodec_intr.h" +#include "../../common/mtk_vcodec_intr.h" #include "../vdec_drv_base.h" #include "../vdec_drv_if.h" #include "../vdec_vpu_if.h" diff --git a/drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_req_mult= i_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_= multi_if.c similarity index 99% rename from drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_req_multi= _if.c rename to drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req= _multi_if.c index 0f9f7b56882f..0e741e0dc8ba 100644 --- a/drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_req_multi_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_mul= ti_if.c @@ -11,7 +11,7 @@ #include =20 #include "../mtk_vcodec_dec.h" -#include "../mtk_vcodec_intr.h" +#include "../../common/mtk_vcodec_intr.h" #include "../vdec_drv_base.h" #include "../vdec_drv_if.h" #include "../vdec_vpu_if.h" diff --git a/drivers/media/platform/mediatek/vcodec/vdec/vdec_hevc_req_mult= i_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_hevc_req_= multi_if.c similarity index 99% rename from drivers/media/platform/mediatek/vcodec/vdec/vdec_hevc_req_multi= _if.c rename to drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_hevc_req= _multi_if.c index 2682f40d1361..06ed47df693b 100644 --- a/drivers/media/platform/mediatek/vcodec/vdec/vdec_hevc_req_multi_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_hevc_req_mul= ti_if.c @@ -9,7 +9,7 @@ #include =20 #include "../mtk_vcodec_dec.h" -#include "../mtk_vcodec_intr.h" +#include "../../common/mtk_vcodec_intr.h" #include "../vdec_drv_base.h" #include "../vdec_drv_if.h" #include "../vdec_vpu_if.h" diff --git a/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp8_if.c b/dr= ivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_if.c similarity index 99% rename from drivers/media/platform/mediatek/vcodec/vdec/vdec_vp8_if.c rename to drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_if.c index 5beb58f97905..32ca5b89a39b 100644 --- a/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp8_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_if.c @@ -8,7 +8,7 @@ #include #include "../vdec_drv_if.h" #include "../mtk_vcodec_dec.h" -#include "../mtk_vcodec_intr.h" +#include "../../common/mtk_vcodec_intr.h" #include "../vdec_vpu_if.h" #include "../vdec_drv_base.h" =20 diff --git a/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp8_req_if.c = b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_req_if.c similarity index 99% rename from drivers/media/platform/mediatek/vcodec/vdec/vdec_vp8_req_if.c rename to drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_req_= if.c index c85c849d2548..f64b21c07169 100644 --- a/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp8_req_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_req_if.c @@ -10,7 +10,7 @@ #include =20 #include "../mtk_vcodec_dec.h" -#include "../mtk_vcodec_intr.h" +#include "../../common/mtk_vcodec_intr.h" #include "../vdec_drv_base.h" #include "../vdec_drv_if.h" #include "../vdec_vpu_if.h" diff --git a/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c b/dr= ivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_if.c similarity index 99% rename from drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c rename to drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_if.c index d3493d36329d..5780052d9b38 100644 --- a/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_if.c @@ -12,7 +12,7 @@ #include #include =20 -#include "../mtk_vcodec_intr.h" +#include "../../common/mtk_vcodec_intr.h" #include "../vdec_drv_base.h" #include "../vdec_vpu_if.h" =20 diff --git a/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_req_lat_i= f.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_= if.c similarity index 99% rename from drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_req_lat_if= .c rename to drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_= lat_if.c index 3e9458470484..e393e3e668f8 100644 --- a/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_req_lat_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_= if.c @@ -10,7 +10,7 @@ #include =20 #include "../mtk_vcodec_dec.h" -#include "../mtk_vcodec_intr.h" +#include "../../common/mtk_vcodec_intr.h" #include "../vdec_drv_base.h" #include "../vdec_drv_if.h" #include "../vdec_vpu_if.h" diff --git a/drivers/media/platform/mediatek/vcodec/vdec_drv_base.h b/drive= rs/media/platform/mediatek/vcodec/decoder/vdec_drv_base.h similarity index 100% rename from drivers/media/platform/mediatek/vcodec/vdec_drv_base.h rename to drivers/media/platform/mediatek/vcodec/decoder/vdec_drv_base.h diff --git a/drivers/media/platform/mediatek/vcodec/vdec_drv_if.c b/drivers= /media/platform/mediatek/vcodec/decoder/vdec_drv_if.c similarity index 100% rename from drivers/media/platform/mediatek/vcodec/vdec_drv_if.c rename to drivers/media/platform/mediatek/vcodec/decoder/vdec_drv_if.c diff --git a/drivers/media/platform/mediatek/vcodec/vdec_drv_if.h b/drivers= /media/platform/mediatek/vcodec/decoder/vdec_drv_if.h similarity index 100% rename from drivers/media/platform/mediatek/vcodec/vdec_drv_if.h rename to drivers/media/platform/mediatek/vcodec/decoder/vdec_drv_if.h diff --git a/drivers/media/platform/mediatek/vcodec/vdec_ipi_msg.h b/driver= s/media/platform/mediatek/vcodec/decoder/vdec_ipi_msg.h similarity index 100% rename from drivers/media/platform/mediatek/vcodec/vdec_ipi_msg.h rename to drivers/media/platform/mediatek/vcodec/decoder/vdec_ipi_msg.h diff --git a/drivers/media/platform/mediatek/vcodec/vdec_msg_queue.c b/driv= ers/media/platform/mediatek/vcodec/decoder/vdec_msg_queue.c similarity index 100% rename from drivers/media/platform/mediatek/vcodec/vdec_msg_queue.c rename to drivers/media/platform/mediatek/vcodec/decoder/vdec_msg_queue.c diff --git a/drivers/media/platform/mediatek/vcodec/vdec_msg_queue.h b/driv= ers/media/platform/mediatek/vcodec/decoder/vdec_msg_queue.h similarity index 100% rename from drivers/media/platform/mediatek/vcodec/vdec_msg_queue.h rename to drivers/media/platform/mediatek/vcodec/decoder/vdec_msg_queue.h diff --git a/drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c b/drivers= /media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c similarity index 100% rename from drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c rename to drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c diff --git a/drivers/media/platform/mediatek/vcodec/vdec_vpu_if.h b/drivers= /media/platform/mediatek/vcodec/decoder/vdec_vpu_if.h similarity index 100% rename from drivers/media/platform/mediatek/vcodec/vdec_vpu_if.h rename to drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.h diff --git a/drivers/media/platform/mediatek/vcodec/encoder/Makefile b/driv= ers/media/platform/mediatek/vcodec/encoder/Makefile new file mode 100644 index 000000000000..e621b5b7e5e6 --- /dev/null +++ b/drivers/media/platform/mediatek/vcodec/encoder/Makefile @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-$(CONFIG_VIDEO_MEDIATEK_VCODEC) +=3D mtk-vcodec-enc.o + +mtk-vcodec-enc-y :=3D venc/venc_vp8_if.o \ + venc/venc_h264_if.o \ + mtk_vcodec_enc.o \ + mtk_vcodec_enc_drv.o \ + mtk_vcodec_enc_pm.o \ + venc_drv_if.o \ + venc_vpu_if.o \ diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c b/driv= ers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc.c similarity index 100% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.c rename to drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc.c diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.h b/driv= ers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc.h similarity index 100% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc.h rename to drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc.h diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c b/= drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_drv.c similarity index 99% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c rename to drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_drv= .c index f1b4d5e8cd49..5db2bf3db4c5 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c +++ b/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_drv.c @@ -18,7 +18,7 @@ =20 #include "mtk_vcodec_enc.h" #include "mtk_vcodec_enc_pm.h" -#include "mtk_vcodec_intr.h" +#include "../common/mtk_vcodec_intr.h" =20 static const struct mtk_video_fmt mtk_video_formats_output[] =3D { { diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.h b/= drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_drv.h similarity index 91% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.h rename to drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_drv= .h index fcd3d9b271ea..ec1d1fe6b3e7 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.h +++ b/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_drv.h @@ -7,10 +7,10 @@ #ifndef _MTK_VCODEC_ENC_DRV_H_ #define _MTK_VCODEC_ENC_DRV_H_ =20 -#include "mtk_vcodec_com_drv.h" -#include "mtk_vcodec_dbgfs.h" -#include "mtk_vcodec_fw_priv.h" -#include "mtk_vcodec_util.h" +#include "../common/mtk_vcodec_com_drv.h" +#include "../common/mtk_vcodec_dbgfs.h" +#include "../common/mtk_vcodec_fw_priv.h" +#include "../common/mtk_vcodec_util.h" =20 #define MTK_VCODEC_ENC_NAME "mtk-vcodec-enc" =20 @@ -232,4 +232,15 @@ wake_up_enc_ctx(struct mtk_vcodec_enc_ctx *ctx, unsign= ed int reason, unsigned in wake_up_interruptible(&ctx->queue[hw_id]); } =20 +#define mtk_venc_err(ctx, fmt, args...) \ + mtk_vcodec_err((ctx)->id, (ctx)->dev->plat_dev, fmt, ##args) + +#define mtk_venc_debug(ctx, fmt, args...) \ + mtk_vcodec_debug((ctx)->id, (ctx)->dev->plat_dev, fmt, ##args) + +#define mtk_v4l2_venc_err(ctx, fmt, args...) mtk_v4l2_err((ctx)->dev->plat= _dev, fmt, ##args) + +#define mtk_v4l2_venc_dbg(level, ctx, fmt, args...) \ + mtk_v4l2_debug((ctx)->dev->plat_dev, level, fmt, ##args) + #endif /* _MTK_VCODEC_ENC_DRV_H_ */ diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_pm.c b/d= rivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_pm.c similarity index 100% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_pm.c rename to drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_pm.c diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_pm.h b/d= rivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_pm.h similarity index 100% rename from drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_pm.h rename to drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_pm.h diff --git a/drivers/media/platform/mediatek/vcodec/venc/venc_h264_if.c b/d= rivers/media/platform/mediatek/vcodec/encoder/venc/venc_h264_if.c similarity index 99% rename from drivers/media/platform/mediatek/vcodec/venc/venc_h264_if.c rename to drivers/media/platform/mediatek/vcodec/encoder/venc/venc_h264_if.c index 9127bceb0db4..a68dac72c4e4 100644 --- a/drivers/media/platform/mediatek/vcodec/venc/venc_h264_if.c +++ b/drivers/media/platform/mediatek/vcodec/encoder/venc/venc_h264_if.c @@ -11,7 +11,7 @@ #include =20 #include "../mtk_vcodec_enc_drv.h" -#include "../mtk_vcodec_intr.h" +#include "../../common/mtk_vcodec_intr.h" #include "../mtk_vcodec_enc.h" #include "../mtk_vcodec_enc_pm.h" #include "../venc_drv_base.h" diff --git a/drivers/media/platform/mediatek/vcodec/venc/venc_vp8_if.c b/dr= ivers/media/platform/mediatek/vcodec/encoder/venc/venc_vp8_if.c similarity index 99% rename from drivers/media/platform/mediatek/vcodec/venc/venc_vp8_if.c rename to drivers/media/platform/mediatek/vcodec/encoder/venc/venc_vp8_if.c index 510f3b042670..05abca91e742 100644 --- a/drivers/media/platform/mediatek/vcodec/venc/venc_vp8_if.c +++ b/drivers/media/platform/mediatek/vcodec/encoder/venc/venc_vp8_if.c @@ -10,7 +10,7 @@ #include =20 #include "../mtk_vcodec_enc_drv.h" -#include "../mtk_vcodec_intr.h" +#include "../../common/mtk_vcodec_intr.h" #include "../mtk_vcodec_enc.h" #include "../mtk_vcodec_enc_pm.h" #include "../venc_drv_base.h" diff --git a/drivers/media/platform/mediatek/vcodec/venc_drv_base.h b/drive= rs/media/platform/mediatek/vcodec/encoder/venc_drv_base.h similarity index 100% rename from drivers/media/platform/mediatek/vcodec/venc_drv_base.h rename to drivers/media/platform/mediatek/vcodec/encoder/venc_drv_base.h diff --git a/drivers/media/platform/mediatek/vcodec/venc_drv_if.c b/drivers= /media/platform/mediatek/vcodec/encoder/venc_drv_if.c similarity index 100% rename from drivers/media/platform/mediatek/vcodec/venc_drv_if.c rename to drivers/media/platform/mediatek/vcodec/encoder/venc_drv_if.c diff --git a/drivers/media/platform/mediatek/vcodec/venc_drv_if.h b/drivers= /media/platform/mediatek/vcodec/encoder/venc_drv_if.h similarity index 100% rename from drivers/media/platform/mediatek/vcodec/venc_drv_if.h rename to drivers/media/platform/mediatek/vcodec/encoder/venc_drv_if.h diff --git a/drivers/media/platform/mediatek/vcodec/venc_ipi_msg.h b/driver= s/media/platform/mediatek/vcodec/encoder/venc_ipi_msg.h similarity index 100% rename from drivers/media/platform/mediatek/vcodec/venc_ipi_msg.h rename to drivers/media/platform/mediatek/vcodec/encoder/venc_ipi_msg.h diff --git a/drivers/media/platform/mediatek/vcodec/venc_vpu_if.c b/drivers= /media/platform/mediatek/vcodec/encoder/venc_vpu_if.c similarity index 100% rename from drivers/media/platform/mediatek/vcodec/venc_vpu_if.c rename to drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c diff --git a/drivers/media/platform/mediatek/vcodec/venc_vpu_if.h b/drivers= /media/platform/mediatek/vcodec/encoder/venc_vpu_if.h similarity index 100% rename from drivers/media/platform/mediatek/vcodec/venc_vpu_if.h rename to drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.h --=20 2.18.0