mbox series

[V4,0/5] Support jpeg encoder for MT8195

Message ID 1632469543-27345-1-git-send-email-kyrie.wu@mediatek.com (mailing list archive)
Headers show
Series Support jpeg encoder for MT8195 | expand

Message

Kyrie Wu (吴晗) Sept. 24, 2021, 7:45 a.m. UTC
MT8195 has two jpeg encoding HW, each one has its own
power-domain, clock, interrupt, register base.
The two jpeg encoding HW can work together to
achieve higher performance.

Generally, one HW needs to register one device node,
and the APP operates the HW through the device node.
If there are multiple HWs, the multiple device node
needs to be registered. At this time, the app needs
to design software logic to use multiple HWs in parallel,
which will undoubtedly increase the difficulty of
app development and weaken its compatibility.

These serial patches use the component framework
to achieve the purpose of using multiple HWs
through only one device node. About the component
framework Block Diagram, please check below:

		Master(device node)
	________|_________________________
	|	               |             |
component0(HW0)	component1(HW1) component2(HW2) ......

As above, the component framework is similar to a
master-component two level architecture.
Both master and component have the compatible
attribute in the device tree, and the corresponding
platform driver structure is defined in the driver.
Therefore, when the compatible attribute matches,
the corresponding probe function will be called.

In the probe function of component, operations
such as initialization clock, remmap register base,
registration interrupt will be performed.
And add the component to a component linked
list to find the corresponding master.

In the probe function of the master, the device
node will be registered, and the master will be
added to a master linked list to find the
corresponding component.

After the master matches the component,
it will obtain the clock, interrupt, register base
and other resources in the component,
and operate the HW through these resources.
At the same time, multiple HWs software function
interfaces are designed in the master driver.

kyrie.wu (5):
  dt-bindings: mediatek: Add mediatek, mt8195-jpgenc compatible
  media: mtk-jpegenc: Use component framework to manage each hardware
  media: mtk-jpegenc: add jpegenc timeout func interface
  media: mtk-jpegenc: add jpeg encode worker interface
  media: mtk-jpegenc: add output pic reorder interface

 .../bindings/media/mediatek-jpeg-encoder.yaml      |   3 +
 drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c    | 395 ++++++++++++++++++---
 drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h    |  79 +++++
 drivers/media/platform/mtk-jpeg/mtk_jpeg_enc_hw.c  | 298 ++++++++++++++++
 4 files changed, 730 insertions(+), 45 deletions(-)

--
2.6.4

Comments

Chen-Yu Tsai Sept. 24, 2021, 7:55 a.m. UTC | #1
On Fri, Sep 24, 2021 at 3:46 PM kyrie.wu <kyrie.wu@mediatek.com> wrote:
>
> MT8195 has two jpeg encoding HW, each one has its own
> power-domain, clock, interrupt, register base.
> The two jpeg encoding HW can work together to
> achieve higher performance.
>
> Generally, one HW needs to register one device node,
> and the APP operates the HW through the device node.
> If there are multiple HWs, the multiple device node
> needs to be registered. At this time, the app needs
> to design software logic to use multiple HWs in parallel,
> which will undoubtedly increase the difficulty of
> app development and weaken its compatibility.
>
> These serial patches use the component framework
> to achieve the purpose of using multiple HWs
> through only one device node. About the component
> framework Block Diagram, please check below:
>
>                 Master(device node)
>         ________|_________________________
>         |                      |             |
> component0(HW0) component1(HW1) component2(HW2) ......
>
> As above, the component framework is similar to a
> master-component two level architecture.
> Both master and component have the compatible
> attribute in the device tree, and the corresponding
> platform driver structure is defined in the driver.
> Therefore, when the compatible attribute matches,
> the corresponding probe function will be called.
>
> In the probe function of component, operations
> such as initialization clock, remmap register base,
> registration interrupt will be performed.
> And add the component to a component linked
> list to find the corresponding master.
>
> In the probe function of the master, the device
> node will be registered, and the master will be
> added to a master linked list to find the
> corresponding component.
>
> After the master matches the component,
> it will obtain the clock, interrupt, register base
> and other resources in the component,
> and operate the HW through these resources.
> At the same time, multiple HWs software function
> interfaces are designed in the master driver.


Please include a changelog with your cover letter (or in each patch).
This is the fourth version of the series, and it's unclear what has
changed between the versions.


ChenYu

> kyrie.wu (5):
>   dt-bindings: mediatek: Add mediatek, mt8195-jpgenc compatible
>   media: mtk-jpegenc: Use component framework to manage each hardware
>   media: mtk-jpegenc: add jpegenc timeout func interface
>   media: mtk-jpegenc: add jpeg encode worker interface
>   media: mtk-jpegenc: add output pic reorder interface
>
>  .../bindings/media/mediatek-jpeg-encoder.yaml      |   3 +
>  drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c    | 395 ++++++++++++++++++---
>  drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h    |  79 +++++
>  drivers/media/platform/mtk-jpeg/mtk_jpeg_enc_hw.c  | 298 ++++++++++++++++
>  4 files changed, 730 insertions(+), 45 deletions(-)
>
> --
> 2.6.4
>
>
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek