Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp764244rwb; Thu, 15 Dec 2022 02:02:26 -0800 (PST) X-Google-Smtp-Source: AA0mqf4+F57TZbZXVp35WDtbaqllvJIFBv5iZ9s9FBwGCoNo301lt6j+KO+Qm+9dkDi1H5jk8hZ3 X-Received: by 2002:a17:906:af0c:b0:7b8:882d:43ef with SMTP id lx12-20020a170906af0c00b007b8882d43efmr8855912ejb.0.1671098546390; Thu, 15 Dec 2022 02:02:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671098546; cv=none; d=google.com; s=arc-20160816; b=myo9t1EoplobXx8dSXEtELymJyU73BMdRp0fBGnfleWjDWwLe4sM1l9lEZjf1e4DqI 2+f/ro8bcRA4n4tZC2PWyl5Zez0Ii+geuRRYTy+M/yKAnSSotlgdolYtYQrfPbdGjV1H B2YTZwCpybrAriZsYMItCz+1CTIXWqX87EJaIDPe0ewnJGHlSidr/4pOsDsjWT+yYPm1 UGWzxSmKSFIxrCCtFDgeJuH5GM8RZj3bpssp+tA0W1YyJbLajg6oNh0QkxwSFYfKw4zy oxoxeXVrLNUUWAP7Rixt6J+e6ykkSrLqWEuVzuWzIk1MysCgVhUT4akhQoZV2J097q42 UzgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=iUpXfVshjq64D/vPuflrKozWJV+i90PR4zI/zWYnb50=; b=ScqKUCNMQjylALuSkLSSwTHPZ3Aj8kXh0pPEym0yvTug33yR79wMk02aHHf5hoLRgi 0hKqNUJ6o0nXFjofLL5e1jnZajJq8k1syZHw/xZJwq/yyYm6YMl3i9YkgdWU7Dj1dJT4 dh0B1H/EUUAbTpSs46OKiRbdTN27B6QKZU0xLKT0AgktublY74LnhKNZd1vNRv4q3joP LmeQsSvDsxxQvPO4YvbkOJlXFhACitUhs32JDvOint/m/Ky1S5Js6Hj9qV8NjF2cGMhL SRE7lNlbqHsrRR1hb60GkuHd/K90n8SD8B/erwmaorjiMaVsGqVBWrHF7OycsSCkTa+U 5XVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=jyqgkHEC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt37-20020a1709072da500b007aec7f879basi14859778ejc.22.2022.12.15.02.02.08; Thu, 15 Dec 2022 02:02:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=jyqgkHEC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230040AbiLOJaq (ORCPT + 69 others); Thu, 15 Dec 2022 04:30:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230011AbiLOJak (ORCPT ); Thu, 15 Dec 2022 04:30:40 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64A6A47330; Thu, 15 Dec 2022 01:30:34 -0800 (PST) X-UUID: 946220893ddb4fe6b9e803e59dae0231-20221215 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=iUpXfVshjq64D/vPuflrKozWJV+i90PR4zI/zWYnb50=; b=jyqgkHECrFtZvDyXc2sL0d9YgXcv2zMYyDqajCW/7BFuK7HPqvfdlf4MmlP1G29Jpa0QnJch8Aex+4octvRsK9FI0W/UTMBo9p3+FmUJS/IBI9UK0hUrozNGqPDZ2iYKJ/OLcv+8rRNzLqig8ow1dKw4U1jz1RS53F+xIZ75GK8=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.14,REQID:296c8b89-7f5f-41d0-9922-3e8ec0ba17fd,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:296c8b89-7f5f-41d0-9922-3e8ec0ba17fd,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:9a84adb4-d2e2-434d-b6d3-aeae88dfcc78,B ulkID:221215173031H616DXAG,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: 946220893ddb4fe6b9e803e59dae0231-20221215 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 478658547; Thu, 15 Dec 2022 17:30:31 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Thu, 15 Dec 2022 17:30:29 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 15 Dec 2022 17:30:28 +0800 From: Irui Wang To: Hans Verkuil , Mauro Carvalho Chehab , Matthias Brugger , , , kyrie wu CC: , , , , , Tomasz Figa , , , Irui Wang Subject: [PATCH] media: jpeg: refactor multi-hw judgement Date: Thu, 15 Dec 2022 17:30:26 +0800 Message-ID: <20221215093026.12322-1-irui.wang@mediatek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: kyrie wu some chips have multi-hw, but others have only one, modify the condition of multi-hw judgement Signed-off-by: kyrie wu Signed-off-by: irui wang --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 5 +++-- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h | 12 ++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c index 4a5c6415ad08..37db8b81a935 100644 --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c @@ -1695,8 +1695,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); @@ -1890,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 = { @@ -1901,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/mtk-jpeg/mtk_jpeg_core.h b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h index b9126476be8f..ec04a8ce73cf 100644 --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h +++ b/drivers/media/platform/mtk-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 { -- 2.18.0