From patchwork Tue Jun 4 09:37:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Courbot X-Patchwork-Id: 10974521 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 2072D2D49 for ; Tue, 4 Jun 2019 09:38:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C75020000 for ; Tue, 4 Jun 2019 09:38:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F408A287CB; Tue, 4 Jun 2019 09:38:23 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 1869B20000 for ; Tue, 4 Jun 2019 09:38:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727083AbfFDJh5 (ORCPT ); Tue, 4 Jun 2019 05:37:57 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:33390 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727075AbfFDJh5 (ORCPT ); Tue, 4 Jun 2019 05:37:57 -0400 Received: by mail-pl1-f193.google.com with SMTP id g21so8133431plq.0 for ; Tue, 04 Jun 2019 02:37:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sIoU7gP/ydA8ZV1fiZDJ6HrGNHmRPDa9rv/vIiUfTF0=; b=Uot+9vJdEmTcuRxGvdr7qc/RGnNFcr7op28BWnivJPgW82bw6tEgF6E6LlZEdE9JCt oBeEBqsuqZWKOy9CsGjFsMeo0Ca/sOgQX+xz1jcWjWFM7/3pAdTkNXW7Hwz8iiHQq7uV H8vGkLEUE4M2VX5PCEmS7IIesdhcsj/CiOFnE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sIoU7gP/ydA8ZV1fiZDJ6HrGNHmRPDa9rv/vIiUfTF0=; b=PcWxNbLcP1LMucIKBZxyMS6rAyyg32xE1Jbw4L2X82ZQ8iB0tHo7NeA2VvNE5u9KA6 dTcyGIKQVCdBbya3MoN9oVSmxjgPY86qBhw1xw4wINgSmP63VZnXbp58v1rTK3AY9taN eKPoY4/Z4kfOcZCQKN/BqqP/M4vEVnVTBlBiIrLyyzsjpct0PE0CcqXiseNqwqvi2rzN 7xgX26tI+nIrL2Uibprs4Wl6ox6J9stq2LRL9w4qIg2P2iDvDu2geamCsykK+ka5rdtU Ix2y6tZ9NeVGOe5wXGzU+AZTldfOtRHSH9ZcunxpQiM6VkUk4Wjtsno2kNqR1Bnp+xad Srwg== X-Gm-Message-State: APjAAAVCf0T22tgmDIXam/aw+YZ3+6kRHq8gwoYPOsx70NL9puG0pArj GyYaIY/GGonkayxBuACToGCN59W49phe4A== X-Google-Smtp-Source: APXvYqyN6yP+NVUuTXtw8S0QhFEh5VzUmCz8tELAB76Wi0bFYCCuEzqXSab9bnJK9NxgtHyCBLEU0w== X-Received: by 2002:a17:902:aa0a:: with SMTP id be10mr28007931plb.27.1559641075391; Tue, 04 Jun 2019 02:37:55 -0700 (PDT) Received: from acourbot.tok.corp.google.com ([2401:fa00:4:4:9712:8cf1:d0f:7d33]) by smtp.gmail.com with ESMTPSA id j7sm17431588pfa.184.2019.06.04.02.37.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jun 2019 02:37:54 -0700 (PDT) From: Alexandre Courbot To: Tiffany Lin , Andrew-CT Chen , Mauro Carvalho Chehab , Yunfei Dong , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Alexandre Courbot Subject: [PATCH 1/5] media: mtk-vcodec: replace GPLv2 with SPDX Date: Tue, 4 Jun 2019 18:37:33 +0900 Message-Id: <20190604093737.172599-2-acourbot@chromium.org> X-Mailer: git-send-email 2.22.0.rc1.311.g5d7573a151-goog In-Reply-To: <20190604093737.172599-1-acourbot@chromium.org> References: <20190604093737.172599-1-acourbot@chromium.org> MIME-Version: 1.0 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 Replace the GPLv2 boilerplate with the corresponding SPDX reference. Signed-off-by: Alexandre Courbot --- .../media/platform/mtk-vcodec/mtk_vcodec_dec.c | 15 +-------------- .../media/platform/mtk-vcodec/mtk_vcodec_dec.h | 15 +-------------- .../platform/mtk-vcodec/mtk_vcodec_dec_drv.c | 15 +-------------- .../platform/mtk-vcodec/mtk_vcodec_dec_pm.c | 14 +------------- .../platform/mtk-vcodec/mtk_vcodec_dec_pm.h | 14 +------------- .../media/platform/mtk-vcodec/mtk_vcodec_drv.h | 15 +-------------- .../media/platform/mtk-vcodec/mtk_vcodec_enc.c | 15 +-------------- .../media/platform/mtk-vcodec/mtk_vcodec_enc.h | 15 +-------------- .../platform/mtk-vcodec/mtk_vcodec_enc_drv.c | 15 +-------------- .../platform/mtk-vcodec/mtk_vcodec_enc_pm.c | 14 +------------- .../platform/mtk-vcodec/mtk_vcodec_enc_pm.h | 14 +------------- .../media/platform/mtk-vcodec/mtk_vcodec_intr.c | 14 +------------- .../media/platform/mtk-vcodec/mtk_vcodec_intr.h | 14 +------------- .../media/platform/mtk-vcodec/mtk_vcodec_util.c | 15 +-------------- .../media/platform/mtk-vcodec/mtk_vcodec_util.h | 15 +-------------- .../platform/mtk-vcodec/vdec/vdec_h264_if.c | 14 +------------- .../platform/mtk-vcodec/vdec/vdec_vp8_if.c | 15 +-------------- .../platform/mtk-vcodec/vdec/vdec_vp9_if.c | 16 +--------------- .../media/platform/mtk-vcodec/vdec_drv_base.h | 14 +------------- drivers/media/platform/mtk-vcodec/vdec_drv_if.c | 15 +-------------- drivers/media/platform/mtk-vcodec/vdec_drv_if.h | 15 +-------------- .../media/platform/mtk-vcodec/vdec_ipi_msg.h | 15 +-------------- drivers/media/platform/mtk-vcodec/vdec_vpu_if.c | 14 +------------- drivers/media/platform/mtk-vcodec/vdec_vpu_if.h | 14 +------------- .../platform/mtk-vcodec/venc/venc_h264_if.c | 17 +---------------- .../platform/mtk-vcodec/venc/venc_vp8_if.c | 16 +--------------- .../media/platform/mtk-vcodec/venc_drv_base.h | 17 +---------------- drivers/media/platform/mtk-vcodec/venc_drv_if.c | 17 +---------------- drivers/media/platform/mtk-vcodec/venc_drv_if.h | 17 +---------------- .../media/platform/mtk-vcodec/venc_ipi_msg.h | 17 +---------------- drivers/media/platform/mtk-vcodec/venc_vpu_if.c | 15 +-------------- drivers/media/platform/mtk-vcodec/venc_vpu_if.h | 15 +-------------- 32 files changed, 32 insertions(+), 450 deletions(-) diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c index 851903867bc9..371e70d6a803 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c @@ -1,17 +1,4 @@ -/* - * Copyright (c) 2016 MediaTek Inc. - * Author: PC Chen - * Tiffany Lin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// SPDX-License-Identifier: GPL-2.0 #include #include diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.h b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.h index e4984edec4f8..a18268694646 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.h +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.h @@ -1,17 +1,4 @@ -/* - * Copyright (c) 2016 MediaTek Inc. - * Author: PC Chen - * Tiffany Lin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _MTK_VCODEC_DEC_H_ #define _MTK_VCODEC_DEC_H_ diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c index 4334b7394861..dbe957aa138d 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c @@ -1,17 +1,4 @@ -/* - * Copyright (c) 2016 MediaTek Inc. - * Author: PC Chen - * Tiffany Lin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// SPDX-License-Identifier: GPL-2.0 #include #include diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c index 11c45c556e88..b09242b1470d 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c @@ -1,16 +1,4 @@ -/* - * Copyright (c) 2016 MediaTek Inc. - * Author: Tiffany Lin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// SPDX-License-Identifier: GPL-2.0 #include #include diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.h b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.h index 86a7825353e3..b44621ad15d8 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.h +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.h @@ -1,16 +1,4 @@ -/* - * Copyright (c) 2016 MediaTek Inc. - * Author: Tiffany Lin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _MTK_VCODEC_DEC_PM_H_ #define _MTK_VCODEC_DEC_PM_H_ diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h index 662a84b822af..d7b43caf7988 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h @@ -1,17 +1,4 @@ -/* -* Copyright (c) 2016 MediaTek Inc. -* Author: PC Chen -* Tiffany Lin -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -*/ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _MTK_VCODEC_DRV_H_ #define _MTK_VCODEC_DRV_H_ diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c index 50351adafc47..1a3845809b92 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c @@ -1,17 +1,4 @@ -/* -* Copyright (c) 2016 MediaTek Inc. -* Author: PC Chen -* Tiffany Lin -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -*/ +// SPDX-License-Identifier: GPL-2.0 #include #include diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.h b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.h index d7a154a97510..e372e5ddff8a 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.h +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.h @@ -1,17 +1,4 @@ -/* -* Copyright (c) 2016 MediaTek Inc. -* Author: PC Chen -* Tiffany Lin -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -*/ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _MTK_VCODEC_ENC_H_ #define _MTK_VCODEC_ENC_H_ diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c index 83f859e8509c..b6d7c602c2ad 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c @@ -1,17 +1,4 @@ -/* -* Copyright (c) 2016 MediaTek Inc. -* Author: PC Chen -* Tiffany Lin -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -*/ +// SPDX-License-Identifier: GPL-2.0 #include #include diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c index 39375b8ea27c..90bdad5c71b0 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c @@ -1,16 +1,4 @@ -/* -* Copyright (c) 2016 MediaTek Inc. -* Author: Tiffany Lin -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -*/ +// SPDX-License-Identifier: GPL-2.0 #include #include diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.h b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.h index f32167138976..dddbbe02a109 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.h +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.h @@ -1,16 +1,4 @@ -/* -* Copyright (c) 2016 MediaTek Inc. -* Author: Tiffany Lin -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -*/ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _MTK_VCODEC_ENC_PM_H_ #define _MTK_VCODEC_ENC_PM_H_ diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_intr.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_intr.c index 113b2097f061..693888e4987f 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_intr.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_intr.c @@ -1,16 +1,4 @@ -/* -* Copyright (c) 2016 MediaTek Inc. -* Author: Tiffany Lin -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -*/ +// SPDX-License-Identifier: GPL-2.0 #include #include diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_intr.h b/drivers/media/platform/mtk-vcodec/mtk_vcodec_intr.h index 12131855b46a..55f046cd93a5 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_intr.h +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_intr.h @@ -1,16 +1,4 @@ -/* -* Copyright (c) 2016 MediaTek Inc. -* Author: Tiffany Lin -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -*/ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _MTK_VCODEC_INTR_H_ #define _MTK_VCODEC_INTR_H_ diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_util.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_util.c index 060c0ad6243a..e1a9ac9694e3 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_util.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_util.c @@ -1,17 +1,4 @@ -/* -* Copyright (c) 2016 MediaTek Inc. -* Author: PC Chen -* Tiffany Lin -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -*/ +// SPDX-License-Identifier: GPL-2.0 #include diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_util.h b/drivers/media/platform/mtk-vcodec/mtk_vcodec_util.h index 9bf6e8d1b9c9..daabb63548d0 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_util.h +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_util.h @@ -1,17 +1,4 @@ -/* -* Copyright (c) 2016 MediaTek Inc. -* Author: PC Chen -* Tiffany Lin -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -*/ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _MTK_VCODEC_UTIL_H_ #define _MTK_VCODEC_UTIL_H_ diff --git a/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_if.c b/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_if.c index cdbcd6909728..d725ea54b1c1 100644 --- a/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_if.c +++ b/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_if.c @@ -1,16 +1,4 @@ -/* - * Copyright (c) 2016 MediaTek Inc. - * Author: PC Chen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// SPDX-License-Identifier: GPL-2.0 #include #include diff --git a/drivers/media/platform/mtk-vcodec/vdec/vdec_vp8_if.c b/drivers/media/platform/mtk-vcodec/vdec/vdec_vp8_if.c index ba79136421ef..8de997875b6b 100644 --- a/drivers/media/platform/mtk-vcodec/vdec/vdec_vp8_if.c +++ b/drivers/media/platform/mtk-vcodec/vdec/vdec_vp8_if.c @@ -1,17 +1,4 @@ -/* - * Copyright (c) 2016 MediaTek Inc. - * Author: Jungchang Tsao - * PC Chen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// SPDX-License-Identifier: GPL-2.0 #include #include "../vdec_drv_if.h" diff --git a/drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c b/drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c index 939ea14bf6c5..02b65298c87e 100644 --- a/drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c +++ b/drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c @@ -1,18 +1,4 @@ -/* - * Copyright (c) 2016 MediaTek Inc. - * Author: Daniel Hsiao - * Kai-Sean Yang - * Tiffany Lin - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// SPDX-License-Identifier: GPL-2.0 #include #include diff --git a/drivers/media/platform/mtk-vcodec/vdec_drv_base.h b/drivers/media/platform/mtk-vcodec/vdec_drv_base.h index 7e4c1a92bbd8..014712b1312e 100644 --- a/drivers/media/platform/mtk-vcodec/vdec_drv_base.h +++ b/drivers/media/platform/mtk-vcodec/vdec_drv_base.h @@ -1,16 +1,4 @@ -/* - * Copyright (c) 2016 MediaTek Inc. - * Author: PC Chen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _VDEC_DRV_BASE_ #define _VDEC_DRV_BASE_ diff --git a/drivers/media/platform/mtk-vcodec/vdec_drv_if.c b/drivers/media/platform/mtk-vcodec/vdec_drv_if.c index 5ffc468dd910..6835cb7d090a 100644 --- a/drivers/media/platform/mtk-vcodec/vdec_drv_if.c +++ b/drivers/media/platform/mtk-vcodec/vdec_drv_if.c @@ -1,17 +1,4 @@ -/* - * Copyright (c) 2016 MediaTek Inc. - * Author: PC Chen - * Tiffany Lin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// SPDX-License-Identifier: GPL-2.0 #include #include diff --git a/drivers/media/platform/mtk-vcodec/vdec_drv_if.h b/drivers/media/platform/mtk-vcodec/vdec_drv_if.h index 9a21591f3818..ceba7f55a526 100644 --- a/drivers/media/platform/mtk-vcodec/vdec_drv_if.h +++ b/drivers/media/platform/mtk-vcodec/vdec_drv_if.h @@ -1,17 +1,4 @@ -/* - * Copyright (c) 2016 MediaTek Inc. - * Author: PC Chen - * Tiffany Lin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _VDEC_DRV_IF_H_ #define _VDEC_DRV_IF_H_ diff --git a/drivers/media/platform/mtk-vcodec/vdec_ipi_msg.h b/drivers/media/platform/mtk-vcodec/vdec_ipi_msg.h index 5a8a629f4ac9..6370f1285a63 100644 --- a/drivers/media/platform/mtk-vcodec/vdec_ipi_msg.h +++ b/drivers/media/platform/mtk-vcodec/vdec_ipi_msg.h @@ -1,17 +1,4 @@ -/* - * Copyright (c) 2016 MediaTek Inc. - * Author: PC Chen - * - * This program is free software; you can redistribute it and/or - * modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _VDEC_IPI_MSG_H_ #define _VDEC_IPI_MSG_H_ diff --git a/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c b/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c index 1abd14e79565..9b240d325a84 100644 --- a/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c +++ b/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c @@ -1,16 +1,4 @@ -/* - * Copyright (c) 2016 MediaTek Inc. - * Author: PC Chen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// SPDX-License-Identifier: GPL-2.0 #include "mtk_vcodec_drv.h" #include "mtk_vcodec_util.h" diff --git a/drivers/media/platform/mtk-vcodec/vdec_vpu_if.h b/drivers/media/platform/mtk-vcodec/vdec_vpu_if.h index 79d8eac7f5e2..3c417493ccca 100644 --- a/drivers/media/platform/mtk-vcodec/vdec_vpu_if.h +++ b/drivers/media/platform/mtk-vcodec/vdec_vpu_if.h @@ -1,16 +1,4 @@ -/* - * Copyright (c) 2016 MediaTek Inc. - * Author: PC Chen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _VDEC_VPU_IF_H_ #define _VDEC_VPU_IF_H_ diff --git a/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c b/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c index 6cf31b366aad..0cf08dd7b6e3 100644 --- a/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c +++ b/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c @@ -1,19 +1,4 @@ -/* - * Copyright (c) 2016 MediaTek Inc. - * Author: Jungchang Tsao - * Daniel Hsiao - * PoChun Lin - * - * This program is free software; you can redistribute it and/or - * modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// SPDX-License-Identifier: GPL-2.0 #include #include diff --git a/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c b/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c index 957420dd60de..3fb9e0c79b4f 100644 --- a/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c +++ b/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c @@ -1,18 +1,4 @@ -/* - * Copyright (c) 2016 MediaTek Inc. - * Author: Daniel Hsiao - * PoChun Lin - * - * This program is free software; you can redistribute it and/or - * modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// SPDX-License-Identifier: GPL-2.0 #include #include diff --git a/drivers/media/platform/mtk-vcodec/venc_drv_base.h b/drivers/media/platform/mtk-vcodec/venc_drv_base.h index 6308d44dedf6..2de37b47fe73 100644 --- a/drivers/media/platform/mtk-vcodec/venc_drv_base.h +++ b/drivers/media/platform/mtk-vcodec/venc_drv_base.h @@ -1,19 +1,4 @@ -/* - * Copyright (c) 2016 MediaTek Inc. - * Author: Daniel Hsiao - * Jungchang Tsao - * Tiffany Lin - * - * This program is free software; you can redistribute it and/or - * modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _VENC_DRV_BASE_ #define _VENC_DRV_BASE_ diff --git a/drivers/media/platform/mtk-vcodec/venc_drv_if.c b/drivers/media/platform/mtk-vcodec/venc_drv_if.c index d02d5f1df279..25c1e100f5a1 100644 --- a/drivers/media/platform/mtk-vcodec/venc_drv_if.c +++ b/drivers/media/platform/mtk-vcodec/venc_drv_if.c @@ -1,19 +1,4 @@ -/* - * Copyright (c) 2016 MediaTek Inc. - * Author: Daniel Hsiao - * Jungchang Tsao - * Tiffany Lin - * - * This program is free software; you can redistribute it and/or - * modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// SPDX-License-Identifier: GPL-2.0 #include #include diff --git a/drivers/media/platform/mtk-vcodec/venc_drv_if.h b/drivers/media/platform/mtk-vcodec/venc_drv_if.h index 55ecda844894..d6605812ebb0 100644 --- a/drivers/media/platform/mtk-vcodec/venc_drv_if.h +++ b/drivers/media/platform/mtk-vcodec/venc_drv_if.h @@ -1,19 +1,4 @@ -/* - * Copyright (c) 2016 MediaTek Inc. - * Author: Daniel Hsiao - * Jungchang Tsao - * Tiffany Lin - * - * This program is free software; you can redistribute it and/or - * modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _VENC_DRV_IF_H_ #define _VENC_DRV_IF_H_ diff --git a/drivers/media/platform/mtk-vcodec/venc_ipi_msg.h b/drivers/media/platform/mtk-vcodec/venc_ipi_msg.h index 4c869cb6fbf7..d5282f24f934 100644 --- a/drivers/media/platform/mtk-vcodec/venc_ipi_msg.h +++ b/drivers/media/platform/mtk-vcodec/venc_ipi_msg.h @@ -1,19 +1,4 @@ -/* - * Copyright (c) 2016 MediaTek Inc. - * Author: Jungchang Tsao - * Daniel Hsiao - * Tiffany Lin - * - * This program is free software; you can redistribute it and/or - * modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _VENC_IPI_MSG_H_ #define _VENC_IPI_MSG_H_ diff --git a/drivers/media/platform/mtk-vcodec/venc_vpu_if.c b/drivers/media/platform/mtk-vcodec/venc_vpu_if.c index 0d882acf8830..a6906db74718 100644 --- a/drivers/media/platform/mtk-vcodec/venc_vpu_if.c +++ b/drivers/media/platform/mtk-vcodec/venc_vpu_if.c @@ -1,17 +1,4 @@ -/* - * Copyright (c) 2016 MediaTek Inc. - * Author: PoChun Lin - * - * This program is free software; you can redistribute it and/or - * modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// SPDX-License-Identifier: GPL-2.0 #include "mtk_vpu.h" #include "venc_ipi_msg.h" diff --git a/drivers/media/platform/mtk-vcodec/venc_vpu_if.h b/drivers/media/platform/mtk-vcodec/venc_vpu_if.h index 215d1e01362e..fd4f85646aa5 100644 --- a/drivers/media/platform/mtk-vcodec/venc_vpu_if.h +++ b/drivers/media/platform/mtk-vcodec/venc_vpu_if.h @@ -1,17 +1,4 @@ -/* - * Copyright (c) 2016 MediaTek Inc. - * Author: PoChun Lin - * - * This program is free software; you can redistribute it and/or - * modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _VENC_VPU_IF_H_ #define _VENC_VPU_IF_H_ From patchwork Tue Jun 4 09:37:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Courbot X-Patchwork-Id: 10974519 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 741512D49 for ; Tue, 4 Jun 2019 09:38:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6322B20000 for ; Tue, 4 Jun 2019 09:38:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 570AE287CB; Tue, 4 Jun 2019 09:38:20 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 6E2C120000 for ; Tue, 4 Jun 2019 09:38:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727129AbfFDJh7 (ORCPT ); Tue, 4 Jun 2019 05:37:59 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:41323 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727112AbfFDJh7 (ORCPT ); Tue, 4 Jun 2019 05:37:59 -0400 Received: by mail-pf1-f196.google.com with SMTP id q17so12341912pfq.8 for ; Tue, 04 Jun 2019 02:37:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=s9GatXyoNR6L4gCFu6mpC86RbrlbwZSCeOAbbnw2644=; b=Mvt4eeJJvFaNhJkGcMs8LQvO8HS4A7Fu8m81xkCTZyonREuru+MwTqkBA+DkZeALHB MpYMjilb1I0B36MAGyCpcgOLhQm0+lX0rFKDAMvrt7jTkh8F8YpnjP8SdxMBpvATUm5G It9NZOjhmREsG52kVNUpYmyGhMk/OqR4JHMBs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=s9GatXyoNR6L4gCFu6mpC86RbrlbwZSCeOAbbnw2644=; b=oL+TouF9IPjEVD247wcKof3lNpISnw9H8/wUqg/CZm4N5EUeJ7Yv18Qzmp7/C2KreK IMBjmiMQqjAZwZGmGUcTz+hQmea0mUfXNVYLhpKC8rbbwKB/phxLck2PKALFCmcqBBBp /6zTPhmhpVz5ixbHUYOTsgIpcj8R9nwbj+l+l5quRaF86gH3UkYNlT6vwfn/dgo7vz6X H7kZzcVHGvXrOP87WoJGvLtZngjCBO1uL7T0Oi3iA2FsyZilEt5ixMiiSnbSCnrX3a5Q vBvra8xg+huS1qTKyFZ/YIPEqjxhXkfHTjXPVHzuvOvnlSk1FKvhhz8fXsLUFmZsWdwa SiYg== X-Gm-Message-State: APjAAAXP1hH61RPYtYMuIAiGHhdg68flug/CQKF83JhXoJ0amJ+En+tA HHboZjy/bTyQCTElj3HP0ABxLA== X-Google-Smtp-Source: APXvYqzeCUo4Xz2InzQazvk4bdf5zLFFwVuXoZGPhOPf6StKZC8uQP5aR6xDAvBjIrD+P4lN02SPWQ== X-Received: by 2002:a17:90a:b104:: with SMTP id z4mr14326619pjq.102.1559641078320; Tue, 04 Jun 2019 02:37:58 -0700 (PDT) Received: from acourbot.tok.corp.google.com ([2401:fa00:4:4:9712:8cf1:d0f:7d33]) by smtp.gmail.com with ESMTPSA id j7sm17431588pfa.184.2019.06.04.02.37.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jun 2019 02:37:57 -0700 (PDT) From: Alexandre Courbot To: Tiffany Lin , Andrew-CT Chen , Mauro Carvalho Chehab , Yunfei Dong , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Alexandre Courbot Subject: [PATCH 2/5] media: mtk-vcodec: avoid unneeded pointer-to-long conversions Date: Tue, 4 Jun 2019 18:37:34 +0900 Message-Id: <20190604093737.172599-3-acourbot@chromium.org> X-Mailer: git-send-email 2.22.0.rc1.311.g5d7573a151-goog In-Reply-To: <20190604093737.172599-1-acourbot@chromium.org> References: <20190604093737.172599-1-acourbot@chromium.org> MIME-Version: 1.0 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 interface used to communicate with the firmware casts pointers into unsigned longs and back again in order to store private references, all of this for pointers that remain purely in the kernel. Replace these unsigned longs with void pointers to make the code a bit sturdier and easier to follow. Also simplify some interfaces by removing arguments that could be infered from others. Signed-off-by: Alexandre Courbot --- drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h | 2 +- .../media/platform/mtk-vcodec/vdec/vdec_h264_if.c | 12 ++++++------ drivers/media/platform/mtk-vcodec/vdec/vdec_vp8_if.c | 12 ++++++------ drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c | 12 ++++++------ drivers/media/platform/mtk-vcodec/vdec_drv_base.h | 8 ++++---- drivers/media/platform/mtk-vcodec/vdec_drv_if.c | 2 +- .../media/platform/mtk-vcodec/venc/venc_h264_if.c | 10 +++++----- drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c | 10 +++++----- drivers/media/platform/mtk-vcodec/venc_drv_base.h | 8 ++++---- drivers/media/platform/mtk-vcodec/venc_drv_if.c | 2 +- 10 files changed, 39 insertions(+), 39 deletions(-) diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h index d7b43caf7988..4b10996e6532 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h @@ -268,7 +268,7 @@ struct mtk_vcodec_ctx { const struct vdec_common_if *dec_if; const struct venc_common_if *enc_if; - unsigned long drv_handle; + void *drv_handle; struct vdec_pic_info picinfo; int dpb_size; diff --git a/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_if.c b/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_if.c index d725ea54b1c1..0c0660d2560b 100644 --- a/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_if.c +++ b/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_if.c @@ -262,7 +262,7 @@ static void get_dpb_size(struct vdec_h264_inst *inst, unsigned int *dpb_sz) mtk_vcodec_debug(inst, "sz=%d", *dpb_sz); } -static int vdec_h264_init(struct mtk_vcodec_ctx *ctx, unsigned long *h_vdec) +static int vdec_h264_init(struct mtk_vcodec_ctx *ctx) { struct vdec_h264_inst *inst = NULL; int err; @@ -291,7 +291,7 @@ static int vdec_h264_init(struct mtk_vcodec_ctx *ctx, unsigned long *h_vdec) mtk_vcodec_debug(inst, "H264 Instance >> %p", inst); - *h_vdec = (unsigned long)inst; + ctx->drv_handle = inst; return 0; error_deinit: @@ -302,7 +302,7 @@ static int vdec_h264_init(struct mtk_vcodec_ctx *ctx, unsigned long *h_vdec) return err; } -static void vdec_h264_deinit(unsigned long h_vdec) +static void vdec_h264_deinit(void *h_vdec) { struct vdec_h264_inst *inst = (struct vdec_h264_inst *)h_vdec; @@ -327,7 +327,7 @@ static int find_start_code(unsigned char *data, unsigned int data_sz) return -1; } -static int vdec_h264_decode(unsigned long h_vdec, struct mtk_vcodec_mem *bs, +static int vdec_h264_decode(void *h_vdec, struct mtk_vcodec_mem *bs, struct vdec_fb *fb, bool *res_chg) { struct vdec_h264_inst *inst = (struct vdec_h264_inst *)h_vdec; @@ -447,8 +447,8 @@ static void vdec_h264_get_fb(struct vdec_h264_inst *inst, list->count--; } -static int vdec_h264_get_param(unsigned long h_vdec, - enum vdec_get_param_type type, void *out) +static int vdec_h264_get_param(void *h_vdec, enum vdec_get_param_type type, + void *out) { struct vdec_h264_inst *inst = (struct vdec_h264_inst *)h_vdec; diff --git a/drivers/media/platform/mtk-vcodec/vdec/vdec_vp8_if.c b/drivers/media/platform/mtk-vcodec/vdec/vdec_vp8_if.c index 8de997875b6b..1e3763881e0d 100644 --- a/drivers/media/platform/mtk-vcodec/vdec/vdec_vp8_if.c +++ b/drivers/media/platform/mtk-vcodec/vdec/vdec_vp8_if.c @@ -383,7 +383,7 @@ static void free_working_buf(struct vdec_vp8_inst *inst) inst->vsi->dec.working_buf_dma = 0; } -static int vdec_vp8_init(struct mtk_vcodec_ctx *ctx, unsigned long *h_vdec) +static int vdec_vp8_init(struct mtk_vcodec_ctx *ctx) { struct vdec_vp8_inst *inst; int err; @@ -414,7 +414,7 @@ static int vdec_vp8_init(struct mtk_vcodec_ctx *ctx, unsigned long *h_vdec) get_hw_reg_base(inst); mtk_vcodec_debug(inst, "VP8 Instance >> %p", inst); - *h_vdec = (unsigned long)inst; + ctx->drv_handle = inst; return 0; error_deinit: @@ -424,7 +424,7 @@ static int vdec_vp8_init(struct mtk_vcodec_ctx *ctx, unsigned long *h_vdec) return err; } -static int vdec_vp8_decode(unsigned long h_vdec, struct mtk_vcodec_mem *bs, +static int vdec_vp8_decode(void *h_vdec, struct mtk_vcodec_mem *bs, struct vdec_fb *fb, bool *res_chg) { struct vdec_vp8_inst *inst = (struct vdec_vp8_inst *)h_vdec; @@ -560,8 +560,8 @@ static void get_crop_info(struct vdec_vp8_inst *inst, struct v4l2_rect *cr) cr->left, cr->top, cr->width, cr->height); } -static int vdec_vp8_get_param(unsigned long h_vdec, - enum vdec_get_param_type type, void *out) +static int vdec_vp8_get_param(void *h_vdec, enum vdec_get_param_type type, + void *out) { struct vdec_vp8_inst *inst = (struct vdec_vp8_inst *)h_vdec; @@ -594,7 +594,7 @@ static int vdec_vp8_get_param(unsigned long h_vdec, return 0; } -static void vdec_vp8_deinit(unsigned long h_vdec) +static void vdec_vp8_deinit(void *h_vdec) { struct vdec_vp8_inst *inst = (struct vdec_vp8_inst *)h_vdec; diff --git a/drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c b/drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c index 02b65298c87e..589b2fc91da2 100644 --- a/drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c +++ b/drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c @@ -751,7 +751,7 @@ static int validate_vsi_array_indexes(struct vdec_vp9_inst *inst, return 0; } -static void vdec_vp9_deinit(unsigned long h_vdec) +static void vdec_vp9_deinit(void *h_vdec) { struct vdec_vp9_inst *inst = (struct vdec_vp9_inst *)h_vdec; struct mtk_vcodec_mem *mem; @@ -773,7 +773,7 @@ static void vdec_vp9_deinit(unsigned long h_vdec) vp9_free_inst(inst); } -static int vdec_vp9_init(struct mtk_vcodec_ctx *ctx, unsigned long *h_vdec) +static int vdec_vp9_init(struct mtk_vcodec_ctx *ctx) { struct vdec_vp9_inst *inst; @@ -797,7 +797,7 @@ static int vdec_vp9_init(struct mtk_vcodec_ctx *ctx, unsigned long *h_vdec) inst->vsi = (struct vdec_vp9_vsi *)inst->vpu.vsi; init_all_fb_lists(inst); - (*h_vdec) = (unsigned long)inst; + ctx->drv_handle = inst; return 0; err_deinit_inst: @@ -806,7 +806,7 @@ static int vdec_vp9_init(struct mtk_vcodec_ctx *ctx, unsigned long *h_vdec) return -EINVAL; } -static int vdec_vp9_decode(unsigned long h_vdec, struct mtk_vcodec_mem *bs, +static int vdec_vp9_decode(void *h_vdec, struct mtk_vcodec_mem *bs, struct vdec_fb *fb, bool *res_chg) { int ret = 0; @@ -963,8 +963,8 @@ static void get_crop_info(struct vdec_vp9_inst *inst, struct v4l2_rect *cr) cr->left, cr->top, cr->width, cr->height); } -static int vdec_vp9_get_param(unsigned long h_vdec, - enum vdec_get_param_type type, void *out) +static int vdec_vp9_get_param(void *h_vdec, enum vdec_get_param_type type, + void *out) { struct vdec_vp9_inst *inst = (struct vdec_vp9_inst *)h_vdec; int ret = 0; diff --git a/drivers/media/platform/mtk-vcodec/vdec_drv_base.h b/drivers/media/platform/mtk-vcodec/vdec_drv_base.h index 014712b1312e..4453f7de9f87 100644 --- a/drivers/media/platform/mtk-vcodec/vdec_drv_base.h +++ b/drivers/media/platform/mtk-vcodec/vdec_drv_base.h @@ -13,7 +13,7 @@ struct vdec_common_if { * @ctx : [in] mtk v4l2 context * @h_vdec : [out] driver handle */ - int (*init)(struct mtk_vcodec_ctx *ctx, unsigned long *h_vdec); + int (*init)(struct mtk_vcodec_ctx *ctx); /** * (*decode)() - trigger decode @@ -22,7 +22,7 @@ struct vdec_common_if { * @fb : [in] frame buffer to store decoded frame * @res_chg : [out] resolution change happen */ - int (*decode)(unsigned long h_vdec, struct mtk_vcodec_mem *bs, + int (*decode)(void *h_vdec, struct mtk_vcodec_mem *bs, struct vdec_fb *fb, bool *res_chg); /** @@ -31,14 +31,14 @@ struct vdec_common_if { * @type : [in] input parameter type * @out : [out] buffer to store query result */ - int (*get_param)(unsigned long h_vdec, enum vdec_get_param_type type, + int (*get_param)(void *h_vdec, enum vdec_get_param_type type, void *out); /** * (*deinit)() - deinitialize driver. * @h_vdec : [in] driver handle to be deinit */ - void (*deinit)(unsigned long h_vdec); + void (*deinit)(void *h_vdec); }; #endif diff --git a/drivers/media/platform/mtk-vcodec/vdec_drv_if.c b/drivers/media/platform/mtk-vcodec/vdec_drv_if.c index 6835cb7d090a..5d8d76d55005 100644 --- a/drivers/media/platform/mtk-vcodec/vdec_drv_if.c +++ b/drivers/media/platform/mtk-vcodec/vdec_drv_if.c @@ -34,7 +34,7 @@ int vdec_if_init(struct mtk_vcodec_ctx *ctx, unsigned int fourcc) mtk_vdec_lock(ctx); mtk_vcodec_dec_clock_on(&ctx->dev->pm); - ret = ctx->dec_if->init(ctx, &ctx->drv_handle); + ret = ctx->dec_if->init(ctx); mtk_vcodec_dec_clock_off(&ctx->dev->pm); mtk_vdec_unlock(ctx); diff --git a/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c b/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c index 0cf08dd7b6e3..bfe61d5dc1cb 100644 --- a/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c +++ b/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c @@ -452,7 +452,7 @@ static void h264_encode_filler(struct venc_h264_inst *inst, void *buf, memset(p, 0xff, size); } -static int h264_enc_init(struct mtk_vcodec_ctx *ctx, unsigned long *handle) +static int h264_enc_init(struct mtk_vcodec_ctx *ctx) { int ret = 0; struct venc_h264_inst *inst; @@ -478,12 +478,12 @@ static int h264_enc_init(struct mtk_vcodec_ctx *ctx, unsigned long *handle) if (ret) kfree(inst); else - (*handle) = (unsigned long)inst; + ctx->drv_handle = inst; return ret; } -static int h264_enc_encode(unsigned long handle, +static int h264_enc_encode(void *handle, enum venc_start_opt opt, struct venc_frm_buf *frm_buf, struct mtk_vcodec_mem *bs_buf, @@ -578,7 +578,7 @@ static int h264_enc_encode(unsigned long handle, return ret; } -static int h264_enc_set_param(unsigned long handle, +static int h264_enc_set_param(void *handle, enum venc_set_param_type type, struct venc_enc_param *enc_prm) { @@ -631,7 +631,7 @@ static int h264_enc_set_param(unsigned long handle, return ret; } -static int h264_enc_deinit(unsigned long handle) +static int h264_enc_deinit(void *handle) { int ret = 0; struct venc_h264_inst *inst = (struct venc_h264_inst *)handle; diff --git a/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c b/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c index 3fb9e0c79b4f..af23367cf1dd 100644 --- a/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c +++ b/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c @@ -318,7 +318,7 @@ static int vp8_enc_encode_frame(struct venc_vp8_inst *inst, return ret; } -static int vp8_enc_init(struct mtk_vcodec_ctx *ctx, unsigned long *handle) +static int vp8_enc_init(struct mtk_vcodec_ctx *ctx) { int ret = 0; struct venc_vp8_inst *inst; @@ -344,12 +344,12 @@ static int vp8_enc_init(struct mtk_vcodec_ctx *ctx, unsigned long *handle) if (ret) kfree(inst); else - (*handle) = (unsigned long)inst; + ctx->drv_handle = inst; return ret; } -static int vp8_enc_encode(unsigned long handle, +static int vp8_enc_encode(void *handle, enum venc_start_opt opt, struct venc_frm_buf *frm_buf, struct mtk_vcodec_mem *bs_buf, @@ -386,7 +386,7 @@ static int vp8_enc_encode(unsigned long handle, return ret; } -static int vp8_enc_set_param(unsigned long handle, +static int vp8_enc_set_param(void *handle, enum venc_set_param_type type, struct venc_enc_param *enc_prm) { @@ -437,7 +437,7 @@ static int vp8_enc_set_param(unsigned long handle, return ret; } -static int vp8_enc_deinit(unsigned long handle) +static int vp8_enc_deinit(void *handle) { int ret = 0; struct venc_vp8_inst *inst = (struct venc_vp8_inst *)handle; diff --git a/drivers/media/platform/mtk-vcodec/venc_drv_base.h b/drivers/media/platform/mtk-vcodec/venc_drv_base.h index 2de37b47fe73..be368fcb01e6 100644 --- a/drivers/media/platform/mtk-vcodec/venc_drv_base.h +++ b/drivers/media/platform/mtk-vcodec/venc_drv_base.h @@ -13,7 +13,7 @@ struct venc_common_if { * @ctx: [in] mtk v4l2 context * @handle: [out] driver handle */ - int (*init)(struct mtk_vcodec_ctx *ctx, unsigned long *handle); + int (*init)(struct mtk_vcodec_ctx *ctx); /** * (*encode)() - trigger encode @@ -23,7 +23,7 @@ struct venc_common_if { * @bs_buf: [in] bitstream buffer to store output bitstream * @result: [out] encode result */ - int (*encode)(unsigned long handle, enum venc_start_opt opt, + int (*encode)(void *handle, enum venc_start_opt opt, struct venc_frm_buf *frm_buf, struct mtk_vcodec_mem *bs_buf, struct venc_done_result *result); @@ -34,14 +34,14 @@ struct venc_common_if { * @type: [in] parameter type * @in: [in] buffer to store the parameter */ - int (*set_param)(unsigned long handle, enum venc_set_param_type type, + int (*set_param)(void *handle, enum venc_set_param_type type, struct venc_enc_param *in); /** * (*deinit)() - deinitialize driver. * @handle: [in] driver handle */ - int (*deinit)(unsigned long handle); + int (*deinit)(void *handle); }; #endif diff --git a/drivers/media/platform/mtk-vcodec/venc_drv_if.c b/drivers/media/platform/mtk-vcodec/venc_drv_if.c index 25c1e100f5a1..318af1b4b6e7 100644 --- a/drivers/media/platform/mtk-vcodec/venc_drv_if.c +++ b/drivers/media/platform/mtk-vcodec/venc_drv_if.c @@ -31,7 +31,7 @@ int venc_if_init(struct mtk_vcodec_ctx *ctx, unsigned int fourcc) mtk_venc_lock(ctx); mtk_vcodec_enc_clock_on(&ctx->dev->pm); - ret = ctx->enc_if->init(ctx, (unsigned long *)&ctx->drv_handle); + ret = ctx->enc_if->init(ctx); mtk_vcodec_enc_clock_off(&ctx->dev->pm); mtk_venc_unlock(ctx); From patchwork Tue Jun 4 09:37:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Courbot X-Patchwork-Id: 10974517 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 3B3A7912 for ; Tue, 4 Jun 2019 09:38:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 291E320000 for ; Tue, 4 Jun 2019 09:38:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C1A9287CB; Tue, 4 Jun 2019 09:38:19 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 8A78C20000 for ; Tue, 4 Jun 2019 09:38:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727157AbfFDJiC (ORCPT ); Tue, 4 Jun 2019 05:38:02 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:33909 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727114AbfFDJiC (ORCPT ); Tue, 4 Jun 2019 05:38:02 -0400 Received: by mail-pf1-f194.google.com with SMTP id c85so3551045pfc.1 for ; Tue, 04 Jun 2019 02:38:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3vo0CKjVAQO8Efn26GFf+EbXSh3Y7HePB8JtNRXrXQo=; b=SP2kR9aTHjK29bZKBEesqtIsZN4oZoGMbmZIJ/+FA5UMlOgTTSKTsMB2pe9Ea4lR/p NqyLYFPdRCVfD9wxloIYk6aZU/79opinVilnNWqAygu3Bi4RVOpYKbhmJYVop2pvOjGO 4gbPMPTE5V3v/7KHFQiaTjCK0PMCYe6b+A1Vg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3vo0CKjVAQO8Efn26GFf+EbXSh3Y7HePB8JtNRXrXQo=; b=YtdEWUr0ecKTVOmwkH6dtDBgm9k/XnJg0s2sP67dbi/jBpCSK0OKwmYtlV59KnL7gn 3pjL6ewRQRVAX6MkVWqV27fk9IJzKQ3tSbvcX09+x8L2oqC5aOHgY+O9thWPy7l5nFlx W74+8tB4+/8TDW4gxX9SCRJSSAOjTOOOh8IomFfSEo1ILxZbkBuWgrUPbrnD4LQWfYVe MYwG0qQc5CLz+ZGypf8WqSTp8a7s27evsgIou+Q8jxd8px5c6ppLDmcnSFWR35nCzdjn r5f0znR78t1m4Ylm7xhIRWX6LqABVuCvfdtnvcKRFan5CAL+Li3QwTl1qTTh97yBEQwA iniA== X-Gm-Message-State: APjAAAV6BhhpnlhzYmJy6s4bWk1catNo+01rhlLbS/p87mbAEegIt8XZ BQcGBG9mdjG9yowOdcSaw7CfeA== X-Google-Smtp-Source: APXvYqwwjpkPddY40O7gaNv+ljNDxPTMNx/7dR6h8CvtZytFsNg3JXLP3IUAzj3pL672x/NYqpgF9Q== X-Received: by 2002:aa7:8193:: with SMTP id g19mr29469117pfi.162.1559641081312; Tue, 04 Jun 2019 02:38:01 -0700 (PDT) Received: from acourbot.tok.corp.google.com ([2401:fa00:4:4:9712:8cf1:d0f:7d33]) by smtp.gmail.com with ESMTPSA id j7sm17431588pfa.184.2019.06.04.02.37.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jun 2019 02:38:00 -0700 (PDT) From: Alexandre Courbot To: Tiffany Lin , Andrew-CT Chen , Mauro Carvalho Chehab , Yunfei Dong , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Alexandre Courbot Subject: [PATCH 3/5] media: mtk-vcodec: remove unneeded proxy functions Date: Tue, 4 Jun 2019 18:37:35 +0900 Message-Id: <20190604093737.172599-4-acourbot@chromium.org> X-Mailer: git-send-email 2.22.0.rc1.311.g5d7573a151-goog In-Reply-To: <20190604093737.172599-1-acourbot@chromium.org> References: <20190604093737.172599-1-acourbot@chromium.org> MIME-Version: 1.0 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 We were getting the codec interface through a proxy function that does not bring anything compared to just accessing the interface definition directly, so just do that. Also make the decoder interfaces const. Signed-off-by: Alexandre Courbot --- .../media/platform/mtk-vcodec/vdec/vdec_h264_if.c | 9 +-------- drivers/media/platform/mtk-vcodec/vdec/vdec_vp8_if.c | 9 +-------- drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c | 9 +-------- drivers/media/platform/mtk-vcodec/vdec_drv_if.c | 12 ++++++------ .../media/platform/mtk-vcodec/venc/venc_h264_if.c | 9 +-------- drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c | 9 +-------- drivers/media/platform/mtk-vcodec/venc_drv_if.c | 8 ++++---- 7 files changed, 15 insertions(+), 50 deletions(-) diff --git a/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_if.c b/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_if.c index 0c0660d2560b..85afdd6ab093 100644 --- a/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_if.c +++ b/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_if.c @@ -481,16 +481,9 @@ static int vdec_h264_get_param(void *h_vdec, enum vdec_get_param_type type, return 0; } -static struct vdec_common_if vdec_h264_if = { +const struct vdec_common_if vdec_h264_if = { .init = vdec_h264_init, .decode = vdec_h264_decode, .get_param = vdec_h264_get_param, .deinit = vdec_h264_deinit, }; - -struct vdec_common_if *get_h264_dec_comm_if(void); - -struct vdec_common_if *get_h264_dec_comm_if(void) -{ - return &vdec_h264_if; -} diff --git a/drivers/media/platform/mtk-vcodec/vdec/vdec_vp8_if.c b/drivers/media/platform/mtk-vcodec/vdec/vdec_vp8_if.c index 1e3763881e0d..a8ca762eac76 100644 --- a/drivers/media/platform/mtk-vcodec/vdec/vdec_vp8_if.c +++ b/drivers/media/platform/mtk-vcodec/vdec/vdec_vp8_if.c @@ -605,16 +605,9 @@ static void vdec_vp8_deinit(void *h_vdec) kfree(inst); } -static struct vdec_common_if vdec_vp8_if = { +const struct vdec_common_if vdec_vp8_if = { .init = vdec_vp8_init, .decode = vdec_vp8_decode, .get_param = vdec_vp8_get_param, .deinit = vdec_vp8_deinit, }; - -struct vdec_common_if *get_vp8_dec_comm_if(void); - -struct vdec_common_if *get_vp8_dec_comm_if(void) -{ - return &vdec_vp8_if; -} diff --git a/drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c b/drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c index 589b2fc91da2..1f99febdfbbe 100644 --- a/drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c +++ b/drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c @@ -994,16 +994,9 @@ static int vdec_vp9_get_param(void *h_vdec, enum vdec_get_param_type type, return ret; } -static struct vdec_common_if vdec_vp9_if = { +const struct vdec_common_if vdec_vp9_if = { .init = vdec_vp9_init, .decode = vdec_vp9_decode, .get_param = vdec_vp9_get_param, .deinit = vdec_vp9_deinit, }; - -struct vdec_common_if *get_vp9_dec_comm_if(void); - -struct vdec_common_if *get_vp9_dec_comm_if(void) -{ - return &vdec_vp9_if; -} diff --git a/drivers/media/platform/mtk-vcodec/vdec_drv_if.c b/drivers/media/platform/mtk-vcodec/vdec_drv_if.c index 5d8d76d55005..aa614eea3cc5 100644 --- a/drivers/media/platform/mtk-vcodec/vdec_drv_if.c +++ b/drivers/media/platform/mtk-vcodec/vdec_drv_if.c @@ -10,9 +10,9 @@ #include "mtk_vcodec_dec_pm.h" #include "mtk_vpu.h" -const struct vdec_common_if *get_h264_dec_comm_if(void); -const struct vdec_common_if *get_vp8_dec_comm_if(void); -const struct vdec_common_if *get_vp9_dec_comm_if(void); +extern const struct vdec_common_if vdec_h264_if; +extern const struct vdec_common_if vdec_vp8_if; +extern const struct vdec_common_if vdec_vp9_if; int vdec_if_init(struct mtk_vcodec_ctx *ctx, unsigned int fourcc) { @@ -20,13 +20,13 @@ int vdec_if_init(struct mtk_vcodec_ctx *ctx, unsigned int fourcc) switch (fourcc) { case V4L2_PIX_FMT_H264: - ctx->dec_if = get_h264_dec_comm_if(); + ctx->dec_if = &vdec_h264_if; break; case V4L2_PIX_FMT_VP8: - ctx->dec_if = get_vp8_dec_comm_if(); + ctx->dec_if = &vdec_vp8_if; break; case V4L2_PIX_FMT_VP9: - ctx->dec_if = get_vp9_dec_comm_if(); + ctx->dec_if = &vdec_vp9_if; break; default: return -EINVAL; diff --git a/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c b/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c index bfe61d5dc1cb..4e1d933395cd 100644 --- a/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c +++ b/drivers/media/platform/mtk-vcodec/venc/venc_h264_if.c @@ -649,16 +649,9 @@ static int h264_enc_deinit(void *handle) return ret; } -static const struct venc_common_if venc_h264_if = { +const struct venc_common_if venc_h264_if = { .init = h264_enc_init, .encode = h264_enc_encode, .set_param = h264_enc_set_param, .deinit = h264_enc_deinit, }; - -const struct venc_common_if *get_h264_enc_comm_if(void); - -const struct venc_common_if *get_h264_enc_comm_if(void) -{ - return &venc_h264_if; -} diff --git a/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c b/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c index af23367cf1dd..2d1372ab6486 100644 --- a/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c +++ b/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c @@ -455,16 +455,9 @@ static int vp8_enc_deinit(void *handle) return ret; } -static const struct venc_common_if venc_vp8_if = { +const struct venc_common_if venc_vp8_if = { .init = vp8_enc_init, .encode = vp8_enc_encode, .set_param = vp8_enc_set_param, .deinit = vp8_enc_deinit, }; - -const struct venc_common_if *get_vp8_enc_comm_if(void); - -const struct venc_common_if *get_vp8_enc_comm_if(void) -{ - return &venc_vp8_if; -} diff --git a/drivers/media/platform/mtk-vcodec/venc_drv_if.c b/drivers/media/platform/mtk-vcodec/venc_drv_if.c index 318af1b4b6e7..cf5bfa296d20 100644 --- a/drivers/media/platform/mtk-vcodec/venc_drv_if.c +++ b/drivers/media/platform/mtk-vcodec/venc_drv_if.c @@ -11,8 +11,8 @@ #include "mtk_vcodec_enc_pm.h" #include "mtk_vpu.h" -const struct venc_common_if *get_h264_enc_comm_if(void); -const struct venc_common_if *get_vp8_enc_comm_if(void); +extern const struct venc_common_if venc_h264_if; +extern const struct venc_common_if venc_vp8_if; int venc_if_init(struct mtk_vcodec_ctx *ctx, unsigned int fourcc) { @@ -20,10 +20,10 @@ int venc_if_init(struct mtk_vcodec_ctx *ctx, unsigned int fourcc) switch (fourcc) { case V4L2_PIX_FMT_VP8: - ctx->enc_if = get_vp8_enc_comm_if(); + ctx->enc_if = &venc_vp8_if; break; case V4L2_PIX_FMT_H264: - ctx->enc_if = get_h264_enc_comm_if(); + ctx->enc_if = &venc_h264_if; break; default: return -EINVAL; From patchwork Tue Jun 4 09:37:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Courbot X-Patchwork-Id: 10974505 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 382552D49 for ; Tue, 4 Jun 2019 09:38:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25EA220000 for ; Tue, 4 Jun 2019 09:38:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1A06B287CD; Tue, 4 Jun 2019 09:38:08 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 777C920000 for ; Tue, 4 Jun 2019 09:38:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727174AbfFDJiG (ORCPT ); Tue, 4 Jun 2019 05:38:06 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:33915 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727166AbfFDJiF (ORCPT ); Tue, 4 Jun 2019 05:38:05 -0400 Received: by mail-pf1-f196.google.com with SMTP id c85so3551125pfc.1 for ; Tue, 04 Jun 2019 02:38:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Kkz/XzAOhnm/D/+CBYg1z225Vw/50tqayYaD8NUxlbU=; b=lNej2GHpJFHhSX5Wafo2JC+jKDIiMJEwglY1egsj2tTgl0CQtE88cOwbO0CgShR/KB Ei4wKW9rV86pYeUnXfZu+AQwz61DDo54QbRPMjYNhpkuvX3qkzL+8VGxuV7UGUS6G+jC NfY7SaKvaII5e5ct8H33XKnTvOJMIVnIWbuCQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Kkz/XzAOhnm/D/+CBYg1z225Vw/50tqayYaD8NUxlbU=; b=B/kvPftm2ZmuBjlI6J30oAPL6ZN08oum/5GJizlScQoXb9qYQmH/M306Foihl90a26 qiO3BLSTT4Ekd6T9/8/2qXWDoxbqaLot1f5llZr1aMHP1FJw4F8WOKFCEwHbDslJsIQ1 98foKHd+w0RrQ4u+sAkfXOKghYyPFIYT/GBG+Gny3vJfMFfzb/5RSZ3kcCVvA4DcSqwR 1kKWNA3EZxw8Qga8WhRJNLN8niQliUiybIvT6FIAdj3SbOqWcwlsTbGmLvpmqFq8S/eE rvjQ818I/RymjQzUFRcX8NmBzULYXu+2o7KK5PEQ2GLrbGteUPqRq0zr9JDn0/ZAKfeH BR1g== X-Gm-Message-State: APjAAAXVElIx4KnrLaNRtwtViyPbBKvKmV5puEFB6eyRI9l2tDumZ7Iy eGVPGVLNuTxMDjez1zan10CEAQ== X-Google-Smtp-Source: APXvYqz2Fz/pnGXv0ZPvgJW7e6d7ZqtCPt+NixsSUGw1uA+K5fsccM7BUPplF4NCNUk+DabA0RDGRQ== X-Received: by 2002:a17:90a:372a:: with SMTP id u39mr7218059pjb.2.1559641084175; Tue, 04 Jun 2019 02:38:04 -0700 (PDT) Received: from acourbot.tok.corp.google.com ([2401:fa00:4:4:9712:8cf1:d0f:7d33]) by smtp.gmail.com with ESMTPSA id j7sm17431588pfa.184.2019.06.04.02.38.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jun 2019 02:38:03 -0700 (PDT) From: Alexandre Courbot To: Tiffany Lin , Andrew-CT Chen , Mauro Carvalho Chehab , Yunfei Dong , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Alexandre Courbot Subject: [PATCH 4/5] media: mtk-vcodec: constify formats Date: Tue, 4 Jun 2019 18:37:36 +0900 Message-Id: <20190604093737.172599-5-acourbot@chromium.org> X-Mailer: git-send-email 2.22.0.rc1.311.g5d7573a151-goog In-Reply-To: <20190604093737.172599-1-acourbot@chromium.org> References: <20190604093737.172599-1-acourbot@chromium.org> MIME-Version: 1.0 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 Formats are read-only internal memory structures, so make them const. Signed-off-by: Alexandre Courbot --- .../platform/mtk-vcodec/mtk_vcodec_dec.c | 19 ++++++++++--------- .../platform/mtk-vcodec/mtk_vcodec_drv.h | 2 +- .../platform/mtk-vcodec/mtk_vcodec_enc.c | 19 ++++++++++--------- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c index 371e70d6a803..131a8117ece2 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c @@ -19,7 +19,7 @@ #define DFT_CFG_WIDTH MTK_VDEC_MIN_W #define DFT_CFG_HEIGHT MTK_VDEC_MIN_H -static struct mtk_video_fmt mtk_video_formats[] = { +static const struct mtk_video_fmt mtk_video_formats[] = { { .fourcc = V4L2_PIX_FMT_H264, .type = MTK_FMT_DEC, @@ -63,9 +63,9 @@ static const struct mtk_codec_framesizes mtk_vdec_framesizes[] = { #define NUM_SUPPORTED_FRAMESIZE ARRAY_SIZE(mtk_vdec_framesizes) #define NUM_FORMATS ARRAY_SIZE(mtk_video_formats) -static struct mtk_video_fmt *mtk_vdec_find_format(struct v4l2_format *f) +static const struct mtk_video_fmt *mtk_vdec_find_format(struct v4l2_format *f) { - struct mtk_video_fmt *fmt; + const struct mtk_video_fmt *fmt; unsigned int k; for (k = 0; k < NUM_FORMATS; k++) { @@ -266,7 +266,7 @@ static void mtk_vdec_flush_decoder(struct mtk_vcodec_ctx *ctx) static void mtk_vdec_update_fmt(struct mtk_vcodec_ctx *ctx, unsigned int pixelformat) { - struct mtk_video_fmt *fmt; + const struct mtk_video_fmt *fmt; struct mtk_q_data *dst_q_data; unsigned int k; @@ -639,7 +639,8 @@ static int vidioc_vdec_subscribe_evt(struct v4l2_fh *fh, } } -static int vidioc_try_fmt(struct v4l2_format *f, struct mtk_video_fmt *fmt) +static int vidioc_try_fmt(struct v4l2_format *f, + const struct mtk_video_fmt *fmt) { struct v4l2_pix_format_mplane *pix_fmt_mp = &f->fmt.pix_mp; int i; @@ -712,7 +713,7 @@ static int vidioc_try_fmt(struct v4l2_format *f, struct mtk_video_fmt *fmt) static int vidioc_try_fmt_vid_cap_mplane(struct file *file, void *priv, struct v4l2_format *f) { - struct mtk_video_fmt *fmt; + const struct mtk_video_fmt *fmt; fmt = mtk_vdec_find_format(f); if (!fmt) { @@ -727,7 +728,7 @@ static int vidioc_try_fmt_vid_out_mplane(struct file *file, void *priv, struct v4l2_format *f) { struct v4l2_pix_format_mplane *pix_fmt_mp = &f->fmt.pix_mp; - struct mtk_video_fmt *fmt; + const struct mtk_video_fmt *fmt; fmt = mtk_vdec_find_format(f); if (!fmt) { @@ -821,7 +822,7 @@ static int vidioc_vdec_s_fmt(struct file *file, void *priv, struct v4l2_pix_format_mplane *pix_mp; struct mtk_q_data *q_data; int ret = 0; - struct mtk_video_fmt *fmt; + const struct mtk_video_fmt *fmt; mtk_v4l2_debug(3, "[%d]", ctx->id); @@ -920,7 +921,7 @@ static int vidioc_enum_framesizes(struct file *file, void *priv, static int vidioc_enum_fmt(struct v4l2_fmtdesc *f, bool output_queue) { - struct mtk_video_fmt *fmt; + const struct mtk_video_fmt *fmt; int i, j = 0; for (i = 0; i < NUM_FORMATS; i++) { diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h index 4b10996e6532..0a29a0694124 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h @@ -124,7 +124,7 @@ struct mtk_q_data { enum v4l2_field field; unsigned int bytesperline[MTK_VCODEC_MAX_PLANES]; unsigned int sizeimage[MTK_VCODEC_MAX_PLANES]; - struct mtk_video_fmt *fmt; + const struct mtk_video_fmt *fmt; }; /** diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c index 1a3845809b92..868147616da7 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c @@ -24,7 +24,7 @@ static void mtk_venc_worker(struct work_struct *work); -static struct mtk_video_fmt mtk_video_formats[] = { +static const struct mtk_video_fmt mtk_video_formats[] = { { .fourcc = V4L2_PIX_FMT_NV12M, .type = MTK_FMT_FRAME, @@ -153,7 +153,7 @@ static const struct v4l2_ctrl_ops mtk_vcodec_enc_ctrl_ops = { static int vidioc_enum_fmt(struct v4l2_fmtdesc *f, bool output_queue) { - struct mtk_video_fmt *fmt; + const struct mtk_video_fmt *fmt; int i, j = 0; for (i = 0; i < NUM_FORMATS; ++i) { @@ -261,9 +261,9 @@ static struct mtk_q_data *mtk_venc_get_q_data(struct mtk_vcodec_ctx *ctx, return &ctx->q_data[MTK_Q_DATA_DST]; } -static struct mtk_video_fmt *mtk_venc_find_format(struct v4l2_format *f) +static const struct mtk_video_fmt *mtk_venc_find_format(struct v4l2_format *f) { - struct mtk_video_fmt *fmt; + const struct mtk_video_fmt *fmt; unsigned int k; for (k = 0; k < NUM_FORMATS; k++) { @@ -278,7 +278,8 @@ static struct mtk_video_fmt *mtk_venc_find_format(struct v4l2_format *f) /* V4L2 specification suggests the driver corrects the format struct if any of * the dimensions is unsupported */ -static int vidioc_try_fmt(struct v4l2_format *f, struct mtk_video_fmt *fmt) +static int vidioc_try_fmt(struct v4l2_format *f, + const struct mtk_video_fmt *fmt) { struct v4l2_pix_format_mplane *pix_fmt_mp = &f->fmt.pix_mp; int i; @@ -414,7 +415,7 @@ static int vidioc_venc_s_fmt_cap(struct file *file, void *priv, struct vb2_queue *vq; struct mtk_q_data *q_data; int i, ret; - struct mtk_video_fmt *fmt; + const struct mtk_video_fmt *fmt; vq = v4l2_m2m_get_vq(ctx->m2m_ctx, f->type); if (!vq) { @@ -476,7 +477,7 @@ static int vidioc_venc_s_fmt_out(struct file *file, void *priv, struct vb2_queue *vq; struct mtk_q_data *q_data; int ret, i; - struct mtk_video_fmt *fmt; + const struct mtk_video_fmt *fmt; struct v4l2_pix_format_mplane *pix_fmt_mp = &f->fmt.pix_mp; vq = v4l2_m2m_get_vq(ctx->m2m_ctx, f->type); @@ -575,7 +576,7 @@ static int vidioc_venc_g_fmt(struct file *file, void *priv, static int vidioc_try_fmt_vid_cap_mplane(struct file *file, void *priv, struct v4l2_format *f) { - struct mtk_video_fmt *fmt; + const struct mtk_video_fmt *fmt; struct mtk_vcodec_ctx *ctx = fh_to_ctx(priv); fmt = mtk_venc_find_format(f); @@ -594,7 +595,7 @@ static int vidioc_try_fmt_vid_cap_mplane(struct file *file, void *priv, static int vidioc_try_fmt_vid_out_mplane(struct file *file, void *priv, struct v4l2_format *f) { - struct mtk_video_fmt *fmt; + const struct mtk_video_fmt *fmt; fmt = mtk_venc_find_format(f); if (!fmt) { From patchwork Tue Jun 4 09:37:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Courbot X-Patchwork-Id: 10974511 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 2E46C3A3F for ; Tue, 4 Jun 2019 09:38:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BE4620000 for ; Tue, 4 Jun 2019 09:38:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0FF1F287CB; Tue, 4 Jun 2019 09:38:10 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 A80D520000 for ; Tue, 4 Jun 2019 09:38:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727187AbfFDJiI (ORCPT ); Tue, 4 Jun 2019 05:38:08 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:35661 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727179AbfFDJiH (ORCPT ); Tue, 4 Jun 2019 05:38:07 -0400 Received: by mail-pg1-f194.google.com with SMTP id s27so4414832pgl.2 for ; Tue, 04 Jun 2019 02:38:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kfKR4zIJY5Q7mLLSSnEqtRMlxyZNbSUA1f1fGIbLQtA=; b=SqKAjRwGPeznbRHq14yh+MdKPzB2UlkQq+rY79BVw0o99j5riYGogmLQWyRGa4CV9D yXU+nzbphMJin777kMGmpYxmiOt3guezpTWJ80gMOevfTZm/ve7AXEsdxR1ynh36o1q3 TBq7U2o8GgviftlEn+OeJATftUgCrWBanShTU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kfKR4zIJY5Q7mLLSSnEqtRMlxyZNbSUA1f1fGIbLQtA=; b=WLWjb+4MDTcdYm3wI2O2ke8ZEED2FVuBxlfX9Op5a+q4wOBfs3iEXgvB59L2t1WMmZ zk4JbQc+dP3VSdbBXsiE2DEHl14zO3Sjw6/E3+3SRca23Ui+d7DhuQ8Uvkow5keDGXUL zLBj6kh0WSac5o4GOO/R6ciLJ3C49gXM9M9+StVWch4Ws77aJ8OEp3OY/K0omNd3MNjX H0G1BGbxpvnOH4jFpi76n02WqgDWXIlIwP19BvEpYqgTSYCl8rjP1SPz1sF2wyQM87sk P6nU7LUzIyJ6zzW8qq0n1XPnhVOR6PHcmG+B40VfKxPpsMPhThHYKntWgJ0XL2Aw/j+s rU2A== X-Gm-Message-State: APjAAAXMXZneTjCLWyVxdtKwnvnTWub2K/Fj6FQVfr4gGlL2wxAwXy4G OfcNiIN802vFRwgj6kv/chy/Aw== X-Google-Smtp-Source: APXvYqyWS5dM/l4M3+5y02FrXWl3FHdeFzRApJLhFiUHB9nkoj0cukopH+788acAn59bdd3teuxmBg== X-Received: by 2002:a17:90a:cf0b:: with SMTP id h11mr29074586pju.90.1559641087044; Tue, 04 Jun 2019 02:38:07 -0700 (PDT) Received: from acourbot.tok.corp.google.com ([2401:fa00:4:4:9712:8cf1:d0f:7d33]) by smtp.gmail.com with ESMTPSA id j7sm17431588pfa.184.2019.06.04.02.38.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jun 2019 02:38:06 -0700 (PDT) From: Alexandre Courbot To: Tiffany Lin , Andrew-CT Chen , Mauro Carvalho Chehab , Yunfei Dong , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Alexandre Courbot Subject: [PATCH 5/5] media: mtk-vcodec: support single-buffer frames Date: Tue, 4 Jun 2019 18:37:37 +0900 Message-Id: <20190604093737.172599-6-acourbot@chromium.org> X-Mailer: git-send-email 2.22.0.rc1.311.g5d7573a151-goog In-Reply-To: <20190604093737.172599-1-acourbot@chromium.org> References: <20190604093737.172599-1-acourbot@chromium.org> MIME-Version: 1.0 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 From: Yunfei Dong MT8183 will use a multi-planar format backed by a single buffer. Adapt the existing code to be able to handle such frames instead of assuming each frame is backed by two buffers. Signed-off-by: Yunfei Dong Co-developed-by: Alexandre Courbot Signed-off-by: Alexandre Courbot [acourbot: refactor, cleanup and split] --- drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c index 131a8117ece2..6b99b877a3b4 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c @@ -117,8 +117,9 @@ static struct vb2_buffer *get_display_buffer(struct mtk_vcodec_ctx *ctx) if (dstbuf->used) { vb2_set_plane_payload(&dstbuf->vb.vb2_buf, 0, ctx->picinfo.fb_sz[0]); - vb2_set_plane_payload(&dstbuf->vb.vb2_buf, 1, - ctx->picinfo.fb_sz[1]); + if (ctx->q_data[MTK_Q_DATA_DST].fmt->num_planes == 2) + vb2_set_plane_payload(&dstbuf->vb.vb2_buf, 1, + ctx->picinfo.fb_sz[1]); mtk_v4l2_debug(2, "[%d]status=%x queue id=%d to done_list %d", @@ -389,7 +390,8 @@ static void mtk_vdec_worker(struct work_struct *work) vdec_if_decode(ctx, NULL, NULL, &res_chg); clean_display_buffer(ctx); vb2_set_plane_payload(&dst_buf_info->vb.vb2_buf, 0, 0); - vb2_set_plane_payload(&dst_buf_info->vb.vb2_buf, 1, 0); + if (ctx->q_data[MTK_Q_DATA_DST].fmt->num_planes == 2) + vb2_set_plane_payload(&dst_buf_info->vb.vb2_buf, 1, 0); dst_buf->flags |= V4L2_BUF_FLAG_LAST; v4l2_m2m_buf_done(&dst_buf_info->vb, VB2_BUF_STATE_DONE); clean_free_buffer(ctx); @@ -1320,7 +1322,8 @@ static void vb2ops_vdec_stop_streaming(struct vb2_queue *q) while ((dst_buf = v4l2_m2m_dst_buf_remove(ctx->m2m_ctx))) { vb2_set_plane_payload(&dst_buf->vb2_buf, 0, 0); - vb2_set_plane_payload(&dst_buf->vb2_buf, 1, 0); + if (ctx->q_data[MTK_Q_DATA_DST].fmt->num_planes == 2) + vb2_set_plane_payload(&dst_buf->vb2_buf, 1, 0); v4l2_m2m_buf_done(dst_buf, VB2_BUF_STATE_ERROR); }