All of lore.kernel.org
 help / color / mirror / Atom feed
* media: platform/rockchip/rkisp1 - v4l-compliance reports errors
@ 2021-07-29 12:36 Jens Korinth
  2021-07-29 22:38 ` Ezequiel Garcia
  0 siblings, 1 reply; 7+ messages in thread
From: Jens Korinth @ 2021-07-29 12:36 UTC (permalink / raw)
  To: linux-media

[-- Attachment #1: Type: text/plain, Size: 965 bytes --]

Hi *,

I am working on a camera system on Rockchip RK3399 board (Firefly ROC-RK3399-PC-Plus). Tried to use the rkisp1 driver, but was unable to connect to the rkisp1_mainpath output node, because format negotiation failed; so I ran v4l-compliance next and found that it reports several errors (see attached report).

Upon closer inspection I noticed in the VIDIOC_ENUM_FMT handler in drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c:1169+ that

1) the "reserved" member is not zeroed,
2) the userspace pointer to the v4l2_fmtdesc f is not checked via access_ok, and
3) it isn't copied from/to userspace using copy_from_user/copy_to_user.

I'm not sure if this is necessary in general, but at least on my platform the zeroing of the reserved member only worked correctly when I added the userspace copies. But even after these fixes, v4l-compliance reports further issues in format enumeration and negotiation. Is this a known issue?

Thanks!
-Jens

[-- Attachment #2: v4l2-compliance-report.txt --]
[-- Type: text/plain, Size: 3858 bytes --]

v4l2-compliance SHA: not available, 64 bits

Compliance test for rkisp1 device /dev/video0:

Driver Info:
	Driver name      : rkisp1
	Card type        : rkisp1
	Bus info         : platform:rkisp1
	Driver version   : 5.12.12
	Capabilities     : 0xa4201000
		Video Capture Multiplanar
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps      : 0x24201000
		Video Capture Multiplanar
		Streaming
		Extended Pix Format
Media Driver Info:
	Driver name      : rkisp1
	Model            : rkisp1
	Serial           : 
	Bus info         : platform:rkisp1
	Media version    : 5.12.12
	Hardware revision: 0x0000000a (10)
	Driver version   : 5.12.12
Interface Info:
	ID               : 0x0300000d
	Type             : V4L Video
Entity Info:
	ID               : 0x0000000c (12)
	Name             : rkisp1_mainpath
	Function         : V4L2 I/O
	Pad 0x0100000f   : 0: Sink
	  Link 0x02000022: from remote pad 0x1000008 of entity 'rkisp1_resizer_mainpath': 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
	test VIDIOC_G/S_AUDIO: OK (Not Supported)
	Inputs: 1 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 (Input 0):
	test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported)
	test VIDIOC_QUERYCTRL: OK (Not Supported)
	test VIDIOC_G/S_CTRL: OK (Not Supported)
	test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported)
	test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported)
	test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
	Standard Controls: 0 Private Controls: 0

Format ioctls (Input 0):
		fail: v4l2-test-formats.cpp(311): Video Capture Multiplanar cap set, but no Video Capture Multiplanar formats defined
	test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: FAIL
	test VIDIOC_G/S_PARM: OK (Not Supported)
	test VIDIOC_G_FBUF: OK (Not Supported)
		fail: v4l2-test-formats.cpp(461): pixelformat 56595559 (YUYV) for buftype 9 not reported by ENUM_FMT
	test VIDIOC_G_FMT: FAIL
		fail: v4l2-test-formats.cpp(461): pixelformat 56595559 (YUYV) for buftype 9 not reported by ENUM_FMT
	test VIDIOC_TRY_FMT: FAIL
		fail: v4l2-test-formats.cpp(461): pixelformat 56595559 (YUYV) for buftype 9 not reported by ENUM_FMT
	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 (Input 0):
	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 (Input 0):
	test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
	test VIDIOC_EXPBUF: OK
	test Requests: OK (Not Supported)

Total for rkisp1 device /dev/video0: 45, Succeeded: 41, Failed: 4, Warnings: 0


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

end of thread, other threads:[~2021-08-06  8:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-29 12:36 media: platform/rockchip/rkisp1 - v4l-compliance reports errors Jens Korinth
2021-07-29 22:38 ` Ezequiel Garcia
2021-07-30 10:20   ` Dafna Hirschfeld
     [not found]     ` <AM0PR04MB58250C5C17446561D4A18EDA98EC9@AM0PR04MB5825.eurprd04.prod.outlook.com>
2021-08-02  9:48       ` [EXT] " Dafna Hirschfeld
2021-08-06  8:07         ` Jens Korinth
2021-08-06  8:54           ` Dafna Hirschfeld
2021-08-06  8:55           ` Dafna Hirschfeld

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.