diff mbox series

[2/2] media: venus: core: add qcs615 DT compatible and resource data

Message ID 20241008-add_qcs615_video-v1-2-436ce07bfc63@quicinc.com (mailing list archive)
State Not Applicable
Headers show
Series media: venus: enable venus support on qcs615 | expand

Commit Message

Renjiang Han via B4 Relay Oct. 8, 2024, 11:16 a.m. UTC
From: Renjiang Han <quic_renjiang@quicinc.com>

add qcs615 DT compatible and resource data

Change-Id: I1a06f105f030cbf16f48a32f8c50c814f0dbde7a
Signed-off-by: Renjiang Han <quic_renjiang@quicinc.com>
---
 drivers/media/platform/qcom/venus/core.c | 50 ++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

Comments

Dmitry Baryshkov Oct. 8, 2024, 11:33 a.m. UTC | #1
On Tue, Oct 08, 2024 at 04:46:35PM GMT, Renjiang Han via B4 Relay wrote:
> From: Renjiang Han <quic_renjiang@quicinc.com>
> 
> add qcs615 DT compatible and resource data

Please expand the commit message.

> 
> Change-Id: I1a06f105f030cbf16f48a32f8c50c814f0dbde7a

No Gerrit tags.

> Signed-off-by: Renjiang Han <quic_renjiang@quicinc.com>
> ---
>  drivers/media/platform/qcom/venus/core.c | 50 ++++++++++++++++++++++++++++++++
>  1 file changed, 50 insertions(+)
> 
> diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
> index 84e95a46dfc9832981ac1c0c58e226a506896ade..15cd78279cb7487f5f1da4e5d617da7b4a481451 100644
> --- a/drivers/media/platform/qcom/venus/core.c
> +++ b/drivers/media/platform/qcom/venus/core.c
> @@ -816,6 +816,55 @@ static const struct venus_resources sc7180_res = {
>  	.fwname = "qcom/venus-5.4/venus.mbn",
>  };
>  
> +static const struct freq_tbl qcs615_freq_table[] = {
> +	{ 0, 460000000 },
> +	{ 0, 410000000 },
> +	{ 0, 380000000 },
> +	{ 0, 300000000 },
> +	{ 0, 240000000 },
> +	{ 0, 133333333 },
> +};
> +
> +static const struct bw_tbl qcs615_bw_table_enc[] = {
> +	{  972000,  951000, 0, 1434000, 0 },	/* 3840x2160@30 */
> +	{  489600,  723000, 0,  973000, 0 },	/* 1920x1080@60 */
> +	{  244800,  370000, 0,	495000, 0 },	/* 1920x1080@30 */
> +};
> +
> +static const struct bw_tbl qcs615_bw_table_dec[] = {
> +	{ 1036800, 1987000, 0, 2797000, 0 },	/* 4096x2160@30 */
> +	{  489600, 1040000, 0, 1298000, 0 },	/* 1920x1080@60 */
> +	{  244800,  530000, 0,  659000, 0 },	/* 1920x1080@30 */
> +};

As a feedback to Iris developers. The configuration below is the same as
the existing sc7180 config. The only difference being the bandwidth and
frequency tables. We should find a way to move frequency data to OPP
tables to remove the necessity to duplicate platform definitions.

> +
> +static const struct venus_resources qcs615_res = {
> +	.freq_tbl = qcs615_freq_table,
> +	.freq_tbl_size = ARRAY_SIZE(qcs615_freq_table),
> +	.bw_tbl_enc = qcs615_bw_table_enc,
> +	.bw_tbl_enc_size = ARRAY_SIZE(qcs615_bw_table_enc),
> +	.bw_tbl_dec = qcs615_bw_table_dec,
> +	.bw_tbl_dec_size = ARRAY_SIZE(qcs615_bw_table_dec),
> +	.clks = {"core", "iface", "bus"},
> +	.clks_num = 3,
> +	.vcodec0_clks = {"vcodec0_core", "vcodec0_bus"},
> +	.vcodec_clks_num = 2,
> +	.vcodec_pmdomains = (const char *[]) { "venus", "vcodec0" },
> +	.vcodec_pmdomains_num = 2,
> +	.opp_pmdomain = (const char *[]) { "cx", NULL },
> +	.vcodec_num = 1,
> +	.hfi_version = HFI_VERSION_4XX,
> +	.vpu_version = VPU_VERSION_AR50,
> +	.vmem_id = VIDC_RESOURCE_NONE,
> +	.vmem_size = 0,
> +	.vmem_addr = 0,
> +	.dma_mask = 0xe0000000 - 1,
> +	.cp_start = 0,
> +	.cp_size = 0x70800000,
> +	.cp_nonpixel_start = 0x1000000,
> +	.cp_nonpixel_size = 0x24800000,
> +	.fwname = "qcom/venus-5.4/venus.mbn",
> +};
> +
>  static const struct freq_tbl sm8250_freq_table[] = {
>  	{ 0, 444000000 },
>  	{ 0, 366000000 },
> @@ -943,6 +992,7 @@ static const struct of_device_id venus_dt_match[] = {
>  	{ .compatible = "qcom,sc7180-venus", .data = &sc7180_res, },
>  	{ .compatible = "qcom,sc7280-venus", .data = &sc7280_res, },
>  	{ .compatible = "qcom,sm8250-venus", .data = &sm8250_res, },
> +	{ .compatible = "qcom,qcs615-venus", .data = &qcs615_res, },

The list is sorted. PLease keep it this way.

>  	{ }
>  };
>  MODULE_DEVICE_TABLE(of, venus_dt_match);
> 
> -- 
> 2.34.1
> 
>
Renjiang Han Nov. 12, 2024, 7:36 a.m. UTC | #2
Hi @Dmitry Baryshkov

Dmitry: As a feedback to Iris developers. The configuration below is the same as the existing sc7180 config. The only difference being the bandwidth and frequency tables. We should find a way to move frequency data to OPP tables to remove the necessity to duplicate platform definitions.

Renjiang: For this comment, do you mean I need to change it like this? Extract the parameters common to sc7180 and qcs615 as common resources. Then reload these parameters for sc7180 and qcs615 respectively.

Dmitry: No. I meant using DT to describe frequency differences _and_ using fallback compat strings to show that on QCS615 Iris is using the same hardware as SC7180. However, we don't have Iris support for SC7180 (only Venus supports that platform), so it was more of a note to Vikash and Dikshita to account for such issues during Iris development

OK, got it. Thanks for your reply. Your idea is good, I agree with it. This is a big change on Venus. We will consider it when refactoring the code on Iris.



Best Regards,
Renjiang

-----Original Message-----
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> 
Sent: Tuesday, October 8, 2024 7:33 PM
To: Renjiang Han (QUIC) <quic_renjiang@quicinc.com>
Cc: Vikash Garodia (QUIC) <quic_vgarodia@quicinc.com>; kernel@quicinc.com; linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH 2/2] media: venus: core: add qcs615 DT compatible and resource data

On Tue, Oct 08, 2024 at 04:46:35PM GMT, Renjiang Han via B4 Relay wrote:
> From: Renjiang Han <quic_renjiang@quicinc.com>
> 
> add qcs615 DT compatible and resource data

Please expand the commit message.

> 
> Change-Id: I1a06f105f030cbf16f48a32f8c50c814f0dbde7a

No Gerrit tags.

> Signed-off-by: Renjiang Han <quic_renjiang@quicinc.com>
> ---
>  drivers/media/platform/qcom/venus/core.c | 50 
> ++++++++++++++++++++++++++++++++
>  1 file changed, 50 insertions(+)
> 
> diff --git a/drivers/media/platform/qcom/venus/core.c 
> b/drivers/media/platform/qcom/venus/core.c
> index 
> 84e95a46dfc9832981ac1c0c58e226a506896ade..15cd78279cb7487f5f1da4e5d617
> da7b4a481451 100644
> --- a/drivers/media/platform/qcom/venus/core.c
> +++ b/drivers/media/platform/qcom/venus/core.c
> @@ -816,6 +816,55 @@ static const struct venus_resources sc7180_res = {
>  	.fwname = "qcom/venus-5.4/venus.mbn",  };
>  
> +static const struct freq_tbl qcs615_freq_table[] = {
> +	{ 0, 460000000 },
> +	{ 0, 410000000 },
> +	{ 0, 380000000 },
> +	{ 0, 300000000 },
> +	{ 0, 240000000 },
> +	{ 0, 133333333 },
> +};
> +
> +static const struct bw_tbl qcs615_bw_table_enc[] = {
> +	{  972000,  951000, 0, 1434000, 0 },	/* 3840x2160@30 */
> +	{  489600,  723000, 0,  973000, 0 },	/* 1920x1080@60 */
> +	{  244800,  370000, 0,	495000, 0 },	/* 1920x1080@30 */
> +};
> +
> +static const struct bw_tbl qcs615_bw_table_dec[] = {
> +	{ 1036800, 1987000, 0, 2797000, 0 },	/* 4096x2160@30 */
> +	{  489600, 1040000, 0, 1298000, 0 },	/* 1920x1080@60 */
> +	{  244800,  530000, 0,  659000, 0 },	/* 1920x1080@30 */
> +};

As a feedback to Iris developers. The configuration below is the same as the existing sc7180 config. The only difference being the bandwidth and frequency tables. We should find a way to move frequency data to OPP tables to remove the necessity to duplicate platform definitions.

> +
> +static const struct venus_resources qcs615_res = {
> +	.freq_tbl = qcs615_freq_table,
> +	.freq_tbl_size = ARRAY_SIZE(qcs615_freq_table),
> +	.bw_tbl_enc = qcs615_bw_table_enc,
> +	.bw_tbl_enc_size = ARRAY_SIZE(qcs615_bw_table_enc),
> +	.bw_tbl_dec = qcs615_bw_table_dec,
> +	.bw_tbl_dec_size = ARRAY_SIZE(qcs615_bw_table_dec),
> +	.clks = {"core", "iface", "bus"},
> +	.clks_num = 3,
> +	.vcodec0_clks = {"vcodec0_core", "vcodec0_bus"},
> +	.vcodec_clks_num = 2,
> +	.vcodec_pmdomains = (const char *[]) { "venus", "vcodec0" },
> +	.vcodec_pmdomains_num = 2,
> +	.opp_pmdomain = (const char *[]) { "cx", NULL },
> +	.vcodec_num = 1,
> +	.hfi_version = HFI_VERSION_4XX,
> +	.vpu_version = VPU_VERSION_AR50,
> +	.vmem_id = VIDC_RESOURCE_NONE,
> +	.vmem_size = 0,
> +	.vmem_addr = 0,
> +	.dma_mask = 0xe0000000 - 1,
> +	.cp_start = 0,
> +	.cp_size = 0x70800000,
> +	.cp_nonpixel_start = 0x1000000,
> +	.cp_nonpixel_size = 0x24800000,
> +	.fwname = "qcom/venus-5.4/venus.mbn", };
> +
>  static const struct freq_tbl sm8250_freq_table[] = {
>  	{ 0, 444000000 },
>  	{ 0, 366000000 },
> @@ -943,6 +992,7 @@ static const struct of_device_id venus_dt_match[] = {
>  	{ .compatible = "qcom,sc7180-venus", .data = &sc7180_res, },
>  	{ .compatible = "qcom,sc7280-venus", .data = &sc7280_res, },
>  	{ .compatible = "qcom,sm8250-venus", .data = &sm8250_res, },
> +	{ .compatible = "qcom,qcs615-venus", .data = &qcs615_res, },

The list is sorted. PLease keep it this way.

>  	{ }
>  };
>  MODULE_DEVICE_TABLE(of, venus_dt_match);
> 
> --
> 2.34.1
> 
> 

--
With best wishes
Dmitry
diff mbox series

Patch

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 84e95a46dfc9832981ac1c0c58e226a506896ade..15cd78279cb7487f5f1da4e5d617da7b4a481451 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -816,6 +816,55 @@  static const struct venus_resources sc7180_res = {
 	.fwname = "qcom/venus-5.4/venus.mbn",
 };
 
+static const struct freq_tbl qcs615_freq_table[] = {
+	{ 0, 460000000 },
+	{ 0, 410000000 },
+	{ 0, 380000000 },
+	{ 0, 300000000 },
+	{ 0, 240000000 },
+	{ 0, 133333333 },
+};
+
+static const struct bw_tbl qcs615_bw_table_enc[] = {
+	{  972000,  951000, 0, 1434000, 0 },	/* 3840x2160@30 */
+	{  489600,  723000, 0,  973000, 0 },	/* 1920x1080@60 */
+	{  244800,  370000, 0,	495000, 0 },	/* 1920x1080@30 */
+};
+
+static const struct bw_tbl qcs615_bw_table_dec[] = {
+	{ 1036800, 1987000, 0, 2797000, 0 },	/* 4096x2160@30 */
+	{  489600, 1040000, 0, 1298000, 0 },	/* 1920x1080@60 */
+	{  244800,  530000, 0,  659000, 0 },	/* 1920x1080@30 */
+};
+
+static const struct venus_resources qcs615_res = {
+	.freq_tbl = qcs615_freq_table,
+	.freq_tbl_size = ARRAY_SIZE(qcs615_freq_table),
+	.bw_tbl_enc = qcs615_bw_table_enc,
+	.bw_tbl_enc_size = ARRAY_SIZE(qcs615_bw_table_enc),
+	.bw_tbl_dec = qcs615_bw_table_dec,
+	.bw_tbl_dec_size = ARRAY_SIZE(qcs615_bw_table_dec),
+	.clks = {"core", "iface", "bus"},
+	.clks_num = 3,
+	.vcodec0_clks = {"vcodec0_core", "vcodec0_bus"},
+	.vcodec_clks_num = 2,
+	.vcodec_pmdomains = (const char *[]) { "venus", "vcodec0" },
+	.vcodec_pmdomains_num = 2,
+	.opp_pmdomain = (const char *[]) { "cx", NULL },
+	.vcodec_num = 1,
+	.hfi_version = HFI_VERSION_4XX,
+	.vpu_version = VPU_VERSION_AR50,
+	.vmem_id = VIDC_RESOURCE_NONE,
+	.vmem_size = 0,
+	.vmem_addr = 0,
+	.dma_mask = 0xe0000000 - 1,
+	.cp_start = 0,
+	.cp_size = 0x70800000,
+	.cp_nonpixel_start = 0x1000000,
+	.cp_nonpixel_size = 0x24800000,
+	.fwname = "qcom/venus-5.4/venus.mbn",
+};
+
 static const struct freq_tbl sm8250_freq_table[] = {
 	{ 0, 444000000 },
 	{ 0, 366000000 },
@@ -943,6 +992,7 @@  static const struct of_device_id venus_dt_match[] = {
 	{ .compatible = "qcom,sc7180-venus", .data = &sc7180_res, },
 	{ .compatible = "qcom,sc7280-venus", .data = &sc7280_res, },
 	{ .compatible = "qcom,sm8250-venus", .data = &sm8250_res, },
+	{ .compatible = "qcom,qcs615-venus", .data = &qcs615_res, },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, venus_dt_match);