From patchwork Fri Dec 16 03:52:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Irui Wang X-Patchwork-Id: 635062 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 BB6DAC001B2 for ; Fri, 16 Dec 2022 03:53:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230063AbiLPDxA (ORCPT ); Thu, 15 Dec 2022 22:53:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229910AbiLPDw7 (ORCPT ); Thu, 15 Dec 2022 22:52:59 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C3ED528A9; Thu, 15 Dec 2022 19:52:57 -0800 (PST) X-UUID: 562ae0bf25344e8691c821ee4a9eb1ef-20221216 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:Message-ID:Date:Subject:CC:To:From; bh=K/oK2avKxchEbp1uEViFu13vz/2tqpYXBVak92TmE5I=; b=NGZtE/0tvWTXnR+SK6VkRD1QV4Zl+A6bnbOjGkQeb1rWiDUQRYBXOdmLY40iAhIoW/4QLFKDUiEQLhrC3ncQDHlvXz8jWccV6UXRujjoMuVaAcyAQKGLSQ6sgCIWTNwuIfAsc/bnZhlKWOPMvavbDEO222DW3TUBmn8fn4SvSzU=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.14, REQID:506b5b79-8b12-4d64-8835-addd0f7eea55, 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.14, REQID:506b5b79-8b12-4d64-8835-addd0f7eea55, 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:dcaaed0, CLOUDID:c7b0ccaf-9f02-4d44-9c44-6e4bb4e4f412, B ulkID:221216115252QTOBUL3Z,BulkQuantity:0,Recheck:0,SF:38|28|17|19|48,TC:n il,Content:0,EDM:-3,IP:nil,URL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 562ae0bf25344e8691c821ee4a9eb1ef-20221216 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1410368207; Fri, 16 Dec 2022 11:52:51 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs13n1.mediatek.inc (172.21.101.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Fri, 16 Dec 2022 11:52:50 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Fri, 16 Dec 2022 11:52:49 +0800 From: Irui Wang To: Hans Verkuil , Mauro Carvalho Chehab , Matthias Brugger , , , kyrie wu CC: , , , , , Tomasz Figa , , , Irui Wang Subject: [V2] media: jpeg: Fix multi-hw judgement Date: Fri, 16 Dec 2022 11:52:47 +0800 Message-ID: <20221216035247.18816-1-irui.wang@mediatek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: kyrie wu some chips have multi-hw, but others have only one, modify the condition of multi-hw judgement Fixs: 934e8bccac95 ("mtk-jpegenc: support jpegenc multi-hardware") Signed-off-by: kyrie wu Signed-off-by: irui wang --- drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c | 4 +++- drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c index 18e867a79f12..7472c1ee23ab 100644 --- a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c +++ b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c @@ -1694,7 +1694,7 @@ static int mtk_jpeg_probe(struct platform_device *pdev) return -EINVAL; } - if (list_empty(&pdev->dev.devres_head)) { + if (!jpeg->variant->hw_arch) { INIT_DELAYED_WORK(&jpeg->job_timeout_work, mtk_jpeg_job_timeout_work); @@ -1889,6 +1889,7 @@ static struct mtk_jpeg_variant mtk8195_jpegenc_drvdata = { .ioctl_ops = &mtk_jpeg_enc_ioctl_ops, .out_q_default_fourcc = V4L2_PIX_FMT_YUYV, .cap_q_default_fourcc = V4L2_PIX_FMT_JPEG, + .hw_arch = MTK_JPEG_HW_MULTI_CORE, }; static const struct mtk_jpeg_variant mtk8195_jpegdec_drvdata = { @@ -1900,6 +1901,7 @@ static const struct mtk_jpeg_variant mtk8195_jpegdec_drvdata = { .ioctl_ops = &mtk_jpeg_dec_ioctl_ops, .out_q_default_fourcc = V4L2_PIX_FMT_JPEG, .cap_q_default_fourcc = V4L2_PIX_FMT_YUV420M, + .hw_arch = MTK_JPEG_HW_MULTI_CORE, }; #if defined(CONFIG_OF) diff --git a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h index b9126476be8f..ec04a8ce73cf 100644 --- a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h +++ b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h @@ -46,6 +46,16 @@ enum mtk_jpeg_ctx_state { MTK_JPEG_SOURCE_CHANGE, }; +/** + * enum mtk_jpeg_hw_arch - arch of the jpeg hw + * @MTK_JPEG_HW_SINGLE_CORE: jpeg hw is single core + * @MTK_JPEG_HW_MULTI_CORE: jpeg hw is mluti-core + */ +enum mtk_jpeg_hw_arch { + MTK_JPEG_HW_SINGLE_CORE = 0, + MTK_JPEG_HW_MULTI_CORE = 1, +}; + /** * struct mtk_jpeg_variant - mtk jpeg driver variant * @clks: clock names @@ -60,6 +70,7 @@ enum mtk_jpeg_ctx_state { * @ioctl_ops: the callback of jpeg v4l2_ioctl_ops * @out_q_default_fourcc: output queue default fourcc * @cap_q_default_fourcc: capture queue default fourcc + * @hw_arch: mark jpeg hw arch */ struct mtk_jpeg_variant { struct clk_bulk_data *clks; @@ -74,6 +85,7 @@ struct mtk_jpeg_variant { const struct v4l2_ioctl_ops *ioctl_ops; u32 out_q_default_fourcc; u32 cap_q_default_fourcc; + enum mtk_jpeg_hw_arch hw_arch; }; struct mtk_jpeg_src_buf {