Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp509416rwi; Thu, 20 Oct 2022 01:25:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6D2a52fJttfrL5zLA9Hvrir9d2y/98eq/K/SkZ/+OguOzLG5TDtxtB39QR1w6+mjvuA3zv X-Received: by 2002:a05:6402:550e:b0:456:f79f:2bed with SMTP id fi14-20020a056402550e00b00456f79f2bedmr11320821edb.106.1666254343618; Thu, 20 Oct 2022 01:25:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666254343; cv=none; d=google.com; s=arc-20160816; b=oHjeqyjwWCYQHEIJIshD8OubZFpgRq9xWxAG4iQp6A8FSJxvF0klQVy86Cmfj4D35T mqBKQ2cm7I5tkecQ0EbPOQnbHLinqVqakRPJet7iiImTFMcpIl2HuSkyFtKUUJnXvfUM HkGhIcY+859+Dh0EJoEx98Vo+dUOitiFCWDivBBdmmtO6QkCk2NeQ+H9r7oGo3YCg6de FvNpbaap8KQaIiMYHgqD6Vk0cFBSMXR3o+Exey8i//pTHgNhWu6wDhd/JCLK+LNlgl64 88S9mrjrDep9CCon0t/ODdrXWhqhlA4zmpjjrNtrdujjiEn/IXHHnoLDBRLeGaFcejqc 6R+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=JHljVWBcr4b76+FxHdScLRgEn2EIZbrBU/VBOXgvySU=; b=LPpQsKwJ5jil0gx1gI3l//Lpe880chyJm1AjirhyXjxSqZYUOWu2m2vfu3qW0AB3cj C5JUvTr59ozQseI89sXjtIOb+5Wd4oG/sS5tdXZPHe5q534rmjtCX76a7TVGBJJDQWCE EOhTmk48ABm1Z8wT7DXQ1y7cEw0K7oglhC+CrQnJBze/X8ax2UpedyE6vldjuqLIlSXC WHuksAxpCQfudF5GmXkP33nhq5gtAhU2w+i7mKhtgx+m/JF5GyPnNTFVJbSerZK5AyaS nCzq2jObZJYNTKTojutRZzLYcbfU2SlZPFCD6lLsyZWx6qu4H9q8iJYmrbdvt25KGT3l pngg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=di3FSsv9; 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 bk2-20020a170906b0c200b0077f2779c178si14888989ejb.254.2022.10.20.01.25.18; Thu, 20 Oct 2022 01:25:43 -0700 (PDT) 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=di3FSsv9; 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 S230448AbiJTHjg (ORCPT + 99 others); Thu, 20 Oct 2022 03:39:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230347AbiJTHjQ (ORCPT ); Thu, 20 Oct 2022 03:39:16 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52BD7175360; Thu, 20 Oct 2022 00:39:15 -0700 (PDT) X-UUID: 46f12f79541549c9b099de9b3e7f98be-20221020 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=JHljVWBcr4b76+FxHdScLRgEn2EIZbrBU/VBOXgvySU=; b=di3FSsv9Z3507iKS8SZB4NZEgzVvBr7x8KBVRZhJijZ3GMBrKJqXI16odHTXPfFBMWZOUdYHKtSxhedQT+iQqELfWqnwVzD0QHbD6yJbL+9dPwfF/g2GLVKIyo+SKGxR6drgw9Jp36ITPHMZqIVkNlpe5qkjzlcSvA6/rTnVd58=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.12,REQID:9cee2381-5df4-41f6-9c5d-7a0f4d70f689,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:62cd327,CLOUDID:c7f9e0ee-314c-4293-acb8-ca4299dd021f,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 46f12f79541549c9b099de9b3e7f98be-20221020 Received: from mtkmbs13n2.mediatek.inc [(172.21.101.108)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 189027976; Thu, 20 Oct 2022 15:39:10 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) 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; Thu, 20 Oct 2022 15:39:09 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Thu, 20 Oct 2022 15:39:09 +0800 From: Moudy Ho To: Mauro Carvalho Chehab , Matthias Brugger , Hans Verkuil CC: Chun-Kuang Hu , , , , , Moudy Ho Subject: [PATCH v2 5/9] media: platform: mtk-mdp3: chip config split about resolution limitations Date: Thu, 20 Oct 2022 15:38:58 +0800 Message-ID: <20221020073902.21039-6-moudy.ho@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20221020073902.21039-1-moudy.ho@mediatek.com> References: <20221020073902.21039-1-moudy.ho@mediatek.com> MIME-Version: 1.0 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,URIBL_BLOCKED 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 Due to differences in hardware design, the supported max and min resolutions and scaling capabilities will vary, and should be moved and integrated into the chip configuration header file. Signed-off-by: Moudy Ho --- .../mediatek/mdp3/mt8183/mdp3-plat-mt8183.h | 19 +++++++++++++++++ .../platform/mediatek/mdp3/mtk-mdp3-core.c | 1 + .../platform/mediatek/mdp3/mtk-mdp3-core.h | 1 + .../platform/mediatek/mdp3/mtk-mdp3-regs.c | 21 +------------------ 4 files changed, 22 insertions(+), 20 deletions(-) diff --git a/drivers/media/platform/mediatek/mdp3/mt8183/mdp3-plat-mt8183.h b/drivers/media/platform/mediatek/mdp3/mt8183/mdp3-plat-mt8183.h index 1be9cc55b9b5..c541176780aa 100644 --- a/drivers/media/platform/mediatek/mdp3/mt8183/mdp3-plat-mt8183.h +++ b/drivers/media/platform/mediatek/mdp3/mt8183/mdp3-plat-mt8183.h @@ -380,4 +380,23 @@ static const struct mdp_format mt8183_formats[] = { } }; +static const struct mdp_limit mt8183_mdp_def_limit = { + .out_limit = { + .wmin = 16, + .hmin = 16, + .wmax = 8176, + .hmax = 8176, + }, + .cap_limit = { + .wmin = 2, + .hmin = 2, + .wmax = 8176, + .hmax = 8176, + }, + .h_scale_up_max = 32, + .v_scale_up_max = 32, + .h_scale_down_max = 20, + .v_scale_down_max = 128, +}; + #endif /* __MDP3_PLAT_MT8183_H__ */ diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c index ce18cbf70e96..4b02c135b631 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c @@ -26,6 +26,7 @@ static const struct mtk_mdp_driver_data mt8183_mdp_driver_data = { .comp_data_len = ARRAY_SIZE(mt8183_mdp_comp_data), .format = mt8183_formats, .format_len = ARRAY_SIZE(mt8183_formats), + .def_limit = &mt8183_mdp_def_limit, }; static const struct of_device_id mdp_of_ids[] = { diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h index 982438a9ab02..52f87e59ba9e 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.h @@ -59,6 +59,7 @@ struct mtk_mdp_driver_data { unsigned int comp_data_len; const struct mdp_format *format; unsigned int format_len; + const struct mdp_limit *def_limit; }; struct mdp_dev { diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-regs.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-regs.c index cd6afbf53797..bb833ae27531 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-regs.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-regs.c @@ -11,25 +11,6 @@ #include "mtk-mdp3-regs.h" #include "mtk-mdp3-m2m.h" -static const struct mdp_limit mdp_def_limit = { - .out_limit = { - .wmin = 16, - .hmin = 16, - .wmax = 8176, - .hmax = 8176, - }, - .cap_limit = { - .wmin = 2, - .hmin = 2, - .wmax = 8176, - .hmax = 8176, - }, - .h_scale_up_max = 32, - .v_scale_up_max = 32, - .h_scale_down_max = 20, - .v_scale_down_max = 128, -}; - static const struct mdp_format *mdp_find_fmt(const struct mtk_mdp_driver_data *mdp_data, u32 pixelformat, u32 type) { @@ -485,7 +466,7 @@ int mdp_frameparam_init(struct mdp_dev *mdp, struct mdp_frameparam *param) return -EINVAL; INIT_LIST_HEAD(¶m->list); - param->limit = &mdp_def_limit; + param->limit = mdp->mdp_data->def_limit; param->type = MDP_STREAM_TYPE_BITBLT; frame = ¶m->output; -- 2.18.0