diff mbox series

[v6,16/16] rockchip/vpu: Add support for MPEG-2 decoding on RK3328

Message ID 20190528170232.2091-17-ezequiel@collabora.com (mailing list archive)
State New, archived
Headers show
Series Add MPEG-2 decoding to Rockchip VPU | expand

Commit Message

Ezequiel Garcia May 28, 2019, 5:02 p.m. UTC
From: Jonas Karlman <jonas@kwiboo.se>

Add necessary bits to support MPEG2 decoding on RK3328.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
--
Changes from v5:
* New patch.

 drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c   | 12 ++++++++++++
 .../staging/media/rockchip/vpu/rockchip_vpu_drv.c    |  1 +
 drivers/staging/media/rockchip/vpu/rockchip_vpu_hw.h |  1 +
 3 files changed, 14 insertions(+)

Comments

Hans Verkuil May 29, 2019, 8:11 a.m. UTC | #1
On 5/28/19 7:02 PM, Ezequiel Garcia wrote:
> From: Jonas Karlman <jonas@kwiboo.se>
> 
> Add necessary bits to support MPEG2 decoding on RK3328.
> 
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
> --
> Changes from v5:
> * New patch.
> 
>  drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c   | 12 ++++++++++++
>  .../staging/media/rockchip/vpu/rockchip_vpu_drv.c    |  1 +
>  drivers/staging/media/rockchip/vpu/rockchip_vpu_hw.h |  1 +
>  3 files changed, 14 insertions(+)
> 
> diff --git a/drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c b/drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c
> index 2b3689968ef4..341f8d69c33d 100644
> --- a/drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c
> +++ b/drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c
> @@ -175,3 +175,15 @@ const struct rockchip_vpu_variant rk3399_vpu_variant = {
>  	.clk_names = {"aclk", "hclk"},
>  	.num_clocks = 2
>  };
> +
> +const struct rockchip_vpu_variant rk3328_vpu_variant = {
> +	.dec_offset = 0x400,
> +	.dec_fmts = rk3399_vpu_dec_fmts,
> +	.num_dec_fmts = ARRAY_SIZE(rk3399_vpu_dec_fmts),
> +	.codec = RK_VPU_MPEG2_DECODER,
> +	.codec_ops = rk3399_vpu_codec_ops,
> +	.vdpu_irq = rk3399_vdpu_irq,
> +	.init = rk3399_vpu_hw_init,
> +	.clk_names = {"aclk", "hclk"},
> +	.num_clocks = 2
> +};
> diff --git a/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c b/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c
> index b94ff97451db..2e22009b6583 100644
> --- a/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c
> +++ b/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c
> @@ -419,6 +419,7 @@ static const struct v4l2_file_operations rockchip_vpu_fops = {
>  
>  static const struct of_device_id of_rockchip_vpu_match[] = {
>  	{ .compatible = "rockchip,rk3399-vpu", .data = &rk3399_vpu_variant, },
> +	{ .compatible = "rockchip,rk3328-vpu", .data = &rk3328_vpu_variant, },

This new compatible string should be documented in
Documentation/devicetree/bindings/media/rockchip-vpu.txt as well.

I'll take patches 1-15 and drop this one. This patch can be merged once
the bindings file is updated as well.

Regards,

	Hans

>  	{ .compatible = "rockchip,rk3288-vpu", .data = &rk3288_vpu_variant, },
>  	{ /* sentinel */ }
>  };
> diff --git a/drivers/staging/media/rockchip/vpu/rockchip_vpu_hw.h b/drivers/staging/media/rockchip/vpu/rockchip_vpu_hw.h
> index 6cecb528f994..3d6b97af90fb 100644
> --- a/drivers/staging/media/rockchip/vpu/rockchip_vpu_hw.h
> +++ b/drivers/staging/media/rockchip/vpu/rockchip_vpu_hw.h
> @@ -79,6 +79,7 @@ enum rockchip_vpu_enc_fmt {
>  };
>  
>  extern const struct rockchip_vpu_variant rk3399_vpu_variant;
> +extern const struct rockchip_vpu_variant rk3328_vpu_variant;
>  extern const struct rockchip_vpu_variant rk3288_vpu_variant;
>  
>  void rockchip_vpu_watchdog(struct work_struct *work);
>
Jonas Karlman May 29, 2019, 8:50 a.m. UTC | #2
On 2019-05-29 10:11, Hans Verkuil wrote:
> On 5/28/19 7:02 PM, Ezequiel Garcia wrote:
>> From: Jonas Karlman <jonas@kwiboo.se>
>>
>> Add necessary bits to support MPEG2 decoding on RK3328.
>>
>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
>> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
>> --
>> Changes from v5:
>> * New patch.
>>
>>  drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c   | 12 ++++++++++++
>>  .../staging/media/rockchip/vpu/rockchip_vpu_drv.c    |  1 +
>>  drivers/staging/media/rockchip/vpu/rockchip_vpu_hw.h |  1 +
>>  3 files changed, 14 insertions(+)
>>
>> diff --git a/drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c b/drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c
>> index 2b3689968ef4..341f8d69c33d 100644
>> --- a/drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c
>> +++ b/drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c
>> @@ -175,3 +175,15 @@ const struct rockchip_vpu_variant rk3399_vpu_variant = {
>>  	.clk_names = {"aclk", "hclk"},
>>  	.num_clocks = 2
>>  };
>> +
>> +const struct rockchip_vpu_variant rk3328_vpu_variant = {
>> +	.dec_offset = 0x400,
>> +	.dec_fmts = rk3399_vpu_dec_fmts,
>> +	.num_dec_fmts = ARRAY_SIZE(rk3399_vpu_dec_fmts),
>> +	.codec = RK_VPU_MPEG2_DECODER,
>> +	.codec_ops = rk3399_vpu_codec_ops,
>> +	.vdpu_irq = rk3399_vdpu_irq,
>> +	.init = rk3399_vpu_hw_init,
>> +	.clk_names = {"aclk", "hclk"},
>> +	.num_clocks = 2
>> +};
>> diff --git a/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c b/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c
>> index b94ff97451db..2e22009b6583 100644
>> --- a/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c
>> +++ b/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c
>> @@ -419,6 +419,7 @@ static const struct v4l2_file_operations rockchip_vpu_fops = {
>>  
>>  static const struct of_device_id of_rockchip_vpu_match[] = {
>>  	{ .compatible = "rockchip,rk3399-vpu", .data = &rk3399_vpu_variant, },
>> +	{ .compatible = "rockchip,rk3328-vpu", .data = &rk3328_vpu_variant, },
> This new compatible string should be documented in
> Documentation/devicetree/bindings/media/rockchip-vpu.txt as well.
>
> I'll take patches 1-15 and drop this one. This patch can be merged once
> the bindings file is updated as well.

Looks like the bindings patch did not get picked for v6 :-)

I am a bit unclear on how to handle patch submission that covers multiple subtrees.
Should I send a single series including three patches: bindings update, this patch and device tree update?
Or is a series with only bindings update and this patch preferred?

Regards,
Jonas

>
> Regards,
>
> 	Hans
>
>>  	{ .compatible = "rockchip,rk3288-vpu", .data = &rk3288_vpu_variant, },
>>  	{ /* sentinel */ }
>>  };
>> diff --git a/drivers/staging/media/rockchip/vpu/rockchip_vpu_hw.h b/drivers/staging/media/rockchip/vpu/rockchip_vpu_hw.h
>> index 6cecb528f994..3d6b97af90fb 100644
>> --- a/drivers/staging/media/rockchip/vpu/rockchip_vpu_hw.h
>> +++ b/drivers/staging/media/rockchip/vpu/rockchip_vpu_hw.h
>> @@ -79,6 +79,7 @@ enum rockchip_vpu_enc_fmt {
>>  };
>>  
>>  extern const struct rockchip_vpu_variant rk3399_vpu_variant;
>> +extern const struct rockchip_vpu_variant rk3328_vpu_variant;
>>  extern const struct rockchip_vpu_variant rk3288_vpu_variant;
>>  
>>  void rockchip_vpu_watchdog(struct work_struct *work);
>>
Hans Verkuil May 29, 2019, 9 a.m. UTC | #3
On 5/29/19 10:50 AM, Jonas Karlman wrote:
> On 2019-05-29 10:11, Hans Verkuil wrote:
>> On 5/28/19 7:02 PM, Ezequiel Garcia wrote:
>>> From: Jonas Karlman <jonas@kwiboo.se>
>>>
>>> Add necessary bits to support MPEG2 decoding on RK3328.
>>>
>>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
>>> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
>>> --
>>> Changes from v5:
>>> * New patch.
>>>
>>>  drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c   | 12 ++++++++++++
>>>  .../staging/media/rockchip/vpu/rockchip_vpu_drv.c    |  1 +
>>>  drivers/staging/media/rockchip/vpu/rockchip_vpu_hw.h |  1 +
>>>  3 files changed, 14 insertions(+)
>>>
>>> diff --git a/drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c b/drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c
>>> index 2b3689968ef4..341f8d69c33d 100644
>>> --- a/drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c
>>> +++ b/drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c
>>> @@ -175,3 +175,15 @@ const struct rockchip_vpu_variant rk3399_vpu_variant = {
>>>  	.clk_names = {"aclk", "hclk"},
>>>  	.num_clocks = 2
>>>  };
>>> +
>>> +const struct rockchip_vpu_variant rk3328_vpu_variant = {
>>> +	.dec_offset = 0x400,
>>> +	.dec_fmts = rk3399_vpu_dec_fmts,
>>> +	.num_dec_fmts = ARRAY_SIZE(rk3399_vpu_dec_fmts),
>>> +	.codec = RK_VPU_MPEG2_DECODER,
>>> +	.codec_ops = rk3399_vpu_codec_ops,
>>> +	.vdpu_irq = rk3399_vdpu_irq,
>>> +	.init = rk3399_vpu_hw_init,
>>> +	.clk_names = {"aclk", "hclk"},
>>> +	.num_clocks = 2
>>> +};
>>> diff --git a/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c b/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c
>>> index b94ff97451db..2e22009b6583 100644
>>> --- a/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c
>>> +++ b/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c
>>> @@ -419,6 +419,7 @@ static const struct v4l2_file_operations rockchip_vpu_fops = {
>>>  
>>>  static const struct of_device_id of_rockchip_vpu_match[] = {
>>>  	{ .compatible = "rockchip,rk3399-vpu", .data = &rk3399_vpu_variant, },
>>> +	{ .compatible = "rockchip,rk3328-vpu", .data = &rk3328_vpu_variant, },
>> This new compatible string should be documented in
>> Documentation/devicetree/bindings/media/rockchip-vpu.txt as well.
>>
>> I'll take patches 1-15 and drop this one. This patch can be merged once
>> the bindings file is updated as well.
> 
> Looks like the bindings patch did not get picked for v6 :-)
> 
> I am a bit unclear on how to handle patch submission that covers multiple subtrees.
> Should I send a single series including three patches: bindings update, this patch and device tree update?
> Or is a series with only bindings update and this patch preferred?

In this case just post a patch updating rockchip-vpu.txt, CC-ing devicetree@vger.kernel.org and
Rob Herring <robh+dt@kernel.org>.

Rob will Ack it, and then I can make a pull request for that bindings patch and this
16/16 patch. There is nothing wrong with this patch, so no need to repost. I just
need to have an updated rockchip-vpu.txt patch as well.

Regards,

	Hans

> 
> Regards,
> Jonas
> 
>>
>> Regards,
>>
>> 	Hans
>>
>>>  	{ .compatible = "rockchip,rk3288-vpu", .data = &rk3288_vpu_variant, },
>>>  	{ /* sentinel */ }
>>>  };
>>> diff --git a/drivers/staging/media/rockchip/vpu/rockchip_vpu_hw.h b/drivers/staging/media/rockchip/vpu/rockchip_vpu_hw.h
>>> index 6cecb528f994..3d6b97af90fb 100644
>>> --- a/drivers/staging/media/rockchip/vpu/rockchip_vpu_hw.h
>>> +++ b/drivers/staging/media/rockchip/vpu/rockchip_vpu_hw.h
>>> @@ -79,6 +79,7 @@ enum rockchip_vpu_enc_fmt {
>>>  };
>>>  
>>>  extern const struct rockchip_vpu_variant rk3399_vpu_variant;
>>> +extern const struct rockchip_vpu_variant rk3328_vpu_variant;
>>>  extern const struct rockchip_vpu_variant rk3288_vpu_variant;
>>>  
>>>  void rockchip_vpu_watchdog(struct work_struct *work);
>>>
>
Ezequiel Garcia May 29, 2019, 2:59 p.m. UTC | #4
On Wed, 2019-05-29 at 08:50 +0000, Jonas Karlman wrote:
> On 2019-05-29 10:11, Hans Verkuil wrote:
> > On 5/28/19 7:02 PM, Ezequiel Garcia wrote:
> > > From: Jonas Karlman <jonas@kwiboo.se>
> > > 
> > > Add necessary bits to support MPEG2 decoding on RK3328.
> > > 
> > > Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> > > Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
> > > --
> > > Changes from v5:
> > > * New patch.
> > > 
> > >  drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c   | 12 ++++++++++++
> > >  .../staging/media/rockchip/vpu/rockchip_vpu_drv.c    |  1 +
> > >  drivers/staging/media/rockchip/vpu/rockchip_vpu_hw.h |  1 +
> > >  3 files changed, 14 insertions(+)
> > > 
> > > diff --git a/drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c b/drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c
> > > index 2b3689968ef4..341f8d69c33d 100644
> > > --- a/drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c
> > > +++ b/drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c
> > > @@ -175,3 +175,15 @@ const struct rockchip_vpu_variant rk3399_vpu_variant = {
> > >  	.clk_names = {"aclk", "hclk"},
> > >  	.num_clocks = 2
> > >  };
> > > +
> > > +const struct rockchip_vpu_variant rk3328_vpu_variant = {
> > > +	.dec_offset = 0x400,
> > > +	.dec_fmts = rk3399_vpu_dec_fmts,
> > > +	.num_dec_fmts = ARRAY_SIZE(rk3399_vpu_dec_fmts),
> > > +	.codec = RK_VPU_MPEG2_DECODER,
> > > +	.codec_ops = rk3399_vpu_codec_ops,
> > > +	.vdpu_irq = rk3399_vdpu_irq,
> > > +	.init = rk3399_vpu_hw_init,
> > > +	.clk_names = {"aclk", "hclk"},
> > > +	.num_clocks = 2
> > > +};
> > > diff --git a/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c b/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c
> > > index b94ff97451db..2e22009b6583 100644
> > > --- a/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c
> > > +++ b/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c
> > > @@ -419,6 +419,7 @@ static const struct v4l2_file_operations rockchip_vpu_fops = {
> > >  
> > >  static const struct of_device_id of_rockchip_vpu_match[] = {
> > >  	{ .compatible = "rockchip,rk3399-vpu", .data = &rk3399_vpu_variant, },
> > > +	{ .compatible = "rockchip,rk3328-vpu", .data = &rk3328_vpu_variant, },
> > This new compatible string should be documented in
> > Documentation/devicetree/bindings/media/rockchip-vpu.txt as well.
> > 
> > I'll take patches 1-15 and drop this one. This patch can be merged once
> > the bindings file is updated as well.
> 
> Looks like the bindings patch did not get picked for v6 :-)
> 

Oh, that's my bad. I picked the support and left the binding out.

> I am a bit unclear on how to handle patch submission that covers multiple subtrees.
> Should I send a single series including three patches: bindings update, this patch and device tree update?
> Or is a series with only bindings update and this patch preferred?
> 

Thanks both for sorting this one out,
Ezequiel
diff mbox series

Patch

diff --git a/drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c b/drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c
index 2b3689968ef4..341f8d69c33d 100644
--- a/drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c
+++ b/drivers/staging/media/rockchip/vpu/rk3399_vpu_hw.c
@@ -175,3 +175,15 @@  const struct rockchip_vpu_variant rk3399_vpu_variant = {
 	.clk_names = {"aclk", "hclk"},
 	.num_clocks = 2
 };
+
+const struct rockchip_vpu_variant rk3328_vpu_variant = {
+	.dec_offset = 0x400,
+	.dec_fmts = rk3399_vpu_dec_fmts,
+	.num_dec_fmts = ARRAY_SIZE(rk3399_vpu_dec_fmts),
+	.codec = RK_VPU_MPEG2_DECODER,
+	.codec_ops = rk3399_vpu_codec_ops,
+	.vdpu_irq = rk3399_vdpu_irq,
+	.init = rk3399_vpu_hw_init,
+	.clk_names = {"aclk", "hclk"},
+	.num_clocks = 2
+};
diff --git a/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c b/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c
index b94ff97451db..2e22009b6583 100644
--- a/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c
+++ b/drivers/staging/media/rockchip/vpu/rockchip_vpu_drv.c
@@ -419,6 +419,7 @@  static const struct v4l2_file_operations rockchip_vpu_fops = {
 
 static const struct of_device_id of_rockchip_vpu_match[] = {
 	{ .compatible = "rockchip,rk3399-vpu", .data = &rk3399_vpu_variant, },
+	{ .compatible = "rockchip,rk3328-vpu", .data = &rk3328_vpu_variant, },
 	{ .compatible = "rockchip,rk3288-vpu", .data = &rk3288_vpu_variant, },
 	{ /* sentinel */ }
 };
diff --git a/drivers/staging/media/rockchip/vpu/rockchip_vpu_hw.h b/drivers/staging/media/rockchip/vpu/rockchip_vpu_hw.h
index 6cecb528f994..3d6b97af90fb 100644
--- a/drivers/staging/media/rockchip/vpu/rockchip_vpu_hw.h
+++ b/drivers/staging/media/rockchip/vpu/rockchip_vpu_hw.h
@@ -79,6 +79,7 @@  enum rockchip_vpu_enc_fmt {
 };
 
 extern const struct rockchip_vpu_variant rk3399_vpu_variant;
+extern const struct rockchip_vpu_variant rk3328_vpu_variant;
 extern const struct rockchip_vpu_variant rk3288_vpu_variant;
 
 void rockchip_vpu_watchdog(struct work_struct *work);