s5p_mfc: Support encoder Flush() feature |
|||||||
Issue description
In issue:755889, we add Flush() function in V4L2 VEA. To support this function, the V4L2 driver should implement V4L2_ENC_STOP and V4L2_ENC_START command correctly.
We found the s5p_mfc driver in v3.18 does not implement these command well. It will break the VEA unittest on peach-pit device.
Here is the log in /var/log/messages:
2018-04-05T01:54:46.537877-07:00 INFO kernel: [ 5993.510198] Image size has been modified from 320x193 to 320x208
2018-04-05T01:54:46.537905-07:00 ERR kernel: [ 5999.574041] vidioc_try_fmt:1056: failed to try output format
2018-04-05T01:54:46.592837-07:00 ERR kernel: [ 5999.625138] vidioc_qbuf:1288: Call on QBUF after EOS command
2018-04-05T01:54:46.592864-07:00 ERR kernel: [ 5999.625326] s5p_mfc_fatal_error:114: Got a fatal error, will clean up context if present.
2018-04-05T01:54:46.592871-07:00 ERR kernel: [ 5999.626140] s5p_mfc_wait_for_done_ctx:66: Waiting for ctx ecc4a000 ended with error
2018-04-05T01:54:46.592910-07:00 ERR kernel: [ 5999.626157] s5p_mfc_wait_for_done_ctx:66: Waiting for ctx ecc4a000 ended with error
2018-04-05T01:56:08.182881-07:00 ERR kernel: [ 6081.214678] vidioc_try_fmt:1056: failed to try output format
2018-04-05T01:56:08.187821-07:00 INFO kernel: [ 5999.574958] Image size has been modified from 320x193 to 320x208
2018-04-05T01:56:08.262837-07:00 INFO kernel: [ 6081.219910] Image size has been modified from 320x193 to 320x208<3>[ 6081.297910] s5p_mfc_fatal_error:114: Got a fatal error, will clean up context if present.
2018-04-05T01:56:08.262863-07:00 ERR kernel: [ 6081.298251] vidioc_dqbuf:1308: Call on DQBUF after unrecoverable error
2018-04-05T01:56:08.267829-07:00 ERR kernel: [ 6081.300340] s5p_mfc_wait_for_done_ctx:66: Waiting for ctx ecc4a000 ended with error
2018-04-05T01:56:08.267849-07:00 ERR kernel: [ 6081.300359] s5p_mfc_wait_for_done_ctx:66: Waiting for ctx ecc4a000 ended with error
Here is the log of the unittest
[0405/015608.260069:VERBOSE2:v4l2_video_encode_accelerator.cc(374)] Flush():
[0405/015608.260089:VERBOSE4:v4l2_video_encode_accelerator.cc(956)] DevicePollTask():
[0405/015608.260124:VERBOSE4:v4l2_video_encode_accelerator.cc(303)] UseOutputBitstreamBuffer(): id=36
[0405/015608.260094:VERBOSE4:v4l2_video_encode_accelerator.cc(616)] Enqueue(): free_input_buffers: 2input_queue: 1
[0405/015608.260174:VERBOSE4:v4l2_video_encode_accelerator.cc(785)] EnqueueInputRecord():
[0405/015608.260530:VERBOSE4:v4l2_video_encode_accelerator.cc(525)] EncodeTask(): force_keyframe=0
[0405/015608.260683:VERBOSE4:v4l2_video_encode_accelerator.cc(616)] Enqueue(): free_input_buffers: 1input_queue: 1
[0405/015608.260835:VERBOSE3:v4l2_video_encode_accelerator.cc(624)] Enqueue(): All input frames needed to be flushed are enqueued.
[0405/015608.260848:VERBOSE4:v4l2_video_encode_accelerator.cc(411)] FrameProcessed(): force_keyframe=0, output_buffer_index=1
../../media/gpu/video_encode_accelerator_unittest.cc:2417: Failure
Expected equality of these values:
state
Which is: 4
notes[i]->Wait()
Which is: 7
[0405/015608.261495:VERBOSE4:v4l2_video_encode_accelerator.cc(540)] UseOutputBitstreamBufferTask(): id=36
[0405/015608.261535:VERBOSE4:v4l2_video_encode_accelerator.cc(616)] Enqueue(): free_input_buffers: 1input_queue: 0
[0405/015608.261569:VERBOSE3:v4l2_video_encode_accelerator.cc(570)] ServiceDeviceTask():
[0405/015608.261597:VERBOSE4:v4l2_video_encode_accelerator.cc(688)] Dequeue():
[0405/015608.261624:VERBOSE4:v4l2_video_encode_accelerator.cc(696)] Dequeue(): inputs queued: 1
[0405/015608.261670:VERBOSE1:v4l2_video_encode_accelerator.cc(709)] Dequeue(): ioctl() failed: VIDIOC_DQBUF: Input/output error (5)
[0405/015608.261727:VERBOSE1:v4l2_video_encode_accelerator.cc(710)] Dequeue(): Setting error state:2
[0405/015608.261759:VERBOSE1:v4l2_video_encode_accelerator.cc(973)] NotifyError(): error=2
[0405/015608.261804:VERBOSE4:v4l2_video_encode_accelerator.cc(616)] Enqueue(): free_input_buffers: 1input_queue: 0
[0405/015608.261824:VERBOSE1:v4l2_video_encode_accelerator.cc(973)] NotifyError(): error=2
[0405/015608.261850:VERBOSE3:v4l2_video_encode_accelerator.cc(603)] ServiceDeviceTask(): 0] => DEVICE[1+1/2->0+2/2] => OUT[2]
[0405/015608.261899:VERBOSE4:v4l2_video_encode_accelerator.cc(525)] EncodeTask(): force_keyframe=0
[0405/015608.261929:VERBOSE1:v4l2_video_encode_accelerator.cc(530)] EncodeTask(): early out: kError state
[0405/015608.261991:VERBOSE4:v4l2_video_encode_accelerator.cc(443)] ReuseImageProcessorOutputBuffer(): output_buffer_index=1
[0405/015608.262028:VERBOSE4:v4l2_video_encode_accelerator.cc(275)] Encode(): force_keyframe=0
[0405/015608.262080:VERBOSE4:v4l2_video_encode_accelerator.cc(956)] DevicePollTask():
[0405/015608.262090:VERBOSE2:v4l2_video_encode_accelerator.cc(340)] Destroy():
[0405/015608.262123:VERBOSE2:v4l2_image_processor.cc(313)] Destroy():
,
Apr 5 2018
The driver has multiple bugs: 1) It doesn't implement VIDIOC_TRY_ENCODER_CMD. 2) Implementation of VIDIOC_ENCODER_CMD doesn't handle V4L2_ENC_CMD_START. 3) If there are no more buffers in OUTPUT queue (last buffer being encoded or already done), the instance enters MFCINST_FINISHING state, which requires both OUTPUT and CAPTURE buffers to proceed, which contradicts with the entry condition (fist part of the sentence). Moreover, in MFCINST_FINISHING, QBUF(OUTPUT) is disallowed and returns error, so it is not possible to execute flush.
,
Apr 9 2018
,
Apr 10 2018
Let's not spend time on an very old platform. Also ARC++ wasn't supported on peach.
,
Apr 10 2018
Hmm, I think flush is a part of the general V4L2 VEA implementation. It's not exercised right now by Chrome, but that might change. I think we should keep this bug open, just with low priority.
,
Apr 10 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c63a0ba6166da7a2c3706b33b5104ed868d05092 commit c63a0ba6166da7a2c3706b33b5104ed868d05092 Author: Chih-Yu Huang <akahuang@google.com> Date: Tue Apr 10 13:46:00 2018 vea_unittest: Add "--disable_flush" argument. We added Flush() function in VEA interface, but not all devices and drivers support this. This CL adds a new argument "--disable_flush" into VEA unittest to skip checking the flush function. Bug: chromium:829276 Test: Pass video_encode_accelerator_unittest --disable_flush at peach-pit device Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Change-Id: I82477a75178ec6aeb3ebf382b601005455c957a4 Reviewed-on: https://chromium-review.googlesource.com/999233 Reviewed-by: Ricky Liang <jcliang@chromium.org> Commit-Queue: Chih-Yu Huang <akahuang@chromium.org> Cr-Commit-Position: refs/heads/master@{#549508} [modify] https://crrev.com/c63a0ba6166da7a2c3706b33b5104ed868d05092/media/gpu/video_encode_accelerator_unittest.cc
,
May 10 2018
,
Jul 31
,
Aug 29
,
Oct 29
|
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by akahuang@chromium.org
, Apr 5 2018