New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 615857 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

VIDIOC_G_CROP/VIDIOC_S_CROP should not use multiplanar buffer types

Project Member Reported by wuchengli@chromium.org, May 30 2016

Issue description

Accordint to spec, VIDIOC_G_CROP and VIDIOC_S_CROP should not use multiplanar buffer types.

"Do not use the multiplanar buffer types. Use V4L2_BUF_TYPE_VIDEO_CAPTURE instead of V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE and use V4L2_BUF_TYPE_VIDEO_OUTPUT instead of V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE."
https://linuxtv.org/downloads/v4l-dvb-apis/vidioc-g-crop.html

We need to update V4L2VEA, V4L2VDA, and V4L2IP. Drivers need to update, too.
 
Owner: wuchengli@chromium.org
Status: Assigned (was: Available)
Status: Archived (was: Assigned)
Status: Available (was: Archived)
Owner: mojahsu@chromium.org
Status: Assigned (was: Available)
In src/media/gpu, files:
v4l2_video_decode_accelerator.cc
v4l2_slice_video_decode_accelerator.cc
v4l2_video_encode_accelerator.cc
v4l2_image_processor.cc

Kernel drivers:
samsung: third_party/kernel/v3.8/drivers/media/platform/s5p-mfc
rockchip 3288: third_party/kernel/v3.14/drivers/media/platform/rk3288-vpu
mediatek: third_party/kernel/v3.18/drivers/media/platform/mtk-vcodec
rockchip 3399: third_party/kernel/v4.4/drivers/media/platform/rockchip-vpu
It looks like codec driver shouldn't use G_CROP/S_CROP API. We may need to switch to SELECTION API.

https://patchwork.kernel.org/patch/9723459/
How can I run unittest for v4l2_image_processor.cc and v4l2_slice_video_decode_accelerator.cc?
I didn't find CROP operations in v4l2_slice_video_decode_accelerator.cc. 
So maybe we can skip this file.
Project Member

Comment 10 by bugdroid1@chromium.org, Jul 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/92c29f34ff9ad157f94b6f1a8f67a795c9deb439

commit 92c29f34ff9ad157f94b6f1a8f67a795c9deb439
Author: mojahsu <mojahsu@chromium.org>
Date: Tue Jul 25 09:46:23 2017

V4L2 VDA/VEA: Use VIDIOC_G/S_SELECTION for codec drivers

Applications have to use the selection API to work with codec drivers.
The old crop ioctls are not suitable for such hardware.
For backward compatibility, we may fallback to use old crop APIs if the
codec driver doesn't support selection interfaces.

BUG=615857
TEST==Run VDA/VEA tests on elm.
      on Rowan for selection path
      on peach_pi for fallback crop path.
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2958213002
Cr-Commit-Position: refs/heads/master@{#489265}

[modify] https://crrev.com/92c29f34ff9ad157f94b6f1a8f67a795c9deb439/media/gpu/v4l2_video_decode_accelerator.cc
[modify] https://crrev.com/92c29f34ff9ad157f94b6f1a8f67a795c9deb439/media/gpu/v4l2_video_encode_accelerator.cc

Project Member

Comment 11 by bugdroid1@chromium.org, Jul 31 2017

Labels: merge-merged-chromeos-3.18
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/c3c7a2f350a8f7db53ad53c45715c4d9c27bf418

commit c3c7a2f350a8f7db53ad53c45715c4d9c27bf418
Author: Moja Hsu <mojahsu@chromium.org>
Date: Mon Jul 31 07:40:19 2017

CHROMIUM: mtk-mdp: use upstream mtk_mdp_m2m_s_selection()

The Crop/Compose behaviors are reversed in our implementation of
mtk_mdp_m2m_s_selection. We want to use the right way to use selection
API in user space. Use the upstream selection implementation and
provide mtk_mdp_m2m_s_crop for current user space to use. We will
remove mtk_mdp_m2m_s_crop after we use selection API in user space.

BUG=chromium:615857
TEST=Play video and run VDA unittest.

Change-Id: Ib4a30f85942fe681b34fdecd709216083f8dd486
Signed-off-by: Moja Hsu <mojahsu@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/566742
Commit-Ready: Hsu Wei-Cheng <mojahsu@chromium.org>
Tested-by: Hsu Wei-Cheng <mojahsu@chromium.org>
Reviewed-by: Wu-Cheng Li <wuchengli@chromium.org>

[modify] https://crrev.com/c3c7a2f350a8f7db53ad53c45715c4d9c27bf418/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c

Project Member

Comment 12 by bugdroid1@chromium.org, Aug 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/70334d03ab8f4af753dd66c335b5ca287e61c3bf

commit 70334d03ab8f4af753dd66c335b5ca287e61c3bf
Author: Wu-Cheng Li <wuchengli@chromium.org>
Date: Tue Aug 01 15:14:24 2017

Revert "CHROMIUM: mtk-mdp: use upstream mtk_mdp_m2m_s_selection()"

This reverts commit c3c7a2f350a8f7db53ad53c45715c4d9c27bf418.

Reason for revert: break VDA unittest on elm

BUG=chromium:751057
TEST=N/A

Original change's description:
> CHROMIUM: mtk-mdp: use upstream mtk_mdp_m2m_s_selection()
>
> The Crop/Compose behaviors are reversed in our implementation of
> mtk_mdp_m2m_s_selection. We want to use the right way to use selection
> API in user space. Use the upstream selection implementation and
> provide mtk_mdp_m2m_s_crop for current user space to use. We will
> remove mtk_mdp_m2m_s_crop after we use selection API in user space.
>
> BUG=chromium:615857
> TEST=Play video and run VDA unittest.
>
> Change-Id: Ib4a30f85942fe681b34fdecd709216083f8dd486
> Signed-off-by: Moja Hsu <mojahsu@chromium.org>
> Reviewed-on: https://chromium-review.googlesource.com/566742
> Commit-Ready: Hsu Wei-Cheng <mojahsu@chromium.org>
> Tested-by: Hsu Wei-Cheng <mojahsu@chromium.org>
> Reviewed-by: Wu-Cheng Li <wuchengli@chromium.org>

Bug: chromium:615857
Change-Id: I400b36952f898a257654a10a2e6165ebfd05cd3d
Reviewed-on: https://chromium-review.googlesource.com/595767
Commit-Ready: Wu-Cheng Li <wuchengli@chromium.org>
Tested-by: Wu-Cheng Li <wuchengli@chromium.org>
Reviewed-by: Wu-Cheng Li <wuchengli@chromium.org>

[modify] https://crrev.com/70334d03ab8f4af753dd66c335b5ca287e61c3bf/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c

Project Member

Comment 13 by bugdroid1@chromium.org, Aug 7 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/kernel/+/64e0ee203686bde0ea231ae913d048bc0df6ed6e

commit 64e0ee203686bde0ea231ae913d048bc0df6ed6e
Author: Moja Hsu <mojahsu@chromium.org>
Date: Mon Aug 07 20:50:46 2017

CHROMIUM: mtk-mdp: use upstream mtk_mdp_m2m_s_selection()

The Crop/Compose behaviors are reversed in our implementation of
mtk_mdp_m2m_s_selection. We want to use the right way to use
selection API in user space. Use the upstream selection implementation
and provide mtk_mdp_m2m_s_crop for current user space to use. We will
remove mtk_mdp_m2m_s_crop after we use selection API in user space.

BUG=chromium:615857
TEST=Play video and run VDA unittest.

Change-Id: I7fcb268009dde871dadad5da50159f1c64ac1927
Reviewed-on: https://chromium-review.googlesource.com/597547
Commit-Ready: Hsu Wei-Cheng <mojahsu@chromium.org>
Tested-by: Hsu Wei-Cheng <mojahsu@chromium.org>
Reviewed-by: Wu-Cheng Li <wuchengli@chromium.org>

[modify] https://crrev.com/64e0ee203686bde0ea231ae913d048bc0df6ed6e/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c

Project Member

Comment 14 by bugdroid1@chromium.org, Aug 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1bcbdbe7292b842776463402c1b5e6db83bafb77

commit 1bcbdbe7292b842776463402c1b5e6db83bafb77
Author: mojahsu <mojahsu@chromium.org>
Date: Mon Aug 14 09:01:29 2017

V4L2ImageProcessor: Use VIDIOC_S_SELECTION for buffer region control

Applications have to use the selection API to work with v4l2 mem2mem
devices.
The old crop ioctls are not suitable for such hardware.
For backward compatibility we may fallback to use old crop APIs if the
codec driver doesn't support selection interfaces.

BUG=615857
TEST=Run VDA tests and play video on elm with fixed kernel driver
     for selection path.
     Run VEA tests and play video on peach_pi for fallback path.
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2980793002
Cr-Commit-Position: refs/heads/master@{#494022}

[modify] https://crrev.com/1bcbdbe7292b842776463402c1b5e6db83bafb77/media/gpu/v4l2_image_processor.cc

Sign in to add a comment