All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@collabora.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Sakari Ailus <sakari.ailus@iki.fi>,
	linux-media@vger.kernel.org, Tomasz Figa <tfiga@chromium.org>,
	Nicolas Dufresne <nicolas@ndufresne.ca>,
	kernel@collabora.com,
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	Ezequiel Garcia <ezequiel@collabora.com>,
	Jonas Karlman <jonas@kwiboo.se>,
	linux-rockchip@lists.infradead.org,
	Heiko Stuebner <heiko@sntech.de>
Subject: Re: [PATCH v4 00/21] Add MPEG-2 decoding to Rockchip VPU
Date: Thu, 25 Apr 2019 11:36:39 +0200	[thread overview]
Message-ID: <20190425113639.3294b6d9@collabora.com> (raw)
In-Reply-To: <69d53367-f26a-a3cb-0221-7d9be02ade6e@xs4all.nl>

On Thu, 25 Apr 2019 10:21:16 +0200
Hans Verkuil <hverkuil@xs4all.nl> wrote:

> On 4/25/19 10:06 AM, Boris Brezillon wrote:
> > On Thu, 25 Apr 2019 09:12:21 +0200
> > Boris Brezillon <boris.brezillon@collabora.com> wrote:
> >   
> >> This series introduces the decoding infrastructure that will be
> >> used to add support for other codecs such as VP8, VP9 and H.264.
> >>
> >> As explained in the cover letter for the v1 patchset,
> >> the driver is now exposing two video device nodes.
> >> The VPU encoder is exposed on /dev/video0, and the VPU decoder
> >> is exposed on /dev/video1. Both devices are tied to the same
> >> memory-to-memory queue, and same media device /dev/media0.
> >>
> >> Therefore there are two media graphs:
> >>
> >> ┌────────────────────────────────┐
> >> │ rockchip,rk3399-vpu-enc-source │
> >> │          /dev/video0           │
> >> └────────────────────────────────┘
> >>   ┃
> >>   ┃
> >>   ▼
> >> ┌────────────────────────────────┐
> >> │  rockchip,rk3399-vpu-enc-proc  │
> >> └────────────────────────────────┘
> >>   ┃
> >>   ┃
> >>   ▼
> >> ┌────────────────────────────────┐
> >> │  rockchip,rk3399-vpu-enc-sink  │
> >> │          /dev/video0           │
> >> └────────────────────────────────┘
> >>
> >> ┌────────────────────────────────┐
> >> │ rockchip,rk3399-vpu-dec-source │
> >> │          /dev/video1           │
> >> └────────────────────────────────┘
> >>   ┃
> >>   ┃
> >>   ▼
> >> ┌────────────────────────────────┐
> >> │  rockchip,rk3399-vpu-dec-proc  │
> >> └────────────────────────────────┘
> >>   ┃
> >>   ┃
> >>   ▼
> >> ┌────────────────────────────────┐
> >> │  rockchip,rk3399-vpu-dec-sink  │
> >> │          /dev/video1           │
> >> └────────────────────────────────┘
> >>
> >> Of course, this work has been possible thanks to Jonas Karlman, who did
> >> the initial MPEG-2 decoding work and also got mpv+ffmpeg working using
> >> the Request API.  
> > 
> > Forgot to provide the v4l2-compliance results, so here it is:
> > 
> > "
> > v4l2-compliance SHA: 95f39aae48c6e8e5cc81e6ae6293d999f70a909b, 64 bits
> > 
> > Compliance test for rockchip-vpu device /dev/media0:
> > 
> > Media Driver Info:
> > 	Driver name      : rockchip-vpu
> > 	Model            : rockchip-vpu
> > 	Serial           : 
> > 	Bus info         : platform: rockchip-vpu
> > 	Media version    : 5.1.0
> > 	Hardware revision: 0x00000000 (0)
> > 	Driver version   : 5.1.0
> > 
> > Required ioctls:
> > 	test MEDIA_IOC_DEVICE_INFO: OK
> > 
> > Allow for multiple opens:
> > 	test second /dev/media0 open: OK
> > 	test MEDIA_IOC_DEVICE_INFO: OK
> > 	test for unlimited opens: OK
> > 
> > Media Controller ioctls:
> > 	test MEDIA_IOC_G_TOPOLOGY: OK
> > 	Entities: 6 Interfaces: 2 Pads: 8 Links: 8
> > 	test MEDIA_IOC_ENUM_ENTITIES/LINKS: OK
> > 	test MEDIA_IOC_SETUP_LINK: OK
> > 
> > Total for rockchip-vpu device /dev/media0: 7, Succeeded: 7, Failed: 0, Warnings: 0
> > --------------------------------------------------------------------------------
> > Compliance test for rockchip-vpu device /dev/video0:
> > 
> > Driver Info:
> > 	Driver name      : rockchip-vpu
> > 	Card type        : rockchip,rk3399-vpu-enc
> > 	Bus info         : platform: rockchip-vpu
> > 	Driver version   : 5.1.0
> > 	Capabilities     : 0x84204000
> > 		Video Memory-to-Memory Multiplanar
> > 		Streaming
> > 		Extended Pix Format
> > 		Device Capabilities
> > 	Device Caps      : 0x04204000
> > 		Video Memory-to-Memory Multiplanar
> > 		Streaming
> > 		Extended Pix Format
> > 	Detected JPEG Encoder
> > Media Driver Info:
> > 	Driver name      : rockchip-vpu
> > 	Model            : rockchip-vpu
> > 	Serial           : 
> > 	Bus info         : platform: rockchip-vpu
> > 	Media version    : 5.1.0
> > 	Hardware revision: 0x00000000 (0)
> > 	Driver version   : 5.1.0
> > Interface Info:
> > 	ID               : 0x0300000c
> > 	Type             : V4L Video
> > Entity Info:
> > 	ID               : 0x00000001 (1)
> > 	Name             : rockchip,rk3399-vpu-enc-source
> > 	Function         : V4L2 I/O
> > 	Pad 0x01000002   : 0: Source
> > 	  Link 0x02000008: to remote pad 0x1000005 of entity 'rockchip,rk3399-vpu-enc-proc': Data, Enabled, Immutable
> > 
> > Required ioctls:
> > 	test MC information (see 'Media Driver Info' above): OK
> > 	test VIDIOC_QUERYCAP: OK
> > 
> > Allow for multiple opens:
> > 	test second /dev/video0 open: OK
> > 	test VIDIOC_QUERYCAP: OK
> > 	test VIDIOC_G/S_PRIORITY: OK
> > 	test for unlimited opens: OK
> > 
> > Debug ioctls:
> > 	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
> > 	test VIDIOC_LOG_STATUS: OK (Not Supported)
> > 
> > Input ioctls:
> > 	test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
> > 	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> > 	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
> > 	test VIDIOC_ENUMAUDIO: OK (Not Supported)
> > 	test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
> > 	test VIDIOC_G/S_AUDIO: OK (Not Supported)
> > 	Inputs: 0 Audio Inputs: 0 Tuners: 0
> > 
> > Output ioctls:
> > 	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
> > 	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> > 	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
> > 	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
> > 	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
> > 	Outputs: 0 Audio Outputs: 0 Modulators: 0
> > 
> > Input/Output configuration ioctls:
> > 	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
> > 	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
> > 	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
> > 	test VIDIOC_G/S_EDID: OK (Not Supported)
> > 
> > Control ioctls:
> > 	test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
> > 	test VIDIOC_QUERYCTRL: OK
> > 	test VIDIOC_G/S_CTRL: OK
> > 	test VIDIOC_G/S/TRY_EXT_CTRLS: OK
> > 	test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
> > 	test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
> > 	Standard Controls: 2 Private Controls: 0
> > 
> > Format ioctls:
> > 	test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
> > 	test VIDIOC_G/S_PARM: OK (Not Supported)
> > 	test VIDIOC_G_FBUF: OK (Not Supported)
> > 	test VIDIOC_G_FMT: OK
> > 	test VIDIOC_TRY_FMT: OK
> > 	test VIDIOC_S_FMT: OK
> > 	test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
> > 	test Cropping: OK (Not Supported)
> > 	test Composing: OK (Not Supported)
> > 	test Scaling: OK
> > 
> > Codec ioctls:
> > 	test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
> > 	test VIDIOC_G_ENC_INDEX: OK (Not Supported)
> > 	test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
> > 
> > Buffer ioctls:
> > 		fail: v4l2-test-buffers.cpp(709): q.create_bufs(node, 1, &fmt) != EINVAL
> > 	test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: FAIL
> > 	test VIDIOC_EXPBUF: OK
> > testRequests:1760 ret 0
> > 		fail: v4l2-test-buffers.cpp(1820): !supports_requests
> > 	test Requests: FAIL
> > 
> > Total for rockchip-vpu device /dev/video0: 45, Succeeded: 43, Failed: 2, Warnings: 0
> > --------------------------------------------------------------------------------
> > Compliance test for rockchip-vpu device /dev/video1:
> > 
> > Driver Info:
> > 	Driver name      : rockchip-vpu
> > 	Card type        : rockchip,rk3399-vpu-dec
> > 	Bus info         : platform: rockchip-vpu
> > 	Driver version   : 5.1.0
> > 	Capabilities     : 0x84204000
> > 		Video Memory-to-Memory Multiplanar
> > 		Streaming
> > 		Extended Pix Format
> > 		Device Capabilities
> > 	Device Caps      : 0x04204000
> > 		Video Memory-to-Memory Multiplanar
> > 		Streaming
> > 		Extended Pix Format
> > 	Detected Stateless Decoder
> > Media Driver Info:
> > 	Driver name      : rockchip-vpu
> > 	Model            : rockchip-vpu
> > 	Serial           : 
> > 	Bus info         : platform: rockchip-vpu
> > 	Media version    : 5.1.0
> > 	Hardware revision: 0x00000000 (0)
> > 	Driver version   : 5.1.0
> > Interface Info:
> > 	ID               : 0x0300001a
> > 	Type             : V4L Video
> > Entity Info:
> > 	ID               : 0x0000000f (15)
> > 	Name             : rockchip,rk3399-vpu-dec-source
> > 	Function         : V4L2 I/O
> > 	Pad 0x01000010   : 0: Source
> > 	  Link 0x02000016: to remote pad 0x1000013 of entity 'rockchip,rk3399-vpu-dec-proc': Data, Enabled, Immutable
> > 
> > Required ioctls:
> > 	test MC information (see 'Media Driver Info' above): OK
> > 	test VIDIOC_QUERYCAP: OK
> > 
> > Allow for multiple opens:
> > 	test second /dev/video1 open: OK
> > 	test VIDIOC_QUERYCAP: OK
> > 	test VIDIOC_G/S_PRIORITY: OK
> > 	test for unlimited opens: OK
> > 
> > Debug ioctls:
> > 	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
> > 	test VIDIOC_LOG_STATUS: OK (Not Supported)
> > 
> > Input ioctls:
> > 	test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
> > 	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> > 	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
> > 	test VIDIOC_ENUMAUDIO: OK (Not Supported)
> > 	test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
> > 	test VIDIOC_G/S_AUDIO: OK (Not Supported)
> > 	Inputs: 0 Audio Inputs: 0 Tuners: 0
> > 
> > Output ioctls:
> > 	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
> > 	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> > 	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
> > 	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
> > 	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
> > 	Outputs: 0 Audio Outputs: 0 Modulators: 0
> > 
> > Input/Output configuration ioctls:
> > 	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
> > 	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
> > 	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
> > 	test VIDIOC_G/S_EDID: OK (Not Supported)
> > 
> > Control ioctls:
> > 	test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
> > 	test VIDIOC_QUERYCTRL: OK
> > 	test VIDIOC_G/S_CTRL: OK
> > 		fail: v4l2-test-controls.cpp(673): try_ext_ctrls returned an error (22)
> > 	test VIDIOC_G/S/TRY_EXT_CTRLS: FAIL
> > 	test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
> > 	test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
> > 	Standard Controls: 2 Private Controls: 0
> > 
> > Format ioctls:
> > 	test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
> > 	test VIDIOC_G/S_PARM: OK (Not Supported)
> > 	test VIDIOC_G_FBUF: OK (Not Supported)
> > 	test VIDIOC_G_FMT: OK
> > 	test VIDIOC_TRY_FMT: OK
> > 		fail: v4l2-test-formats.cpp(806): fmt_cap.g_colorspace() != col
> > 	test VIDIOC_S_FMT: FAIL
> > 	test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
> > 	test Cropping: OK (Not Supported)
> > 	test Composing: OK (Not Supported)
> > 	test Scaling: OK
> > 
> > Codec ioctls:
> > 	test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
> > 	test VIDIOC_G_ENC_INDEX: OK (Not Supported)
> > 	test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
> > 
> > Buffer ioctls:
> > 		fail: v4l2-test-buffers.cpp(709): q.create_bufs(node, 1, &fmt) != EINVAL
> > 	test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: FAIL
> > 	test VIDIOC_EXPBUF: OK
> > 	test Requests: OK (Not Supported)
> > 
> > Total for rockchip-vpu device /dev/video1: 45, Succeeded: 42, Failed: 3, Warnings: 0
> > 
> > Grand Total for rockchip-vpu device /dev/media0: 97, Succeeded: 92, Failed: 5, Warnings: 0
> > 
> > "
> > 
> > 2 of those failures are expected: 
> > 
> > * "fail: v4l2-test-formats.cpp(806): fmt_cap.g_colorspace() != col": is caused
> >   by the reset done by the driver on the non-coded end when the coded end of
> >   the pipeline is modified (which follows the behavior described in stateless
> >   decoder spec)  
> 
> So is this a driver FIXME, or an issue in the compliance test itself?

Looks like the spec mandates the opposite, so it's a driver bug. I'll
fix that. The main issue I see is that the RK encoder code has this
comment:

        /*
         * Current raw format might have become invalid with newly
         * selected codec, so reset it to default just to be safe and
         * keep internal driver state sane. User is mandated to set
         * the raw format again after we return, so we don't need
         * anything smarter.
         */

Does that mean we have a different behavior between encoders and
decoders?

> 
> > 
> > * "fail: v4l2-test-controls.cpp(673): try_ext_ctrls returned an error (22)":
> >   default values for mpeg2 ctrls are not suitable, so doing
> >   get_ext_ctrl()+try_ext_ctrl() does not work.  
> 
> Hmm, this might require some changes to this test. Where does it fail in the
> driver? Is that the std_validate() check in v4l2-ctrls.c?

Don't remember where it complained exactly, but it was in some generic
function, yes.

> 
> If so, then I think it would be wise to add an initializer for V4L2_CTRL_TYPE_MPEG2_SLICE_PARAMS
> to std_init() so that it creates a proper default.

Okay.

> 
> I also noticed that support for these new compound types is missing in
> the std_log() function in v4l2-ctrls.c. It should probably log the
> type. Check with v4l2-ctl --log-status to see how it looks in the
> kernel log.

Will look at it too.

> Obviously, this can be done in a separate patch since it's
> independent of the rockchip driver.

Sure.

WARNING: multiple messages have this Message-ID (diff)
From: Boris Brezillon <boris.brezillon-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
To: Hans Verkuil <hverkuil-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org>
Cc: Nicolas Dufresne
	<nicolas-dDhyB4GVkw9AFePFGvp55w@public.gmane.org>,
	kernel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org,
	Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>,
	Jonas Karlman <jonas-uIzNG4q0ceqzQB+pC5nmwQ@public.gmane.org>,
	Tomasz Figa <tfiga-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	Paul Kocialkowski
	<paul.kocialkowski-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org>,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Sakari Ailus <sakari.ailus-X3B1VOXEql0@public.gmane.org>,
	Laurent Pinchart
	<laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>,
	Hans Verkuil
	<hans.verkuil-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>,
	Mauro Carvalho Chehab
	<mchehab-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Ezequiel Garcia
	<ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>,
	linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v4 00/21] Add MPEG-2 decoding to Rockchip VPU
Date: Thu, 25 Apr 2019 11:36:39 +0200	[thread overview]
Message-ID: <20190425113639.3294b6d9@collabora.com> (raw)
In-Reply-To: <69d53367-f26a-a3cb-0221-7d9be02ade6e-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org>

On Thu, 25 Apr 2019 10:21:16 +0200
Hans Verkuil <hverkuil@xs4all.nl> wrote:

> On 4/25/19 10:06 AM, Boris Brezillon wrote:
> > On Thu, 25 Apr 2019 09:12:21 +0200
> > Boris Brezillon <boris.brezillon@collabora.com> wrote:
> >   
> >> This series introduces the decoding infrastructure that will be
> >> used to add support for other codecs such as VP8, VP9 and H.264.
> >>
> >> As explained in the cover letter for the v1 patchset,
> >> the driver is now exposing two video device nodes.
> >> The VPU encoder is exposed on /dev/video0, and the VPU decoder
> >> is exposed on /dev/video1. Both devices are tied to the same
> >> memory-to-memory queue, and same media device /dev/media0.
> >>
> >> Therefore there are two media graphs:
> >>
> >> ┌────────────────────────────────┐
> >> │ rockchip,rk3399-vpu-enc-source │
> >> │          /dev/video0           │
> >> └────────────────────────────────┘
> >>   ┃
> >>   ┃
> >>   ▼
> >> ┌────────────────────────────────┐
> >> │  rockchip,rk3399-vpu-enc-proc  │
> >> └────────────────────────────────┘
> >>   ┃
> >>   ┃
> >>   ▼
> >> ┌────────────────────────────────┐
> >> │  rockchip,rk3399-vpu-enc-sink  │
> >> │          /dev/video0           │
> >> └────────────────────────────────┘
> >>
> >> ┌────────────────────────────────┐
> >> │ rockchip,rk3399-vpu-dec-source │
> >> │          /dev/video1           │
> >> └────────────────────────────────┘
> >>   ┃
> >>   ┃
> >>   ▼
> >> ┌────────────────────────────────┐
> >> │  rockchip,rk3399-vpu-dec-proc  │
> >> └────────────────────────────────┘
> >>   ┃
> >>   ┃
> >>   ▼
> >> ┌────────────────────────────────┐
> >> │  rockchip,rk3399-vpu-dec-sink  │
> >> │          /dev/video1           │
> >> └────────────────────────────────┘
> >>
> >> Of course, this work has been possible thanks to Jonas Karlman, who did
> >> the initial MPEG-2 decoding work and also got mpv+ffmpeg working using
> >> the Request API.  
> > 
> > Forgot to provide the v4l2-compliance results, so here it is:
> > 
> > "
> > v4l2-compliance SHA: 95f39aae48c6e8e5cc81e6ae6293d999f70a909b, 64 bits
> > 
> > Compliance test for rockchip-vpu device /dev/media0:
> > 
> > Media Driver Info:
> > 	Driver name      : rockchip-vpu
> > 	Model            : rockchip-vpu
> > 	Serial           : 
> > 	Bus info         : platform: rockchip-vpu
> > 	Media version    : 5.1.0
> > 	Hardware revision: 0x00000000 (0)
> > 	Driver version   : 5.1.0
> > 
> > Required ioctls:
> > 	test MEDIA_IOC_DEVICE_INFO: OK
> > 
> > Allow for multiple opens:
> > 	test second /dev/media0 open: OK
> > 	test MEDIA_IOC_DEVICE_INFO: OK
> > 	test for unlimited opens: OK
> > 
> > Media Controller ioctls:
> > 	test MEDIA_IOC_G_TOPOLOGY: OK
> > 	Entities: 6 Interfaces: 2 Pads: 8 Links: 8
> > 	test MEDIA_IOC_ENUM_ENTITIES/LINKS: OK
> > 	test MEDIA_IOC_SETUP_LINK: OK
> > 
> > Total for rockchip-vpu device /dev/media0: 7, Succeeded: 7, Failed: 0, Warnings: 0
> > --------------------------------------------------------------------------------
> > Compliance test for rockchip-vpu device /dev/video0:
> > 
> > Driver Info:
> > 	Driver name      : rockchip-vpu
> > 	Card type        : rockchip,rk3399-vpu-enc
> > 	Bus info         : platform: rockchip-vpu
> > 	Driver version   : 5.1.0
> > 	Capabilities     : 0x84204000
> > 		Video Memory-to-Memory Multiplanar
> > 		Streaming
> > 		Extended Pix Format
> > 		Device Capabilities
> > 	Device Caps      : 0x04204000
> > 		Video Memory-to-Memory Multiplanar
> > 		Streaming
> > 		Extended Pix Format
> > 	Detected JPEG Encoder
> > Media Driver Info:
> > 	Driver name      : rockchip-vpu
> > 	Model            : rockchip-vpu
> > 	Serial           : 
> > 	Bus info         : platform: rockchip-vpu
> > 	Media version    : 5.1.0
> > 	Hardware revision: 0x00000000 (0)
> > 	Driver version   : 5.1.0
> > Interface Info:
> > 	ID               : 0x0300000c
> > 	Type             : V4L Video
> > Entity Info:
> > 	ID               : 0x00000001 (1)
> > 	Name             : rockchip,rk3399-vpu-enc-source
> > 	Function         : V4L2 I/O
> > 	Pad 0x01000002   : 0: Source
> > 	  Link 0x02000008: to remote pad 0x1000005 of entity 'rockchip,rk3399-vpu-enc-proc': Data, Enabled, Immutable
> > 
> > Required ioctls:
> > 	test MC information (see 'Media Driver Info' above): OK
> > 	test VIDIOC_QUERYCAP: OK
> > 
> > Allow for multiple opens:
> > 	test second /dev/video0 open: OK
> > 	test VIDIOC_QUERYCAP: OK
> > 	test VIDIOC_G/S_PRIORITY: OK
> > 	test for unlimited opens: OK
> > 
> > Debug ioctls:
> > 	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
> > 	test VIDIOC_LOG_STATUS: OK (Not Supported)
> > 
> > Input ioctls:
> > 	test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
> > 	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> > 	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
> > 	test VIDIOC_ENUMAUDIO: OK (Not Supported)
> > 	test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
> > 	test VIDIOC_G/S_AUDIO: OK (Not Supported)
> > 	Inputs: 0 Audio Inputs: 0 Tuners: 0
> > 
> > Output ioctls:
> > 	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
> > 	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> > 	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
> > 	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
> > 	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
> > 	Outputs: 0 Audio Outputs: 0 Modulators: 0
> > 
> > Input/Output configuration ioctls:
> > 	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
> > 	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
> > 	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
> > 	test VIDIOC_G/S_EDID: OK (Not Supported)
> > 
> > Control ioctls:
> > 	test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
> > 	test VIDIOC_QUERYCTRL: OK
> > 	test VIDIOC_G/S_CTRL: OK
> > 	test VIDIOC_G/S/TRY_EXT_CTRLS: OK
> > 	test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
> > 	test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
> > 	Standard Controls: 2 Private Controls: 0
> > 
> > Format ioctls:
> > 	test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
> > 	test VIDIOC_G/S_PARM: OK (Not Supported)
> > 	test VIDIOC_G_FBUF: OK (Not Supported)
> > 	test VIDIOC_G_FMT: OK
> > 	test VIDIOC_TRY_FMT: OK
> > 	test VIDIOC_S_FMT: OK
> > 	test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
> > 	test Cropping: OK (Not Supported)
> > 	test Composing: OK (Not Supported)
> > 	test Scaling: OK
> > 
> > Codec ioctls:
> > 	test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
> > 	test VIDIOC_G_ENC_INDEX: OK (Not Supported)
> > 	test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
> > 
> > Buffer ioctls:
> > 		fail: v4l2-test-buffers.cpp(709): q.create_bufs(node, 1, &fmt) != EINVAL
> > 	test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: FAIL
> > 	test VIDIOC_EXPBUF: OK
> > testRequests:1760 ret 0
> > 		fail: v4l2-test-buffers.cpp(1820): !supports_requests
> > 	test Requests: FAIL
> > 
> > Total for rockchip-vpu device /dev/video0: 45, Succeeded: 43, Failed: 2, Warnings: 0
> > --------------------------------------------------------------------------------
> > Compliance test for rockchip-vpu device /dev/video1:
> > 
> > Driver Info:
> > 	Driver name      : rockchip-vpu
> > 	Card type        : rockchip,rk3399-vpu-dec
> > 	Bus info         : platform: rockchip-vpu
> > 	Driver version   : 5.1.0
> > 	Capabilities     : 0x84204000
> > 		Video Memory-to-Memory Multiplanar
> > 		Streaming
> > 		Extended Pix Format
> > 		Device Capabilities
> > 	Device Caps      : 0x04204000
> > 		Video Memory-to-Memory Multiplanar
> > 		Streaming
> > 		Extended Pix Format
> > 	Detected Stateless Decoder
> > Media Driver Info:
> > 	Driver name      : rockchip-vpu
> > 	Model            : rockchip-vpu
> > 	Serial           : 
> > 	Bus info         : platform: rockchip-vpu
> > 	Media version    : 5.1.0
> > 	Hardware revision: 0x00000000 (0)
> > 	Driver version   : 5.1.0
> > Interface Info:
> > 	ID               : 0x0300001a
> > 	Type             : V4L Video
> > Entity Info:
> > 	ID               : 0x0000000f (15)
> > 	Name             : rockchip,rk3399-vpu-dec-source
> > 	Function         : V4L2 I/O
> > 	Pad 0x01000010   : 0: Source
> > 	  Link 0x02000016: to remote pad 0x1000013 of entity 'rockchip,rk3399-vpu-dec-proc': Data, Enabled, Immutable
> > 
> > Required ioctls:
> > 	test MC information (see 'Media Driver Info' above): OK
> > 	test VIDIOC_QUERYCAP: OK
> > 
> > Allow for multiple opens:
> > 	test second /dev/video1 open: OK
> > 	test VIDIOC_QUERYCAP: OK
> > 	test VIDIOC_G/S_PRIORITY: OK
> > 	test for unlimited opens: OK
> > 
> > Debug ioctls:
> > 	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
> > 	test VIDIOC_LOG_STATUS: OK (Not Supported)
> > 
> > Input ioctls:
> > 	test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
> > 	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> > 	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
> > 	test VIDIOC_ENUMAUDIO: OK (Not Supported)
> > 	test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
> > 	test VIDIOC_G/S_AUDIO: OK (Not Supported)
> > 	Inputs: 0 Audio Inputs: 0 Tuners: 0
> > 
> > Output ioctls:
> > 	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
> > 	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> > 	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
> > 	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
> > 	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
> > 	Outputs: 0 Audio Outputs: 0 Modulators: 0
> > 
> > Input/Output configuration ioctls:
> > 	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
> > 	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
> > 	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
> > 	test VIDIOC_G/S_EDID: OK (Not Supported)
> > 
> > Control ioctls:
> > 	test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
> > 	test VIDIOC_QUERYCTRL: OK
> > 	test VIDIOC_G/S_CTRL: OK
> > 		fail: v4l2-test-controls.cpp(673): try_ext_ctrls returned an error (22)
> > 	test VIDIOC_G/S/TRY_EXT_CTRLS: FAIL
> > 	test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
> > 	test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
> > 	Standard Controls: 2 Private Controls: 0
> > 
> > Format ioctls:
> > 	test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
> > 	test VIDIOC_G/S_PARM: OK (Not Supported)
> > 	test VIDIOC_G_FBUF: OK (Not Supported)
> > 	test VIDIOC_G_FMT: OK
> > 	test VIDIOC_TRY_FMT: OK
> > 		fail: v4l2-test-formats.cpp(806): fmt_cap.g_colorspace() != col
> > 	test VIDIOC_S_FMT: FAIL
> > 	test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
> > 	test Cropping: OK (Not Supported)
> > 	test Composing: OK (Not Supported)
> > 	test Scaling: OK
> > 
> > Codec ioctls:
> > 	test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
> > 	test VIDIOC_G_ENC_INDEX: OK (Not Supported)
> > 	test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
> > 
> > Buffer ioctls:
> > 		fail: v4l2-test-buffers.cpp(709): q.create_bufs(node, 1, &fmt) != EINVAL
> > 	test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: FAIL
> > 	test VIDIOC_EXPBUF: OK
> > 	test Requests: OK (Not Supported)
> > 
> > Total for rockchip-vpu device /dev/video1: 45, Succeeded: 42, Failed: 3, Warnings: 0
> > 
> > Grand Total for rockchip-vpu device /dev/media0: 97, Succeeded: 92, Failed: 5, Warnings: 0
> > 
> > "
> > 
> > 2 of those failures are expected: 
> > 
> > * "fail: v4l2-test-formats.cpp(806): fmt_cap.g_colorspace() != col": is caused
> >   by the reset done by the driver on the non-coded end when the coded end of
> >   the pipeline is modified (which follows the behavior described in stateless
> >   decoder spec)  
> 
> So is this a driver FIXME, or an issue in the compliance test itself?

Looks like the spec mandates the opposite, so it's a driver bug. I'll
fix that. The main issue I see is that the RK encoder code has this
comment:

        /*
         * Current raw format might have become invalid with newly
         * selected codec, so reset it to default just to be safe and
         * keep internal driver state sane. User is mandated to set
         * the raw format again after we return, so we don't need
         * anything smarter.
         */

Does that mean we have a different behavior between encoders and
decoders?

> 
> > 
> > * "fail: v4l2-test-controls.cpp(673): try_ext_ctrls returned an error (22)":
> >   default values for mpeg2 ctrls are not suitable, so doing
> >   get_ext_ctrl()+try_ext_ctrl() does not work.  
> 
> Hmm, this might require some changes to this test. Where does it fail in the
> driver? Is that the std_validate() check in v4l2-ctrls.c?

Don't remember where it complained exactly, but it was in some generic
function, yes.

> 
> If so, then I think it would be wise to add an initializer for V4L2_CTRL_TYPE_MPEG2_SLICE_PARAMS
> to std_init() so that it creates a proper default.

Okay.

> 
> I also noticed that support for these new compound types is missing in
> the std_log() function in v4l2-ctrls.c. It should probably log the
> type. Check with v4l2-ctl --log-status to see how it looks in the
> kernel log.

Will look at it too.

> Obviously, this can be done in a separate patch since it's
> independent of the rockchip driver.

Sure.

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

  reply	other threads:[~2019-04-25  9:36 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-25  7:12 [PATCH v4 00/21] Add MPEG-2 decoding to Rockchip VPU Boris Brezillon
2019-04-25  7:12 ` Boris Brezillon
2019-04-25  7:12 ` [PATCH v4 01/21] rockchip/vpu: Use pixel format helpers Boris Brezillon
2019-04-25  7:12   ` Boris Brezillon
2019-04-25  7:12 ` [PATCH v4 02/21] rockchip/vpu: Use v4l2_m2m_buf_copy_metadata Boris Brezillon
2019-04-25  7:12   ` Boris Brezillon
2019-04-25  7:12 ` [PATCH v4 03/21] rockchip/vpu: Cleanup macroblock alignment Boris Brezillon
2019-04-25  7:12   ` Boris Brezillon
2019-04-25  7:12 ` [PATCH v4 04/21] rockchip/vpu: Cleanup JPEG bounce buffer management Boris Brezillon
2019-04-25  7:12   ` Boris Brezillon
2019-04-25  7:12 ` [PATCH v4 05/21] rockchip/vpu: Remove a useless test Boris Brezillon
2019-04-25  7:12   ` Boris Brezillon
2019-04-25  7:12 ` [PATCH v4 06/21] rockchip/vpu: Do not request id 0 for our video device Boris Brezillon
2019-04-25  7:12   ` Boris Brezillon
2019-04-25  7:12 ` [PATCH v4 07/21] rockchip/vpu: Add missing dont_use_autosuspend() calls Boris Brezillon
2019-04-25  7:12   ` Boris Brezillon
2019-04-25  7:12 ` [PATCH v4 08/21] rockchip/vpu: Get vdev from the file arg in vidioc_querycap() Boris Brezillon
2019-04-25  7:12   ` Boris Brezillon
2019-04-25  7:12 ` [PATCH v4 09/21] rockchip/vpu: Initialize mdev->bus_info Boris Brezillon
2019-04-25  7:12   ` Boris Brezillon
2019-04-25  7:12 ` [PATCH v4 10/21] rockchip/vpu: Fix/re-order probe-error/remove path Boris Brezillon
2019-04-25  7:12   ` Boris Brezillon
2019-04-25  7:12 ` [PATCH v4 11/21] rockchip/vpu: Open-code media controller register Boris Brezillon
2019-04-25  7:12   ` Boris Brezillon
2019-04-25  7:12 ` [PATCH v4 12/21] rockchip/vpu: Support the Request API Boris Brezillon
2019-04-25  7:12   ` Boris Brezillon
2019-04-25  7:12 ` [PATCH v4 13/21] rockchip/vpu: Rename rockchip_vpu_common.h into rockchip_vpu_v4l2.h Boris Brezillon
2019-04-25  7:12   ` Boris Brezillon
2019-04-25  7:12 ` [PATCH v4 14/21] rockchip/vpu: Move encoder logic to a common place Boris Brezillon
2019-04-25  7:12   ` Boris Brezillon
2019-04-25  7:12 ` [PATCH v4 15/21] rockchip/vpu: Provide a helper to reset both src and dst formats Boris Brezillon
2019-04-25  7:12   ` Boris Brezillon
2019-04-25  7:12 ` [PATCH v4 16/21] rockchip/vpu: Prepare things to support decoders Boris Brezillon
2019-04-25  7:12   ` Boris Brezillon
2019-04-25  7:12 ` [PATCH v4 17/21] rockchip/vpu: Add decoder boilerplate Boris Brezillon
2019-04-25  7:12   ` Boris Brezillon
2019-04-25  7:12 ` [PATCH v4 18/21] rockchip/vpu: Add support for non-standard controls Boris Brezillon
2019-04-25  7:12   ` Boris Brezillon
2019-04-25  7:12 ` [PATCH v4 19/21] rockchip/vpu: Add infra to support MPEG-2 decoding Boris Brezillon
2019-04-25  7:12   ` Boris Brezillon
2019-04-25  7:12 ` [PATCH v4 20/21] rockchip/vpu: Add MPEG2 decoding support to RK3399 Boris Brezillon
2019-04-25  7:12   ` Boris Brezillon
2019-04-25  7:12 ` [PATCH v4 21/21] rockchip/vpu: Add support for MPEG-2 decoding on RK3288 Boris Brezillon
2019-04-25  7:12   ` Boris Brezillon
2019-04-25  8:06 ` [PATCH v4 00/21] Add MPEG-2 decoding to Rockchip VPU Boris Brezillon
2019-04-25  8:06   ` Boris Brezillon
2019-04-25  8:15   ` Boris Brezillon
2019-04-25  8:15     ` Boris Brezillon
2019-04-25  8:21   ` Hans Verkuil
2019-04-25  8:21     ` Hans Verkuil
2019-04-25  9:36     ` Boris Brezillon [this message]
2019-04-25  9:36       ` Boris Brezillon
2019-04-25  9:41       ` Hans Verkuil
2019-04-25  9:41         ` Hans Verkuil
2019-04-25  8:27 ` Hans Verkuil
2019-04-25  8:27   ` Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190425113639.3294b6d9@collabora.com \
    --to=boris.brezillon@collabora.com \
    --cc=ezequiel@collabora.com \
    --cc=hans.verkuil@cisco.com \
    --cc=heiko@sntech.de \
    --cc=hverkuil@xs4all.nl \
    --cc=jonas@kwiboo.se \
    --cc=kernel@collabora.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mchehab@kernel.org \
    --cc=nicolas@ndufresne.ca \
    --cc=paul.kocialkowski@bootlin.com \
    --cc=sakari.ailus@iki.fi \
    --cc=tfiga@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.