All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 00/10] Add MPEG-2 decoding to Rockchip VPU
@ 2019-02-05 20:24 ` Ezequiel Garcia
  0 siblings, 0 replies; 34+ messages in thread
From: Ezequiel Garcia @ 2019-02-05 20:24 UTC (permalink / raw)
  To: linux-media
  Cc: Hans Verkuil, kernel, Nicolas Dufresne, Tomasz Figa,
	linux-rockchip, Heiko Stuebner, Jonas Karlman, Ezequiel Garcia

This series introduces the decoding infrastructure that will be
used to add support for other codecs such as VP8, VP9 and H.264.

There are a number of v4l2-compliance issues, which I
will be addressing shortly. For those wanting to take
a peep, I've pasted the v4l2-compliance issues here: http://ix.io/1AfJ.

Minor issues aside, "release early" they say, so here it is!

About the JPEG bounce buffer, we can probably get rid of it,
but for now, it's fine to keep it as it won't affect video decoding.

About the media controller topology change, which is no doubt
the nastiest change in this series, it's important to mention
that we need multiple video interface nodes: one video node
for encoding, and one video node for decoding.

Since the VPU is a single engine, it needs a single mem2mem device
to serialize the codec jobs thru it, taking advantage of the
whole mem2mem infrastructure.

This works perfectly well, but requires a somewhat involved topology.
For the encoder the graph goes like this:

┌────────────────────────────────┐
│ rockchip,rk3399-vpu-enc-source │
│          /dev/video0           │
└────────────────────────────────┘
  ┃
  ┃
  ▼
┌────────────────────────────────┐
│  rockchip,rk3399-vpu-enc-proc  │
└────────────────────────────────┘
  ┃
  ┃
  ▼
┌────────────────────────────────┐
│  rockchip,rk3399-vpu-enc-sink  │
│          /dev/video0           │
└────────────────────────────────┘

For the decoder the graph goes like this:

┌────────────────────────────────┐
│ rockchip,rk3399-vpu-dec-source │
│          /dev/video1           │
└────────────────────────────────┘
  ┃
  ┃
  ▼
┌────────────────────────────────┐
│  rockchip,rk3399-vpu-dec-proc  │
└────────────────────────────────┘
  ┃
  ┃
  ▼
┌────────────────────────────────┐
│  rockchip,rk3399-vpu-dec-sink  │
│          /dev/video1           │
└────────────────────────────────┘

Both are tied to the same media device,
i.e. /dev/media0. Does this comply with the media
controller specification?

The pixel format helpers deserve a discussion of its own.
Note that these helpers will be useful for probably
most V4L drivers. See for instance, this recent bug
caused by bad math in vivid's sizeimage calculations:

https://patchwork.kernel.org/patch/10796201/

Finally, I have to thank Jonas Karlman, who did the initial
MPEG-2 decoding work and also for getting mpv+ffmpeg to
work using the Request API.

This driver can be tested using mpv+ffmpeg for the video
decoding side, and the Panfrost mesa driver for rendering.

I should be posting instructions to set all of this up,
and also will be submitting the support for H264, VP8 and VP9,
hopefully very soon.

Ezequiel Garcia (9):
  media: Introduce helpers to fill pixel format structs
  rockchip/vpu: Use pixel format helpers
  rockchip/vpu: Use v4l2_m2m_buf_copy_data
  rockchip/vpu: Cleanup macroblock alignment
  rockchip/vpu: Cleanup JPEG bounce buffer management
  rockchip/vpu: Open-code media controller register
  rockchip/vpu: Support the Request API
  rockchip/vpu: Add decoder boilerplate
  rockchip/vpu: Add support for non-standard controls

Jonas Karlman (1):
  rockchip/vpu: Add support for MPEG-2 decoding

 drivers/media/v4l2-core/Makefile              |   2 +-
 drivers/media/v4l2-core/v4l2-common.c         |  71 +++
 drivers/media/v4l2-core/v4l2-fourcc.c         | 109 ++++
 drivers/staging/media/rockchip/vpu/Makefile   |   5 +-
 .../media/rockchip/vpu/rk3288_vpu_hw.c        |   4 +-
 .../rockchip/vpu/rk3288_vpu_hw_jpeg_enc.c     |   4 +-
 .../media/rockchip/vpu/rk3399_vpu_hw.c        |  61 +-
 .../rockchip/vpu/rk3399_vpu_hw_jpeg_enc.c     |  10 +-
 .../rockchip/vpu/rk3399_vpu_hw_mpeg2_dec.c    | 263 +++++++++
 .../staging/media/rockchip/vpu/rockchip_vpu.h | 115 +++-
 .../media/rockchip/vpu/rockchip_vpu_common.h  |  10 +
 .../media/rockchip/vpu/rockchip_vpu_dec.c     | 557 ++++++++++++++++++
 .../media/rockchip/vpu/rockchip_vpu_drv.c     | 426 ++++++++++++--
 .../media/rockchip/vpu/rockchip_vpu_enc.c     | 152 ++---
 .../media/rockchip/vpu/rockchip_vpu_hw.h      |  42 ++
 .../media/rockchip/vpu/rockchip_vpu_jpeg.c    |  25 +
 .../media/rockchip/vpu/rockchip_vpu_mpeg2.c   |  61 ++
 include/media/v4l2-common.h                   |   5 +
 include/media/v4l2-fourcc.h                   |  53 ++
 19 files changed, 1803 insertions(+), 172 deletions(-)
 create mode 100644 drivers/media/v4l2-core/v4l2-fourcc.c
 create mode 100644 drivers/staging/media/rockchip/vpu/rk3399_vpu_hw_mpeg2_dec.c
 create mode 100644 drivers/staging/media/rockchip/vpu/rockchip_vpu_dec.c
 create mode 100644 drivers/staging/media/rockchip/vpu/rockchip_vpu_mpeg2.c
 create mode 100644 include/media/v4l2-fourcc.h

-- 
2.20.1


^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2019-02-21 19:26 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-05 20:24 [PATCH v1 00/10] Add MPEG-2 decoding to Rockchip VPU Ezequiel Garcia
2019-02-05 20:24 ` Ezequiel Garcia
2019-02-05 20:24 ` [PATCH 01/10] media: Introduce helpers to fill pixel format structs Ezequiel Garcia
2019-02-05 20:24   ` Ezequiel Garcia
2019-02-06 10:43   ` Hans Verkuil
2019-02-06 10:43     ` Hans Verkuil
2019-02-06 16:22     ` Ezequiel Garcia
2019-02-06 16:22       ` Ezequiel Garcia
2019-02-06 16:36       ` Hans Verkuil
2019-02-06 16:36         ` Hans Verkuil
2019-02-20  6:53         ` Tomasz Figa
2019-02-20  6:53           ` Tomasz Figa
2019-02-20  8:39           ` Hans Verkuil
2019-02-20  8:39             ` Hans Verkuil
2019-02-21 19:26             ` Ezequiel Garcia
2019-02-21 19:26               ` Ezequiel Garcia
2019-02-05 20:24 ` [PATCH 02/10] rockchip/vpu: Use pixel format helpers Ezequiel Garcia
2019-02-05 20:24   ` Ezequiel Garcia
2019-02-05 20:24 ` [PATCH 03/10] rockchip/vpu: Use v4l2_m2m_buf_copy_data Ezequiel Garcia
2019-02-05 20:24   ` Ezequiel Garcia
2019-02-05 20:24 ` [PATCH 04/10] rockchip/vpu: Cleanup macroblock alignment Ezequiel Garcia
2019-02-05 20:24   ` Ezequiel Garcia
2019-02-05 20:24 ` [PATCH 05/10] rockchip/vpu: Cleanup JPEG bounce buffer management Ezequiel Garcia
2019-02-05 20:24   ` Ezequiel Garcia
2019-02-05 20:24 ` [PATCH 06/10] rockchip/vpu: Open-code media controller register Ezequiel Garcia
2019-02-05 20:24   ` Ezequiel Garcia
2019-02-05 20:24 ` [PATCH 07/10] rockchip/vpu: Support the Request API Ezequiel Garcia
2019-02-05 20:24   ` Ezequiel Garcia
2019-02-05 20:24 ` [PATCH 08/10] rockchip/vpu: Add decoder boilerplate Ezequiel Garcia
2019-02-05 20:24   ` Ezequiel Garcia
2019-02-05 20:24 ` [PATCH 09/10] rockchip/vpu: Add support for non-standard controls Ezequiel Garcia
2019-02-05 20:24   ` Ezequiel Garcia
2019-02-05 20:24 ` [PATCH 10/10] rockchip/vpu: Add support for MPEG-2 decoding Ezequiel Garcia
2019-02-05 20:24   ` Ezequiel Garcia

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.