From patchwork Thu Feb 23 08:13:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?SXJ1aSBXYW5nICjnjovnkZ4p?= X-Patchwork-Id: 60825 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp196004wrd; Thu, 23 Feb 2023 00:14:02 -0800 (PST) X-Google-Smtp-Source: AK7set/F56g85cmW9zNiQk2ns8pPvhqFOFfTruP8QlUSEbjF+ihDjHn5Nytms/Y+HXiv7JOWWIxH X-Received: by 2002:a17:90a:fb84:b0:237:47b0:30d3 with SMTP id cp4-20020a17090afb8400b0023747b030d3mr3700033pjb.4.1677140042456; Thu, 23 Feb 2023 00:14:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677140042; cv=none; d=google.com; s=arc-20160816; b=lKWb7J51wyN8LI2xXFziEi339ap2E5GCQbbI6aHDts+idff1Sii3/SehRvpCcXv4aW 8QXw8X7OdeKXozs/8RugUtb+bOfYYZ8ccfHHn05KwU9iaSoa/5Om8/cYyEHyRYsw8UiM 91y4786NoMwOPw8ksc1CsM+bfpAZHeZ/cJZjT5m8jObMxpe9gLn/Ah4R7hyv4LyXq779 r2kWElTXJX2ON1IOGVEPKB5gCLHM+DMmED//5zyvj7gFI2LT3vxpWuxSo+WjgXVOYlZd +D3PCpm3m2wdVeYkEZ4Bhhqe32OoF6dPgijFa3IOx/aGa7UYvcoXMayZKOC2H777VrLT 81Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zKQNhHm6N//epT/kKKmOBAV+Pxos4Bzj8k8OKQmEryU=; b=uWYDQGgow8+M8XCnjItb8CVakoZwmJcqxGiUFRLNeLEne16j44pSpoAK+T29JbbRwY sc7iUSKilPJf3bMd+3UqpJVJGnFu8XaratLB5bT7r2YgPC9wB9rzjmBBDXhEurVXMgUw wajqGSeAGB/T9cmQVbqwgy3B3kREgtbdQ+X7NuJuwuSd+c3SAZ+c47mhAASmsC0Fk7tR WEensdOGi+SHqPwPI149o+xfG079u/9OKEtbHtZS8VFnccUht/XLgBuFSXO4R8MwwmXv Jp17Jo9yWXNERRvy3YlAT7ecfZrX37ZOTFODle6TnhfUc/a/4KUe3C1ZhAdaop4MIv0q i0Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=CEH9PjTO; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l11-20020a17090a72cb00b0023408c25bd7si15272690pjk.65.2023.02.23.00.13.49; Thu, 23 Feb 2023 00:14:02 -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=CEH9PjTO; 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 S233400AbjBWINg (ORCPT + 99 others); Thu, 23 Feb 2023 03:13:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232802AbjBWIN1 (ORCPT ); Thu, 23 Feb 2023 03:13:27 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F71A498AF; Thu, 23 Feb 2023 00:13:25 -0800 (PST) X-UUID: ed6a18aab35111ed945fc101203acc17-20230223 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=zKQNhHm6N//epT/kKKmOBAV+Pxos4Bzj8k8OKQmEryU=; b=CEH9PjTOQFSD3jfIGhhqVn4KGLVzN9YcXdGhq/CrSJ1Ct6wIcZE+zWVk9cJEEaEuT1/TAScDPXP8ck88tsIZaFBQvlPocXAabHZbhJwcJkf9vJFceXIPGtLKphcHZLnQPdqFF/rsLhxPmbVXHUyP+n+nKHWKkzqrzwa2GLMoGN8=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.20,REQID:922cd7d1-aded-4d41-afef-441fb634c8ea,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.20,REQID:922cd7d1-aded-4d41-afef-441fb634c8ea,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:25b5999,CLOUDID:0c87e6f3-ddba-41c3-91d9-10eeade8eac7,B ulkID:230223161319I53H5PP3,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,CO L:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-UUID: ed6a18aab35111ed945fc101203acc17-20230223 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 699362284; Thu, 23 Feb 2023 16:13:17 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Thu, 23 Feb 2023 16:13:16 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Thu, 23 Feb 2023 16:13:15 +0800 From: Irui Wang To: Hans Verkuil , Mauro Carvalho Chehab , Matthias Brugger , , , kyrie wu CC: , , , , , Tomasz Figa , , , Yunfei Dong , Irui Wang Subject: [V1,1/7] media: mtk-jpeg: Fixes jpeghw multi-core judgement Date: Thu, 23 Feb 2023 16:13:06 +0800 Message-ID: <20230223081312.29296-2-irui.wang@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230223081312.29296-1-irui.wang@mediatek.com> References: <20230223081312.29296-1-irui.wang@mediatek.com> MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758608796986568507?= X-GMAIL-MSGID: =?utf-8?q?1758608796986568507?= From: kyrie wu some chips have multi-hw, but others have only one, modify the condition of multi-hw judgement Fixes: 934e8bccac95 ("mtk-jpegenc: support jpegenc multi-hardware") Signed-off-by: kyrie wu Signed-off-by: irui wang Reviewed-by: AngeloGioacchino Del Regno --- drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c | 5 ++++- drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h | 2 ++ 2 files changed, 6 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 969516a940ba..6d052747a15e 100644 --- a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c +++ b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c @@ -1692,7 +1692,7 @@ static int mtk_jpeg_probe(struct platform_device *pdev) return -EINVAL; } - if (list_empty(&pdev->dev.devres_head)) { + if (!jpeg->variant->multi_core) { INIT_DELAYED_WORK(&jpeg->job_timeout_work, mtk_jpeg_job_timeout_work); @@ -1874,6 +1874,7 @@ static const struct mtk_jpeg_variant mtk_jpeg_drvdata = { .ioctl_ops = &mtk_jpeg_enc_ioctl_ops, .out_q_default_fourcc = V4L2_PIX_FMT_YUYV, .cap_q_default_fourcc = V4L2_PIX_FMT_JPEG, + .multi_core = false, }; static struct mtk_jpeg_variant mtk8195_jpegenc_drvdata = { @@ -1885,6 +1886,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, + .multi_core = true, }; static const struct mtk_jpeg_variant mtk8195_jpegdec_drvdata = { @@ -1896,6 +1898,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, + .multi_core = true, }; #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..f87358cc9f47 100644 --- a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h +++ b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h @@ -60,6 +60,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 + * @multi_core: mark jpeg hw is multi_core or not */ struct mtk_jpeg_variant { struct clk_bulk_data *clks; @@ -74,6 +75,7 @@ struct mtk_jpeg_variant { const struct v4l2_ioctl_ops *ioctl_ops; u32 out_q_default_fourcc; u32 cap_q_default_fourcc; + bool multi_core; }; struct mtk_jpeg_src_buf {