New issue
Advanced search Search tips

Issue 819930 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 3
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Report supported VPx profiles from V4L2 drivers and query/expose that in Chrome clients

Project Member Reported by posciak@chromium.org, Mar 8 2018

Issue description

To report supported profiles for VPx, a V4L2 driver should expose the V4L2_CID_MPEG_VIDEO_VPX_PROFILE	control, and the client should check the supported value range for it via VIDIOC_QUERYCTRL/VIDIOC_QUERY_EXT_CTRL to determine supported profiles.

We should:
1) Add support for this control in existing V4L2 drivers.
2) Add querying of the control at enumeration time in Chrome V4L2 classes to report exact profiles (V4L2Device::EnumerateSupportedDecodeProfiles() and V4L2Device::EnumerateSupportedEncodeProfiles()).
 

Comment 1 by tfiga@chromium.org, Apr 11 2018

Cc: keiichiw@chromium.org

Comment 2 by tfiga@chromium.org, Apr 11 2018

Cc: -keiichiw@chromium.org
Labels: OS-Chrome
Owner: keiichiw@chromium.org
Status: Assigned (was: Available)
Keiichi, would you be able to take a look at this?

Some more information:

 1) Pawel, does this actually apply to VP8 too? I don't see any notion of profiles in VP8.

 2) For VP9, following hardware platforms using V4L2 (as per go/crosvideocodec) are capable of decoding it:
 - Rockchip 3399 (RK3399, rockchip-vpu driver), e.g. kevin, scarlet (dru),
 - MediaTek 8173 (MTK8173, mtk-vcodec driver), e.g. elm, hana,
 - Kepler (go2001 driver), e.g. guado, buddy, rikku

 3) I know that RK3399 supports only profile 0, but not sure about other platforms.
Tomasz, thank you for assigning me this issue.
I will work on this.
MT8173 only supports VP9 profile 0.
Status: Started (was: Assigned)
My patch set adding a new control for VP9 profile was merged into linux-tv's media_tree [1].
However, backporting process would be a little bit complicated since the value assigned to the new control's ID is already used by another Chrome-specific control.
To be specific, (V4L2_CID_MPEG_BASE+511) will be assigned to a new control V4L2_CID_MPEG_VIDEO_VP9_PROFILE in upstream, but it is already used by V4L2_CID_MPEG_VIDEO_VP8_FRAME_HDR, which is a ChromeOS-specific control.

Though we want to shift IDs of ChromeOS-specific controls, simply shifting the existing controls' IDs in linux-header does not work because we cannot land the kernel change at the same time as the new Chrome build.
So, we need to make Chrome work on ChromeOS before/after shifting control IDs at first.

After discussion with Tomasz, I decided to work by the following process:
1) Add a hack to make Chrome work before/after the ID change [2]
2) Wait for ChromeOS to start using Chrome with 1's hack
3) Add patches to kernel and chromiumos-overlay to shift Chrome-specific controls' IDs [3][4]
4) Revert the 1's hack
5) Backport my patch set from media_tree [1]
6) Add a patch to Chrome to use the new control for VP9 profile [5]

[1] https://git.linuxtv.org/media_tree.git/commit/?id=2a75364d09b05f257f4cd1f718e06e0247eb1dd3 and other 2 commits
[2] crrev.com/c/1134933
[3] crrev.com/c/1134929
[4] crrev.com/c/1134934
[5] crrev.com/c/1013765
For Step 3), I need to update not only kernel v4.4 but also other versions of kernel.
The following CLs are for Step 3
- crrev.com/c/1134934 linux-headers
- crrev.com/c/1136336 v3.14
- crrev.com/c/1136265 v3.18
- crrev.com/c/1134929 v4.4


Project Member

Comment 8 by bugdroid1@chromium.org, Jul 30

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

commit 3227909e07851ed10bacda4e31f8054f616a47e1
Author: Keiichi Watanabe <keiichiw@chromium.org>
Date: Mon Jul 30 06:04:21 2018

V4L2SVDA: Add hack for shifting ChromeOS-specific control IDs

This patch makes Chrome work before/after https://crrev.com/c/1134934
(for chromiumos-overlay), https://crrev.com/c/1136336 (for v3.14) and
http://crrev.com/c/1134929 (for v4.4) are merged, which change
ChromeOS-specific controls' IDs to avoid cofliction with upstream.

By calling QUERY_CTRL for new IDs, Chrome can detect whether the CLs are
already merged at run-time. If they are not merged yet, Chrome will use old
control IDs instead.

This patch is needed because we cannot land the kernel change at the
same time as new Chrome build. After new ChromeOS build contains these CLs,
this patch should be reverted.

Bug:  819930 
Test: Play VP8/VP9 video on veyron_jerry w/o CL:1134934 and CL:1136336
Test: Play VP8/VP9 video on veyron_jerry w/  CL:1134934 and CL:1136336
Test: Play VP8/VP9 video on kevin w/o CL:1134934 and CL:1134929
Test: Play VP8/VP9 video on kevin w/  CL:1134934 and CL:1134929

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;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I293464d85c4ca28fd3413b89e77e242c0a7648c0
Reviewed-on: https://chromium-review.googlesource.com/1134933
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578981}
[modify] https://crrev.com/3227909e07851ed10bacda4e31f8054f616a47e1/media/gpu/v4l2/v4l2_slice_video_decode_accelerator.cc
[modify] https://crrev.com/3227909e07851ed10bacda4e31f8054f616a47e1/media/gpu/v4l2/v4l2_slice_video_decode_accelerator.h

Project Member

Comment 9 by bugdroid1@chromium.org, Aug 15

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/6f7c4a370348f8b779803e6f34b61357c0f4374a

commit 6f7c4a370348f8b779803e6f34b61357c0f4374a
Author: Keiichi Watanabe <keiichiw@chromium.org>
Date: Wed Aug 15 11:42:32 2018

linux-headers: Shift ChromeOS-specific control IDs for MPEG video

To backport a new control from upstream without conflict, we need to shift
control IDs that do not exist upstream.

To be specific, the value assigned to V4L2_CID_MPEG_VIDEO_VP8_FRAME_HDR in
downstream, V4L2_CID_MPEG_BASE+512, will be used for a new control in
upstream by the commit
https://git.linuxtv.org/media_tree.git/commit/?id=2a75364d09b05f257f4cd1f718e06e0247eb1dd3

BUG= chromium:819930 
TEST=emerge-kevin linux-headers
CQ-DEPEND=CL:1136336, CL:1136265, CL:1134929

Change-Id: Ifdab219b94ffe81ac6e9ca335d124d3b1fc0ab81
Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1134934
Reviewed-by: Tomasz Figa <tfiga@chromium.org>

[rename] https://crrev.com/6f7c4a370348f8b779803e6f34b61357c0f4374a/sys-kernel/linux-headers/linux-headers-4.4-r23.ebuild
[modify] https://crrev.com/6f7c4a370348f8b779803e6f34b61357c0f4374a/sys-kernel/linux-headers/files/0007-CHROMIUM-v4l-Add-VP9-low-level-decoder-API-controls.patch
[modify] https://crrev.com/6f7c4a370348f8b779803e6f34b61357c0f4374a/sys-kernel/linux-headers/files/0002-CHROMIUM-v4l-Add-VP8-low-level-decoder-API-controls.patch

Project Member

Comment 10 by bugdroid1@chromium.org, Aug 15

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

commit ee08f26588e400047798b2846f55dfa814c873bb
Author: Keiichi Watanabe <keiichiw@chromium.org>
Date: Wed Aug 15 11:42:29 2018

CHROMIUM: media: v4l2-ctrl: Shift ChromeOS-specific control ID for MPEG video

To backport a new control from upstream without conflict, we need to shift
a control ID that does not exist upstream.

To be specific, the value assigned to V4L2_CID_MPEG_VIDEO_VP8_FRAME_HDR in
downstream, V4L2_CID_MPEG_BASE+512, will be used for a new control
introduced by
commit: 2a75364d09b ("media: v4l2-ctrl: Add control for VP9 profile")
in http://git.linuxtv.org/media_tree.git

BUG= chromium:819930 
TEST=Play VP8/VP9 videos on veyron_jerry
CQ-DEPEND=CL:1134934

Change-Id: Ib616496eb248766a385f1351d366740ba3d3c682
Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1136336
Reviewed-by: Tomasz Figa <tfiga@chromium.org>

[modify] https://crrev.com/ee08f26588e400047798b2846f55dfa814c873bb/include/uapi/linux/v4l2-controls.h

Project Member

Comment 11 by bugdroid1@chromium.org, Aug 15

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

commit 3d0a4653ede1953c8b41b8ba1a953489188661cf
Author: Keiichi Watanabe <keiichiw@chromium.org>
Date: Wed Aug 15 11:42:32 2018

CHROMIUM: media: v4l2-ctrl: Shift ChromeOS-specific control IDs for MPEG video

To backport a new control from upstream without conflict, we need to shift
control ID that do not exist in upstream.

To be specific, the value assigned to V4L2_CID_MPEG_VIDEO_VP8_FRAME_HDR in
downstream, V4L2_CID_MPEG_BASE+512, will be used for a new control
introduced by
commit: 2a75364d09b ("media: v4l2-ctrl: Add control for VP9 profile")
in http://git.linuxtv.org/media_tree.git

BUG= chromium:819930 
TEST=Play VP8/VP9 videos on kevin
CQ-DEPEND=CL:1134934

Change-Id: I11e495a26e45474cff7d21fc3c6370dd0a8dec0c
Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1134929
Reviewed-by: Tomasz Figa <tfiga@chromium.org>

[modify] https://crrev.com/3d0a4653ede1953c8b41b8ba1a953489188661cf/include/uapi/linux/v4l2-controls.h

Project Member

Comment 12 by bugdroid1@chromium.org, Aug 17

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

commit f834508e64f66e6dfc34f58aa711efd0a1cbd1c9
Author: Keiichi Watanabe <keiichiw@chromium.org>
Date: Fri Aug 17 07:15:57 2018

Revert "V4L2SVDA: Add hack for shifting ChromeOS-specific control IDs"

This reverts commit 3227909e07851ed10bacda4e31f8054f616a47e1.

Reason for revert:
This commit is originally a hack that should be reverted after CL:1134934
and other 3 related CLs are merged. See chromium:819930 for details.

Original change's description:
> V4L2SVDA: Add hack for shifting ChromeOS-specific control IDs
>
> This patch makes Chrome work before/after https://crrev.com/c/1134934
> (for chromiumos-overlay), https://crrev.com/c/1136336 (for v3.14) and
> http://crrev.com/c/1134929 (for v4.4) are merged, which change
> ChromeOS-specific controls' IDs to avoid cofliction with upstream.
>
> By calling QUERY_CTRL for new IDs, Chrome can detect whether the CLs are
> already merged at run-time. If they are not merged yet, Chrome will use old
> control IDs instead.
>
> This patch is needed because we cannot land the kernel change at the
> same time as new Chrome build. After new ChromeOS build contains these CLs,
> this patch should be reverted.
>
> Bug:  819930 
> Test: Play VP8/VP9 video on veyron_jerry w/o CL:1134934 and CL:1136336
> Test: Play VP8/VP9 video on veyron_jerry w/  CL:1134934 and CL:1136336
> Test: Play VP8/VP9 video on kevin w/o CL:1134934 and CL:1134929
> Test: Play VP8/VP9 video on kevin w/  CL:1134934 and CL:1134929
>
> 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;luci.chromium.try:win_optional_gpu_tests_rel
> Change-Id: I293464d85c4ca28fd3413b89e77e242c0a7648c0
> Reviewed-on: https://chromium-review.googlesource.com/1134933
> Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
> Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
> Reviewed-by: Pawel Osciak <posciak@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#578981}

TEST=Play VP8/VP9 video on veyron_jerry
TEST=Play VP8/VP9 video on kevin

Bug:  819930 
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;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I108024ef0c0e78f18efb43fdc389659a19cd63d7
Reviewed-on: https://chromium-review.googlesource.com/1154772
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583982}
[modify] https://crrev.com/f834508e64f66e6dfc34f58aa711efd0a1cbd1c9/media/gpu/v4l2/v4l2_slice_video_decode_accelerator.cc
[modify] https://crrev.com/f834508e64f66e6dfc34f58aa711efd0a1cbd1c9/media/gpu/v4l2/v4l2_slice_video_decode_accelerator.h

Project Member

Comment 13 by bugdroid1@chromium.org, Aug 22

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

commit a8d0bd3bb2442f24c937ce930776016a01866935
Author: Keiichi Watanabe <keiichiw@chromium.org>
Date: Wed Aug 22 15:16:07 2018

CHROMIUM: media: rockchip-vpu: Support VP9 profile control

Add V4L2_CID_MPEG_VIDEO_VP9_PROFILE control in Rockchip decoder.

BUG= chromium:819930 
TEST=Play VP8/VP9 Profile 0 video from crosvideo on kevin

Change-Id: I8e8de0d55f98fc6a1b5cabdbd1335a4f212abe70
Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1013762
Reviewed-by: Tomasz Figa <tfiga@chromium.org>

[modify] https://crrev.com/a8d0bd3bb2442f24c937ce930776016a01866935/drivers/media/platform/rockchip-vpu/rockchip_vpu_dec.c
[modify] https://crrev.com/a8d0bd3bb2442f24c937ce930776016a01866935/drivers/media/platform/rockchip-vpu/rockchip_vpu.c

Project Member

Comment 14 by bugdroid1@chromium.org, Aug 22

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

commit 480e9717e1d859f8846f5e1865c1defd79561d30
Author: Keiichi Watanabe <keiichiw@chromium.org>
Date: Wed Aug 22 15:16:05 2018

BACKPORT: FROMGIT: media: v4l2-ctrl: Add control for VP9 profile

Add a new control V4L2_CID_MPEG_VIDEO_VP9_PROFILE for VP9 profiles. This
control allows selecting the desired profile for VP9 encoder and querying
for supported profiles by VP9 encoder/decoder.

Though this control is similar to V4L2_CID_MPEG_VIDEO_VP8_PROFILE, we need
to separate this control from it because supported profiles usually differ
between VP8 and VP9.

Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
(cherry picked from commit 2a75364d09b05f257f4cd1f718e06e0247eb1dd3 git://git.linuxtv.org/media_tree.git)

Conflicts:
	drivers/media/v4l2-core/v4l2-ctrls.c
	include/uapi/linux/v4l2-controls.h

In v4l2-controls.h, the value assigned to V4L2_CID_MPEG_VIDEO_VP9_PROFILE
in upstream (i.e. V4L2_CID_MPEG_BASE+512) is already used by another
control that is not uptreamed. So, I shifted the values assigned to
ChromeOS-specific controls.

BUG= chromium:819930 
TEST=compile

Change-Id: I7240db6966ab8d7c9b2e3aa3f2bbe6744ee05e37
Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1016220
Reviewed-by: Tomasz Figa <tfiga@chromium.org>

[modify] https://crrev.com/480e9717e1d859f8846f5e1865c1defd79561d30/include/uapi/linux/v4l2-controls.h
[modify] https://crrev.com/480e9717e1d859f8846f5e1865c1defd79561d30/drivers/media/v4l2-core/v4l2-ctrls.c

Project Member

Comment 15 by bugdroid1@chromium.org, Aug 22

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

commit 18636c83c25765efea0e9692bcec18693ee576be
Author: Keiichi Watanabe <keiichiw@chromium.org>
Date: Wed Aug 22 15:16:04 2018

BACKPORT: FROMGIT: media: v4l2-ctrl: Change control for VP8 profile to menu control

Add a menu control V4L2_CID_MPEG_VIDEO_VP8_PROFILE for VP8 profile and make
V4L2_CID_MPEG_VIDEO_VPX_PROFILE an alias of it. This new control is used to
select the desired profile for VP8 encoder and query for supported profiles
by VP8 encoder/decoder.

Though we have originally a control V4L2_CID_MPEG_VIDEO_VPX_PROFILE and its
name contains 'VPX', it works only for VP8 because supported profiles
usually differ between VP8 and VP9. In addition, this control cannot be
used for querying since it is not a menu control but an integer control,
which cannot return an arbitrary set of supported profiles.

The new control V4L2_CID_MPEG_VIDEO_VP8_PROFILE is a menu control as with
controls for other codec profiles. (e.g. H264)

In addition, this patch also fixes the use of
V4L2_CID_MPEG_VIDEO_VPX_PROFILE in drivers of Qualcomm's venus and
Samsung's s5p-mfc.

Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
(cherry picked from commit 5520b9467a39d5ec9ce9cd8a9ed01f826b817524 git://git.linuxtv.org/media_tree.git)

Conflicts:
	drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
        drivers/media/v4l2-core/v4l2-ctrls.c
	include/uapi/linux/v4l2-controls.h

BUG= chromium:819930 
TEST=compile

Change-Id: Ia77aeb0ca6b62e5ce53f303162357432ad8bc066
Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1132823
Reviewed-by: Tomasz Figa <tfiga@chromium.org>

[modify] https://crrev.com/18636c83c25765efea0e9692bcec18693ee576be/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
[modify] https://crrev.com/18636c83c25765efea0e9692bcec18693ee576be/include/uapi/linux/v4l2-controls.h
[modify] https://crrev.com/18636c83c25765efea0e9692bcec18693ee576be/drivers/media/v4l2-core/v4l2-ctrls.c

Project Member

Comment 16 by bugdroid1@chromium.org, Aug 23

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

commit 843465631ea2c79a36b35b28dbd36642dfdae7f0
Author: Keiichi Watanabe <keiichiw@chromium.org>
Date: Thu Aug 23 14:36:48 2018

BACKPORT: FROMGIT: media: v4l2-ctrl: Add control for VP9 profile

Add a new control V4L2_CID_MPEG_VIDEO_VP9_PROFILE for VP9 profiles. This
control allows selecting the desired profile for VP9 encoder and querying
for supported profiles by VP9 encoder/decoder.

Though this control is similar to V4L2_CID_MPEG_VIDEO_VP8_PROFILE, we need
to separate this control from it because supported profiles usually differ
between VP8 and VP9.

Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
(cherry picked from commit 2a75364d09b05f257f4cd1f718e06e0247eb1dd3 git://git.linuxtv.org/media_tree.git)

Conflicts:
	drivers/media/v4l2-core/v4l2-ctrls.c
	include/uapi/linux/v4l2-controls.h

Change the definition of V4L2_CID_MPEG_VIDEO_VP8_FRAME_HDR, which is not added
into upstream, from V4L2_CID_MPEG_BASE+512 to V4L2_CID_MPEG_BASE+513 since
V4L2_CID_MPEG_BASE+512 will be assigned to V4L2_CID_MPEG_VIDEO_VP9_PROFILE.

BUG= chromium:819930 
TEST=compile

Change-Id: Ia8cf5f80853029602f316ba2feeed9881e2cd759
Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1059228
Reviewed-by: Tomasz Figa <tfiga@chromium.org>

[modify] https://crrev.com/843465631ea2c79a36b35b28dbd36642dfdae7f0/include/uapi/linux/v4l2-controls.h
[modify] https://crrev.com/843465631ea2c79a36b35b28dbd36642dfdae7f0/drivers/media/v4l2-core/v4l2-ctrls.c

Project Member

Comment 17 by bugdroid1@chromium.org, Aug 23

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

commit e791c1ded285b6393ef791da8b8cba615ed528b7
Author: Keiichi Watanabe <keiichiw@chromium.org>
Date: Thu Aug 23 14:36:49 2018

FROMGIT: media: mtk-vcodec: Support VP9 profile in decoder

Add V4L2_CID_MPEG_VIDEO_VP9_PROFILE control in MediaTek decoder's
driver. MediaTek decoder only supports profile 0 for now.

Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
(cherry picked from commit d45c9dc0b8349d8005ed8f7bc82c4583f50dd357 git://git.linuxtv.org/media_tree.git)

BUG= chromium:819930 
TEST=Play VP8/VP9 video from crosvideo on hana
TEST=Confirm that SW decoder is selected for VP9.2 video on hana

Change-Id: I0b0318c30678d1553652a7d907b0d4a64f4aade8
Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1059229
Reviewed-by: Tomasz Figa <tfiga@chromium.org>

[modify] https://crrev.com/e791c1ded285b6393ef791da8b8cba615ed528b7/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c

Project Member

Comment 18 by bugdroid1@chromium.org, Aug 23

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

commit 1d347b3fc2590d4a76d70f54283921753c674d52
Author: Keiichi Watanabe <keiichiw@chromium.org>
Date: Thu Aug 23 14:36:46 2018

BACKPORT: FROMGIT: media: v4l2-ctrl: Change control for VP8 profile to menu control

Add a menu control V4L2_CID_MPEG_VIDEO_VP8_PROFILE for VP8 profile and make
V4L2_CID_MPEG_VIDEO_VPX_PROFILE an alias of it. This new control is used to
select the desired profile for VP8 encoder and query for supported profiles
by VP8 encoder/decoder.

Though we have originally a control V4L2_CID_MPEG_VIDEO_VPX_PROFILE and its
name contains 'VPX', it works only for VP8 because supported profiles
usually differ between VP8 and VP9. In addition, this control cannot be
used for querying since it is not a menu control but an integer control,
which cannot return an arbitrary set of supported profiles.

The new control V4L2_CID_MPEG_VIDEO_VP8_PROFILE is a menu control as with
controls for other codec profiles. (e.g. H264)

In addition, this patch also fixes the use of
V4L2_CID_MPEG_VIDEO_VPX_PROFILE in drivers of Qualcomm's venus and
Samsung's s5p-mfc.

Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
(cherry picked from commit 5520b9467a39d5ec9ce9cd8a9ed01f826b817524 git://git.linuxtv.org/media_tree.git)

Conflicts:
        drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
        drivers/media/v4l2-core/v4l2-ctrls.c
        include/uapi/linux/v4l2-controls.h

BUG= chromium:819930 
TEST=compile

Change-Id: I446924561c32e443edf7be85cf77f0ab1d7b7385
Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1132824
Reviewed-by: Tomasz Figa <tfiga@chromium.org>

[modify] https://crrev.com/1d347b3fc2590d4a76d70f54283921753c674d52/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
[modify] https://crrev.com/1d347b3fc2590d4a76d70f54283921753c674d52/include/uapi/linux/v4l2-controls.h
[modify] https://crrev.com/1d347b3fc2590d4a76d70f54283921753c674d52/drivers/media/v4l2-core/v4l2-ctrls.c

Project Member

Comment 19 by bugdroid1@chromium.org, Aug 24

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/1fb35b06d7f6e390686d7ae58a333822bbf13dea

commit 1fb35b06d7f6e390686d7ae58a333822bbf13dea
Author: Keiichi Watanabe <keiichiw@chromium.org>
Date: Fri Aug 24 00:42:55 2018

linux-headers: Add menu controls for VP8/VP9 profile

Add V4L2 controls header modifications to add a new menu controls
for VP8/VP9 profiles, V4L2_CID_MPEG_VIDEO_VP8_PROFILE and
V4L2_CID_MPEG_VIDEO_VP9_PROFILE.

BUG= chromium:819930 
TEST=emerge-kevin linux-headers

Change-Id: I1cafe7ae6cc3615be74ea65765358ae907990990
Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1018782
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>

[add] https://crrev.com/1fb35b06d7f6e390686d7ae58a333822bbf13dea/sys-kernel/linux-headers/files/0030-BACKPORT-FROMGIT-media-v4l2-ctrl-Change-control-for-.patch
[add] https://crrev.com/1fb35b06d7f6e390686d7ae58a333822bbf13dea/sys-kernel/linux-headers/files/0031-BACKPORT-FROMGIT-media-v4l2-ctrl-Add-control-for-VP9.patch
[rename] https://crrev.com/1fb35b06d7f6e390686d7ae58a333822bbf13dea/sys-kernel/linux-headers/linux-headers-4.4-r24.ebuild
[modify] https://crrev.com/1fb35b06d7f6e390686d7ae58a333822bbf13dea/sys-kernel/linux-headers/linux-headers-4.4.ebuild

Project Member

Comment 20 by bugdroid1@chromium.org, Sep 3

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

commit d7d754b52b87c1ceb3ed3ad456d41b98c6fd35a1
Author: Keiichi Watanabe <keiichiw@chromium.org>
Date: Mon Sep 03 06:56:00 2018

media/gpu/v4l2device: Add querying to report supported VP9 profile

Add querying to report supported profiles for VP9 at enumeration
time in Chrome V4L2 classes.

BUG= chromium:819930 
TEST=Play VP9 video from crosvideo on kevin
TEST=Confirm that HW decoder is not selected when trying to play VP9.2 video on kevin

Change-Id: If6ac5a83e95e727a8e0a2ea5af7dcea953d8cd00
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;luci.chromium.try:win_optional_gpu_tests_rel
Reviewed-on: https://chromium-review.googlesource.com/1013765
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#588341}
[modify] https://crrev.com/d7d754b52b87c1ceb3ed3ad456d41b98c6fd35a1/media/gpu/v4l2/v4l2_device.cc
[modify] https://crrev.com/d7d754b52b87c1ceb3ed3ad456d41b98c6fd35a1/media/gpu/v4l2/v4l2_device.h

Status: Fixed (was: Started)
Finally, all related changes are merged! I'll mark this issue 'Fixed'.
This last CL doesn't build on eve. 
../../media/gpu/v4l2/v4l2_device.cc:123:10: error: use of undeclared identifier 'V4L2_MPEG_VIDEO_VP9_PROFILE_0'
    case V4L2_MPEG_VIDEO_VP9_PROFILE_0:
         ^
../../media/gpu/v4l2/v4l2_device.cc:125:10: error: use of undeclared identifier 'V4L2_MPEG_VIDEO_VP9_PROFILE_1'
    case V4L2_MPEG_VIDEO_VP9_PROFILE_1:
         ^
../../media/gpu/v4l2/v4l2_device.cc:127:10: error: use of undeclared identifier 'V4L2_MPEG_VIDEO_VP9_PROFILE_2'
    case V4L2_MPEG_VIDEO_VP9_PROFILE_2:
         ^
../../media/gpu/v4l2/v4l2_device.cc:129:10: error: use of undeclared identifier 'V4L2_MPEG_VIDEO_VP9_PROFILE_3'
    case V4L2_MPEG_VIDEO_VP9_PROFILE_3:
         ^
../../media/gpu/v4l2/v4l2_device.cc:167:23: error: use of undeclared identifier 'V4L2_CID_MPEG_VIDEO_VP9_PROFILE'
      query_ctrl.id = V4L2_CID_MPEG_VIDEO_VP9_PROFILE;

Hmm, I added these controls by
https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/1018782 .
Could you please make sure if your chromiumos-overlay code are up to date?
Sorry for the noise. My Simple Chrome chroot was stale. Exiting and re-entering the chroot fixed it.

Sign in to add a comment