diff mbox series

[v3,2/4] media: venus: core: add qcs615 platform data

Message ID 20241125-add-venus-for-qcs615-v3-2-5a376b97a68e@quicinc.com (mailing list archive)
State New
Headers show
Series media: venus: enable venus on qcs615 | expand

Commit Message

Renjiang Han Nov. 25, 2024, 5:34 a.m. UTC
Initialize the platform data and enable venus driver probe of QCS615
SoC.

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

Comments

Renjiang Han Nov. 25, 2024, 8:44 a.m. UTC | #1
On Monday, November 25, 2024 1:35 PM, Renjiang Han wrote:
> Initialize the platform data and enable venus driver probe of QCS615 SoC.

Forgot to add Reviewed-by, next version will add Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>

> 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 423deb5e94dcb193974da23f9bd2d905bfeab2d9..39d8bcf62fe4f72674746b75994cce6cbaee94eb 100644
> --- a/drivers/media/platform/qcom/venus/core.c
> +++ b/drivers/media/platform/qcom/venus/core.c
> @@ -630,6 +630,55 @@ static const struct venus_resources msm8998_res = {
>  	.fwname = "qcom/venus-4.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" },
> +	.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_s6.mbn", };
> +
>  static const struct freq_tbl sdm660_freq_table[] = {
>  	{ 979200, 518400000 },
>  	{ 489600, 441600000 },
> @@ -937,6 +986,7 @@ static const struct of_device_id venus_dt_match[] = {
>  	{ .compatible = "qcom,msm8916-venus", .data = &msm8916_res, },
>  	{ .compatible = "qcom,msm8996-venus", .data = &msm8996_res, },
>  	{ .compatible = "qcom,msm8998-venus", .data = &msm8998_res, },
> +	{ .compatible = "qcom,qcs615-venus", .data = &qcs615_res, },
>  	{ .compatible = "qcom,sdm660-venus", .data = &sdm660_res, },
>  	{ .compatible = "qcom,sdm845-venus", .data = &sdm845_res, },
>  	{ .compatible = "qcom,sdm845-venus-v2", .data = &sdm845_res_v2, },

> --
> 2.34.1
Krzysztof Kozlowski Nov. 25, 2024, 8:56 a.m. UTC | #2
On 25/11/2024 09:44, Renjiang Han (QUIC) wrote:
> On Monday, November 25, 2024 1:35 PM, Renjiang Han wrote:
>> Initialize the platform data and enable venus driver probe of QCS615 SoC.
> 
> Forgot to add Reviewed-by, next version will add Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>

Please start using b4. You cannot add other people's tag this way - via
reply to email.

Best regards,
Krzysztof
Renjiang Han Nov. 25, 2024, 9:06 a.m. UTC | #3
On Monday, November 25, 2024 4:57 PM, Krzysztof Kozlowski wrote:
> On 25/11/2024 09:44, Renjiang Han (QUIC) wrote:
> > On Monday, November 25, 2024 1:35 PM, Renjiang Han wrote:
> > > Initialize the platform data and enable venus driver probe of QCS615 SoC.
> > 
> > Forgot to add Reviewed-by, next version will add Reviewed-by: Bryan 
> > O'Donoghue <bryan.odonoghue@linaro.org>

> Please start using b4. You cannot add other people's tag this way - via reply to email.
Thanks for your comment. Next version will be updated with b4.

> Best regards,
> Krzysztof
Dmitry Baryshkov Nov. 25, 2024, 1:35 p.m. UTC | #4
On Mon, Nov 25, 2024 at 11:04:50AM +0530, Renjiang Han wrote:
> Initialize the platform data and enable venus driver probe of QCS615
> SoC.
> 
> 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 423deb5e94dcb193974da23f9bd2d905bfeab2d9..39d8bcf62fe4f72674746b75994cce6cbaee94eb 100644
> --- a/drivers/media/platform/qcom/venus/core.c
> +++ b/drivers/media/platform/qcom/venus/core.c
> @@ -630,6 +630,55 @@ static const struct venus_resources msm8998_res = {
>  	.fwname = "qcom/venus-4.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" },
> +	.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_s6.mbn",

I really want the firmware discussion of linux-firmware to be solved
first, before we land this patch.

SHort summary: can we use a single image for all 5.4 platforms (by using
v5 signatures, by using v6 signatures, v3 or any other kind of quirk).

> +};
> +
>  static const struct freq_tbl sdm660_freq_table[] = {
>  	{ 979200, 518400000 },
>  	{ 489600, 441600000 },
> @@ -937,6 +986,7 @@ static const struct of_device_id venus_dt_match[] = {
>  	{ .compatible = "qcom,msm8916-venus", .data = &msm8916_res, },
>  	{ .compatible = "qcom,msm8996-venus", .data = &msm8996_res, },
>  	{ .compatible = "qcom,msm8998-venus", .data = &msm8998_res, },
> +	{ .compatible = "qcom,qcs615-venus", .data = &qcs615_res, },

The hardware seems to be the same as sc7180, only the frequencies
differ. Can we change the driver in a way that we don't have to add
another compat entry just for the sake of changing freqs / bandwidths?

>  	{ .compatible = "qcom,sdm660-venus", .data = &sdm660_res, },
>  	{ .compatible = "qcom,sdm845-venus", .data = &sdm845_res, },
>  	{ .compatible = "qcom,sdm845-venus-v2", .data = &sdm845_res_v2, },
> 
> -- 
> 2.34.1
>
Renjiang Han Nov. 25, 2024, 3:34 p.m. UTC | #5
On Monday, November 25, 2024 9:36 PM, Dmitry Baryshkov wrote:
> On Mon, Nov 25, 2024 at 11:04:50AM +0530, Renjiang Han wrote:
> > Initialize the platform data and enable venus driver probe of QCS615 
> > SoC.
> > 
> > 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 
> > 423deb5e94dcb193974da23f9bd2d905bfeab2d9..39d8bcf62fe4f72674746b75994c
> > ce6cbaee94eb 100644
> > --- a/drivers/media/platform/qcom/venus/core.c
> > +++ b/drivers/media/platform/qcom/venus/core.c
> > @@ -630,6 +630,55 @@ static const struct venus_resources msm8998_res = {
> >  	.fwname = "qcom/venus-4.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" },
> > +	.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_s6.mbn",

> I really want the firmware discussion of linux-firmware to be solved first,
> before we land this patch.

> SHort summary: can we use a single image for all 5.4 platforms (by using
> v5 signatures, by using v6 signatures, v3 or any other kind of quirk).
Thanks for your comment. We have discussed with the firmware team and
other teams if we can use the same firmware binary. The result is we'd better
use different firmware files. They should respond in the firmware binary
thread. I will push them and hope them respond as quickly as possible and
give reasons.
> > +};
> > +
> >  static const struct freq_tbl sdm660_freq_table[] = {
> >  	{ 979200, 518400000 },
> >  	{ 489600, 441600000 },
> > @@ -937,6 +986,7 @@ static const struct of_device_id venus_dt_match[] = {
> >  	{ .compatible = "qcom,msm8916-venus", .data = &msm8916_res, },
> >  	{ .compatible = "qcom,msm8996-venus", .data = &msm8996_res, },
> >  	{ .compatible = "qcom,msm8998-venus", .data = &msm8998_res, },
> > +	{ .compatible = "qcom,qcs615-venus", .data = &qcs615_res, },

> The hardware seems to be the same as sc7180, only the frequencies differ.
> Can we change the driver in a way that we don't have to add another
> compat entry just for the sake of changing freqs / bandwidths?

Thank you for your comment. I agree with you. But based on the Venus code
architecture and the distinction between different platforms, I think the
current changes are the simplest.

> >  	{ .compatible = "qcom,sdm660-venus", .data = &sdm660_res, },
> >  	{ .compatible = "qcom,sdm845-venus", .data = &sdm845_res, },
> >  	{ .compatible = "qcom,sdm845-venus-v2", .data = &sdm845_res_v2, },
> > 
> > --
> > 2.34.1
> > 

> -- 
> With best wishes
> Dmitry
Dmitry Baryshkov Nov. 25, 2024, 4:20 p.m. UTC | #6
On Mon, Nov 25, 2024 at 03:34:19PM +0000, Renjiang Han (QUIC) wrote:
> On Monday, November 25, 2024 9:36 PM, Dmitry Baryshkov wrote:
> > On Mon, Nov 25, 2024 at 11:04:50AM +0530, Renjiang Han wrote:
> > > Initialize the platform data and enable venus driver probe of QCS615 
> > > SoC.
> > > 
> > > 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 
> > > 423deb5e94dcb193974da23f9bd2d905bfeab2d9..39d8bcf62fe4f72674746b75994c
> > > ce6cbaee94eb 100644
> > > --- a/drivers/media/platform/qcom/venus/core.c
> > > +++ b/drivers/media/platform/qcom/venus/core.c
> > > @@ -630,6 +630,55 @@ static const struct venus_resources msm8998_res = {
> > >  	.fwname = "qcom/venus-4.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" },
> > > +	.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_s6.mbn",
> 
> > I really want the firmware discussion of linux-firmware to be solved first,
> > before we land this patch.
> 
> > SHort summary: can we use a single image for all 5.4 platforms (by using
> > v5 signatures, by using v6 signatures, v3 or any other kind of quirk).
> Thanks for your comment. We have discussed with the firmware team and
> other teams if we can use the same firmware binary. The result is we'd better
> use different firmware files. They should respond in the firmware binary
> thread. I will push them and hope them respond as quickly as possible and
> give reasons.
> > > +};
> > > +
> > >  static const struct freq_tbl sdm660_freq_table[] = {
> > >  	{ 979200, 518400000 },
> > >  	{ 489600, 441600000 },
> > > @@ -937,6 +986,7 @@ static const struct of_device_id venus_dt_match[] = {
> > >  	{ .compatible = "qcom,msm8916-venus", .data = &msm8916_res, },
> > >  	{ .compatible = "qcom,msm8996-venus", .data = &msm8996_res, },
> > >  	{ .compatible = "qcom,msm8998-venus", .data = &msm8998_res, },
> > > +	{ .compatible = "qcom,qcs615-venus", .data = &qcs615_res, },
> 
> > The hardware seems to be the same as sc7180, only the frequencies differ.
> > Can we change the driver in a way that we don't have to add another
> > compat entry just for the sake of changing freqs / bandwidths?
> 
> Thank you for your comment. I agree with you. But based on the Venus code
> architecturE ANd the distinction between different platforms, I think the
> current changes are the simplest.

Well, it is simplest, correct. But not the best one. There is no plan no
migrate these platforms to the iris driver. So instead, please improve
the venus driver instead of just pushing the simplest change. I should
have been more explicit about it earlier.

> 
> > >  	{ .compatible = "qcom,sdm660-venus", .data = &sdm660_res, },
> > >  	{ .compatible = "qcom,sdm845-venus", .data = &sdm845_res, },
> > >  	{ .compatible = "qcom,sdm845-venus-v2", .data = &sdm845_res_v2, },
> > > 
> > > --
> > > 2.34.1
> > > 
> 
> > -- 
> > With best wishes
> > Dmitry
Renjiang Han Nov. 26, 2024, 7:40 a.m. UTC | #7
On 11/26/2024 12:20 AM, Dmitry Baryshkov wrote:
> On Mon, Nov 25, 2024 at 03:34:19PM +0000, Renjiang Han (QUIC) wrote:
>> On Monday, November 25, 2024 9:36 PM, Dmitry Baryshkov wrote:
>>> On Mon, Nov 25, 2024 at 11:04:50AM +0530, Renjiang Han wrote:
>>>> Initialize the platform data and enable venus driver probe of QCS615
>>>> SoC.
>>>>
>>>> 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
>>>> 423deb5e94dcb193974da23f9bd2d905bfeab2d9..39d8bcf62fe4f72674746b75994c
>>>> ce6cbaee94eb 100644
>>>> --- a/drivers/media/platform/qcom/venus/core.c
>>>> +++ b/drivers/media/platform/qcom/venus/core.c
>>>> @@ -630,6 +630,55 @@ static const struct venus_resources msm8998_res = {
>>>>   	.fwname = "qcom/venus-4.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" },
>>>> +	.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_s6.mbn",
>>> I really want the firmware discussion of linux-firmware to be solved first,
>>> before we land this patch.
>>> SHort summary: can we use a single image for all 5.4 platforms (by using
>>> v5 signatures, by using v6 signatures, v3 or any other kind of quirk).
>> Thanks for your comment. We have discussed with the firmware team and
>> other teams if we can use the same firmware binary. The result is we'd better
>> use different firmware files. They should respond in the firmware binary
>> thread. I will push them and hope them respond as quickly as possible and
>> give reasons.
>>>> +};
>>>> +
>>>>   static const struct freq_tbl sdm660_freq_table[] = {
>>>>   	{ 979200, 518400000 },
>>>>   	{ 489600, 441600000 },
>>>> @@ -937,6 +986,7 @@ static const struct of_device_id venus_dt_match[] = {
>>>>   	{ .compatible = "qcom,msm8916-venus", .data = &msm8916_res, },
>>>>   	{ .compatible = "qcom,msm8996-venus", .data = &msm8996_res, },
>>>>   	{ .compatible = "qcom,msm8998-venus", .data = &msm8998_res, },
>>>> +	{ .compatible = "qcom,qcs615-venus", .data = &qcs615_res, },
>>> The hardware seems to be the same as sc7180, only the frequencies differ.
>>> Can we change the driver in a way that we don't have to add another
>>> compat entry just for the sake of changing freqs / bandwidths?
>> Thank you for your comment. I agree with you. But based on the Venus code
>> architecturE ANd the distinction between different platforms, I think the
>> current changes are the simplest.
> Well, it is simplest, correct. But not the best one. There is no plan no
> migrate these platforms to the iris driver. So instead, please improve
> the venus driver instead of just pushing the simplest change. I should
> have been more explicit about it earlier.

Based on the current code architecture, I don't know if there is a 
better way. If we

refactor the code, it will take a lot of effort.

Therefore, I submit this change. Do you have a better approach?

Also, the driver architecture of iris is implemented as you said.

>>>>   	{ .compatible = "qcom,sdm660-venus", .data = &sdm660_res, },
>>>>   	{ .compatible = "qcom,sdm845-venus", .data = &sdm845_res, },
>>>>   	{ .compatible = "qcom,sdm845-venus-v2", .data = &sdm845_res_v2, },
>>>>
>>>> --
>>>> 2.34.1
>>>>
>>> -- 
>>> With best wishes
>>> Dmitry
Dmitry Baryshkov Nov. 26, 2024, 12:03 p.m. UTC | #8
On Tue, Nov 26, 2024 at 03:40:47PM +0800, Renjiang Han wrote:
> 
> On 11/26/2024 12:20 AM, Dmitry Baryshkov wrote:
> > On Mon, Nov 25, 2024 at 03:34:19PM +0000, Renjiang Han (QUIC) wrote:
> > > On Monday, November 25, 2024 9:36 PM, Dmitry Baryshkov wrote:
> > > > On Mon, Nov 25, 2024 at 11:04:50AM +0530, Renjiang Han wrote:
> > > > > Initialize the platform data and enable venus driver probe of QCS615
> > > > > SoC.
> > > > > 
> > > > > 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
> > > > > 423deb5e94dcb193974da23f9bd2d905bfeab2d9..39d8bcf62fe4f72674746b75994c
> > > > > ce6cbaee94eb 100644
> > > > > --- a/drivers/media/platform/qcom/venus/core.c
> > > > > +++ b/drivers/media/platform/qcom/venus/core.c
> > > > > @@ -630,6 +630,55 @@ static const struct venus_resources msm8998_res = {
> > > > >   	.fwname = "qcom/venus-4.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" },
> > > > > +	.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_s6.mbn",
> > > > I really want the firmware discussion of linux-firmware to be solved first,
> > > > before we land this patch.
> > > > SHort summary: can we use a single image for all 5.4 platforms (by using
> > > > v5 signatures, by using v6 signatures, v3 or any other kind of quirk).
> > > Thanks for your comment. We have discussed with the firmware team and
> > > other teams if we can use the same firmware binary. The result is we'd better
> > > use different firmware files. They should respond in the firmware binary
> > > thread. I will push them and hope them respond as quickly as possible and
> > > give reasons.
> > > > > +};
> > > > > +
> > > > >   static const struct freq_tbl sdm660_freq_table[] = {
> > > > >   	{ 979200, 518400000 },
> > > > >   	{ 489600, 441600000 },
> > > > > @@ -937,6 +986,7 @@ static const struct of_device_id venus_dt_match[] = {
> > > > >   	{ .compatible = "qcom,msm8916-venus", .data = &msm8916_res, },
> > > > >   	{ .compatible = "qcom,msm8996-venus", .data = &msm8996_res, },
> > > > >   	{ .compatible = "qcom,msm8998-venus", .data = &msm8998_res, },
> > > > > +	{ .compatible = "qcom,qcs615-venus", .data = &qcs615_res, },
> > > > The hardware seems to be the same as sc7180, only the frequencies differ.
> > > > Can we change the driver in a way that we don't have to add another
> > > > compat entry just for the sake of changing freqs / bandwidths?
> > > Thank you for your comment. I agree with you. But based on the Venus code
> > > architecturE ANd the distinction between different platforms, I think the
> > > current changes are the simplest.
> > Well, it is simplest, correct. But not the best one. There is no plan no
> > migrate these platforms to the iris driver. So instead, please improve
> > the venus driver instead of just pushing the simplest change. I should
> > have been more explicit about it earlier.
> 
> Based on the current code architecture, I don't know if there is a better
> way. If we
> 
> refactor the code, it will take a lot of effort.

Yes, please. The freq_tbl contents is a duplicate of the OPP table in
DT. Drop it from the driver.

> Therefore, I submit this change. Do you have a better approach?

NAK for this submission. Please spend some time and improve the driver
instead.

> 
> Also, the driver architecture of iris is implemented as you said.

Irrelevant. You are patching venus, not iris.

> > > > >   	{ .compatible = "qcom,sdm660-venus", .data = &sdm660_res, },
> > > > >   	{ .compatible = "qcom,sdm845-venus", .data = &sdm845_res, },
> > > > >   	{ .compatible = "qcom,sdm845-venus-v2", .data = &sdm845_res_v2, },
> > > > > 
> > > > > --
> > > > > 2.34.1
> > > > > 
> > > > -- 
> > > > With best wishes
> > > > Dmitry
> 
> -- 
> Best Regards,
> Renjiang
>
Vikash Garodia Nov. 27, 2024, 8:07 a.m. UTC | #9
On 11/26/2024 5:33 PM, Dmitry Baryshkov wrote:
> On Tue, Nov 26, 2024 at 03:40:47PM +0800, Renjiang Han wrote:
>>
>> On 11/26/2024 12:20 AM, Dmitry Baryshkov wrote:
>>> On Mon, Nov 25, 2024 at 03:34:19PM +0000, Renjiang Han (QUIC) wrote:
>>>> On Monday, November 25, 2024 9:36 PM, Dmitry Baryshkov wrote:
>>>>> On Mon, Nov 25, 2024 at 11:04:50AM +0530, Renjiang Han wrote:
>>>>>> Initialize the platform data and enable venus driver probe of QCS615
>>>>>> SoC.
>>>>>>
>>>>>> 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
>>>>>> 423deb5e94dcb193974da23f9bd2d905bfeab2d9..39d8bcf62fe4f72674746b75994c
>>>>>> ce6cbaee94eb 100644
>>>>>> --- a/drivers/media/platform/qcom/venus/core.c
>>>>>> +++ b/drivers/media/platform/qcom/venus/core.c
>>>>>> @@ -630,6 +630,55 @@ static const struct venus_resources msm8998_res = {
>>>>>>   	.fwname = "qcom/venus-4.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" },
>>>>>> +	.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_s6.mbn",
>>>>> I really want the firmware discussion of linux-firmware to be solved first,
>>>>> before we land this patch.
>>>>> SHort summary: can we use a single image for all 5.4 platforms (by using
>>>>> v5 signatures, by using v6 signatures, v3 or any other kind of quirk).
>>>> Thanks for your comment. We have discussed with the firmware team and
>>>> other teams if we can use the same firmware binary. The result is we'd better
>>>> use different firmware files. They should respond in the firmware binary
>>>> thread. I will push them and hope them respond as quickly as possible and
>>>> give reasons.
>>>>>> +};
>>>>>> +
>>>>>>   static const struct freq_tbl sdm660_freq_table[] = {
>>>>>>   	{ 979200, 518400000 },
>>>>>>   	{ 489600, 441600000 },
>>>>>> @@ -937,6 +986,7 @@ static const struct of_device_id venus_dt_match[] = {
>>>>>>   	{ .compatible = "qcom,msm8916-venus", .data = &msm8916_res, },
>>>>>>   	{ .compatible = "qcom,msm8996-venus", .data = &msm8996_res, },
>>>>>>   	{ .compatible = "qcom,msm8998-venus", .data = &msm8998_res, },
>>>>>> +	{ .compatible = "qcom,qcs615-venus", .data = &qcs615_res, },
>>>>> The hardware seems to be the same as sc7180, only the frequencies differ.
>>>>> Can we change the driver in a way that we don't have to add another
>>>>> compat entry just for the sake of changing freqs / bandwidths?
>>>> Thank you for your comment. I agree with you. But based on the Venus code
>>>> architecturE ANd the distinction between different platforms, I think the
>>>> current changes are the simplest.
>>> Well, it is simplest, correct. But not the best one. There is no plan no
>>> migrate these platforms to the iris driver. So instead, please improve
>>> the venus driver instead of just pushing the simplest change. I should
>>> have been more explicit about it earlier.
>>
>> Based on the current code architecture, I don't know if there is a better
>> way. If we
>>
>> refactor the code, it will take a lot of effort.
> 
> Yes, please. The freq_tbl contents is a duplicate of the OPP table in
> DT. Drop it from the driver.
Agree, we should reuse OPP table in this case to set the required rate.
Renjiang, let us know your findings with using opp table.

Regards,
Vikash
>> Therefore, I submit this change. Do you have a better approach?
> 
> NAK for this submission. Please spend some time and improve the driver
> instead.
> 
>>
>> Also, the driver architecture of iris is implemented as you said.
> 
> Irrelevant. You are patching venus, not iris.
> 
>>>>>>   	{ .compatible = "qcom,sdm660-venus", .data = &sdm660_res, },
>>>>>>   	{ .compatible = "qcom,sdm845-venus", .data = &sdm845_res, },
>>>>>>   	{ .compatible = "qcom,sdm845-venus-v2", .data = &sdm845_res_v2, },
>>>>>>
>>>>>> --
>>>>>> 2.34.1
>>>>>>
>>>>> -- 
>>>>> With best wishes
>>>>> Dmitry
>>
>> -- 
>> Best Regards,
>> Renjiang
>>
>
diff mbox series

Patch

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 423deb5e94dcb193974da23f9bd2d905bfeab2d9..39d8bcf62fe4f72674746b75994cce6cbaee94eb 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -630,6 +630,55 @@  static const struct venus_resources msm8998_res = {
 	.fwname = "qcom/venus-4.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" },
+	.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_s6.mbn",
+};
+
 static const struct freq_tbl sdm660_freq_table[] = {
 	{ 979200, 518400000 },
 	{ 489600, 441600000 },
@@ -937,6 +986,7 @@  static const struct of_device_id venus_dt_match[] = {
 	{ .compatible = "qcom,msm8916-venus", .data = &msm8916_res, },
 	{ .compatible = "qcom,msm8996-venus", .data = &msm8996_res, },
 	{ .compatible = "qcom,msm8998-venus", .data = &msm8998_res, },
+	{ .compatible = "qcom,qcs615-venus", .data = &qcs615_res, },
 	{ .compatible = "qcom,sdm660-venus", .data = &sdm660_res, },
 	{ .compatible = "qcom,sdm845-venus", .data = &sdm845_res, },
 	{ .compatible = "qcom,sdm845-venus-v2", .data = &sdm845_res_v2, },