mbox series

[v4,00/15] Move HEVC stateless controls out of staging

Message ID 20220228140838.622021-1-benjamin.gaignard@collabora.com
Headers show
Series Move HEVC stateless controls out of staging | expand

Message

Benjamin Gaignard Feb. 28, 2022, 2:08 p.m. UTC
This series aims to make HEVC uapi stable and usable for hardware
decoder. HEVC uapi is used by 2 mainlined drivers (Cedrus and Hantro)
and 2 out of the tree drivers (rkvdec and RPI).

After the remarks done on version 2, I have completely reworked to patches 
split so changelogs are meaningless. I have also drop "RFC" from the
titles.

Version 4:
- Add num_entry_point_offsets field in  struct v4l2_ctrl_hevc_slice_params
- Fix V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS name
- Initialize control V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS
- Fix space/tab issue in kernel-doc
- Add patch to change data_bit_offset definition
- Fix hantro-media SPDX license
- put controls under stateless section in v4l2-ctrls-defs.c

At the end fluster tests results on IMX8MQ is 77/147 for HEVC codec.

Benjamin


Benjamin Gaignard (12):
  media: uapi: HEVC: Add missing fields in HEVC controls
  media: uapi: HEVC: Rename HEVC stateless controls with STATELESS
    prefix
  media: uapi: HEVC: Add document uAPI structure
  media: uapi: HEVC: Define V4L2_CID_STATELESS_HEVC_SLICE_PARAMS as a
    dynamic array
  media: uapi: Move parsed HEVC pixel format out of staging
  media: uapi: Add V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS control
  media: uapi: Move the HEVC stateless control type out of staging
  media: controls: Log HEVC stateless control in .std_log
  media: uapi: Create a dedicated header for Hantro control
  media: uapi: HEVC: fix padding in v4l2 control structures
  media: uapi: Change data_bit_offset definition
  media: uapi: move HEVC stateless controls out of staging

Hans Verkuil (3):
  videodev2.h: add V4L2_CTRL_FLAG_DYNAMIC_ARRAY
  v4l2-ctrls: add support for dynamically allocated arrays.
  vivid: add dynamic array test control

 .../userspace-api/media/drivers/hantro.rst    |   5 -
 .../media/v4l/ext-ctrls-codec-stateless.rst   | 833 ++++++++++++++++++
 .../media/v4l/ext-ctrls-codec.rst             | 780 ----------------
 .../media/v4l/pixfmt-compressed.rst           |   7 +-
 .../media/v4l/vidioc-g-ext-ctrls.rst          |  20 +
 .../media/v4l/vidioc-queryctrl.rst            |   8 +
 .../media/videodev2.h.rst.exceptions          |   5 +
 .../media/test-drivers/vivid/vivid-ctrls.c    |  15 +
 drivers/media/v4l2-core/v4l2-ctrls-api.c      | 103 ++-
 drivers/media/v4l2-core/v4l2-ctrls-core.c     | 198 ++++-
 drivers/media/v4l2-core/v4l2-ctrls-defs.c     |  37 +-
 drivers/media/v4l2-core/v4l2-ctrls-priv.h     |   3 +-
 drivers/media/v4l2-core/v4l2-ctrls-request.c  |  13 +-
 drivers/staging/media/hantro/hantro_drv.c     |  27 +-
 drivers/staging/media/hantro/hantro_hevc.c    |   8 +-
 drivers/staging/media/sunxi/cedrus/cedrus.c   |  24 +-
 .../staging/media/sunxi/cedrus/cedrus_dec.c   |  10 +-
 .../staging/media/sunxi/cedrus/cedrus_h265.c  |   2 +-
 include/media/hevc-ctrls.h                    | 250 ------
 include/media/v4l2-ctrls.h                    |  48 +-
 include/uapi/linux/hantro-media.h             |  19 +
 include/uapi/linux/v4l2-controls.h            | 439 +++++++++
 include/uapi/linux/videodev2.h                |  13 +
 23 files changed, 1697 insertions(+), 1170 deletions(-)
 delete mode 100644 include/media/hevc-ctrls.h
 create mode 100644 include/uapi/linux/hantro-media.h

Comments

Benjamin Gaignard March 30, 2022, 7:09 a.m. UTC | #1
Le 28/02/2022 à 15:08, Benjamin Gaignard a écrit :
> This series aims to make HEVC uapi stable and usable for hardware
> decoder. HEVC uapi is used by 2 mainlined drivers (Cedrus and Hantro)
> and 2 out of the tree drivers (rkvdec and RPI).
>
> After the remarks done on version 2, I have completely reworked to patches
> split so changelogs are meaningless. I have also drop "RFC" from the
> titles.
>
> Version 4:
> - Add num_entry_point_offsets field in  struct v4l2_ctrl_hevc_slice_params
> - Fix V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS name
> - Initialize control V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS
> - Fix space/tab issue in kernel-doc
> - Add patch to change data_bit_offset definition
> - Fix hantro-media SPDX license
> - put controls under stateless section in v4l2-ctrls-defs.c
>
> At the end fluster tests results on IMX8MQ is 77/147 for HEVC codec.

Dear reviewers,

This series is waiting for your feedback,

Thanks,
Benjamin

>
> Benjamin
>
>
> Benjamin Gaignard (12):
>    media: uapi: HEVC: Add missing fields in HEVC controls
>    media: uapi: HEVC: Rename HEVC stateless controls with STATELESS
>      prefix
>    media: uapi: HEVC: Add document uAPI structure
>    media: uapi: HEVC: Define V4L2_CID_STATELESS_HEVC_SLICE_PARAMS as a
>      dynamic array
>    media: uapi: Move parsed HEVC pixel format out of staging
>    media: uapi: Add V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS control
>    media: uapi: Move the HEVC stateless control type out of staging
>    media: controls: Log HEVC stateless control in .std_log
>    media: uapi: Create a dedicated header for Hantro control
>    media: uapi: HEVC: fix padding in v4l2 control structures
>    media: uapi: Change data_bit_offset definition
>    media: uapi: move HEVC stateless controls out of staging
>
> Hans Verkuil (3):
>    videodev2.h: add V4L2_CTRL_FLAG_DYNAMIC_ARRAY
>    v4l2-ctrls: add support for dynamically allocated arrays.
>    vivid: add dynamic array test control
>
>   .../userspace-api/media/drivers/hantro.rst    |   5 -
>   .../media/v4l/ext-ctrls-codec-stateless.rst   | 833 ++++++++++++++++++
>   .../media/v4l/ext-ctrls-codec.rst             | 780 ----------------
>   .../media/v4l/pixfmt-compressed.rst           |   7 +-
>   .../media/v4l/vidioc-g-ext-ctrls.rst          |  20 +
>   .../media/v4l/vidioc-queryctrl.rst            |   8 +
>   .../media/videodev2.h.rst.exceptions          |   5 +
>   .../media/test-drivers/vivid/vivid-ctrls.c    |  15 +
>   drivers/media/v4l2-core/v4l2-ctrls-api.c      | 103 ++-
>   drivers/media/v4l2-core/v4l2-ctrls-core.c     | 198 ++++-
>   drivers/media/v4l2-core/v4l2-ctrls-defs.c     |  37 +-
>   drivers/media/v4l2-core/v4l2-ctrls-priv.h     |   3 +-
>   drivers/media/v4l2-core/v4l2-ctrls-request.c  |  13 +-
>   drivers/staging/media/hantro/hantro_drv.c     |  27 +-
>   drivers/staging/media/hantro/hantro_hevc.c    |   8 +-
>   drivers/staging/media/sunxi/cedrus/cedrus.c   |  24 +-
>   .../staging/media/sunxi/cedrus/cedrus_dec.c   |  10 +-
>   .../staging/media/sunxi/cedrus/cedrus_h265.c  |   2 +-
>   include/media/hevc-ctrls.h                    | 250 ------
>   include/media/v4l2-ctrls.h                    |  48 +-
>   include/uapi/linux/hantro-media.h             |  19 +
>   include/uapi/linux/v4l2-controls.h            | 439 +++++++++
>   include/uapi/linux/videodev2.h                |  13 +
>   23 files changed, 1697 insertions(+), 1170 deletions(-)
>   delete mode 100644 include/media/hevc-ctrls.h
>   create mode 100644 include/uapi/linux/hantro-media.h
>
Adam Ford March 30, 2022, 6:52 p.m. UTC | #2
On Wed, Mar 30, 2022 at 2:53 AM Benjamin Gaignard
<benjamin.gaignard@collabora.com> wrote:
>
>
> Le 28/02/2022 à 15:08, Benjamin Gaignard a écrit :
> > This series aims to make HEVC uapi stable and usable for hardware
> > decoder. HEVC uapi is used by 2 mainlined drivers (Cedrus and Hantro)
> > and 2 out of the tree drivers (rkvdec and RPI).
> >
> > After the remarks done on version 2, I have completely reworked to patches
> > split so changelogs are meaningless. I have also drop "RFC" from the
> > titles.
> >
> > Version 4:
> > - Add num_entry_point_offsets field in  struct v4l2_ctrl_hevc_slice_params
> > - Fix V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS name
> > - Initialize control V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS
> > - Fix space/tab issue in kernel-doc
> > - Add patch to change data_bit_offset definition
> > - Fix hantro-media SPDX license
> > - put controls under stateless section in v4l2-ctrls-defs.c
> >
> > At the end fluster tests results on IMX8MQ is 77/147 for HEVC codec.
>
> Dear reviewers,
>
> This series is waiting for your feedback,

I tried several times with the suggested repos for both the kernel and
g-streamer without success getting Fluster to pass any tests on the
imx8mq.  I can try again but I likely won't get to it until this
weekend.  If I can get it working, I'll test both the 8mq and 8mm.

adam
>
> Thanks,
> Benjamin
>
> >
> > Benjamin
> >
> >
> > Benjamin Gaignard (12):
> >    media: uapi: HEVC: Add missing fields in HEVC controls
> >    media: uapi: HEVC: Rename HEVC stateless controls with STATELESS
> >      prefix
> >    media: uapi: HEVC: Add document uAPI structure
> >    media: uapi: HEVC: Define V4L2_CID_STATELESS_HEVC_SLICE_PARAMS as a
> >      dynamic array
> >    media: uapi: Move parsed HEVC pixel format out of staging
> >    media: uapi: Add V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS control
> >    media: uapi: Move the HEVC stateless control type out of staging
> >    media: controls: Log HEVC stateless control in .std_log
> >    media: uapi: Create a dedicated header for Hantro control
> >    media: uapi: HEVC: fix padding in v4l2 control structures
> >    media: uapi: Change data_bit_offset definition
> >    media: uapi: move HEVC stateless controls out of staging
> >
> > Hans Verkuil (3):
> >    videodev2.h: add V4L2_CTRL_FLAG_DYNAMIC_ARRAY
> >    v4l2-ctrls: add support for dynamically allocated arrays.
> >    vivid: add dynamic array test control
> >
> >   .../userspace-api/media/drivers/hantro.rst    |   5 -
> >   .../media/v4l/ext-ctrls-codec-stateless.rst   | 833 ++++++++++++++++++
> >   .../media/v4l/ext-ctrls-codec.rst             | 780 ----------------
> >   .../media/v4l/pixfmt-compressed.rst           |   7 +-
> >   .../media/v4l/vidioc-g-ext-ctrls.rst          |  20 +
> >   .../media/v4l/vidioc-queryctrl.rst            |   8 +
> >   .../media/videodev2.h.rst.exceptions          |   5 +
> >   .../media/test-drivers/vivid/vivid-ctrls.c    |  15 +
> >   drivers/media/v4l2-core/v4l2-ctrls-api.c      | 103 ++-
> >   drivers/media/v4l2-core/v4l2-ctrls-core.c     | 198 ++++-
> >   drivers/media/v4l2-core/v4l2-ctrls-defs.c     |  37 +-
> >   drivers/media/v4l2-core/v4l2-ctrls-priv.h     |   3 +-
> >   drivers/media/v4l2-core/v4l2-ctrls-request.c  |  13 +-
> >   drivers/staging/media/hantro/hantro_drv.c     |  27 +-
> >   drivers/staging/media/hantro/hantro_hevc.c    |   8 +-
> >   drivers/staging/media/sunxi/cedrus/cedrus.c   |  24 +-
> >   .../staging/media/sunxi/cedrus/cedrus_dec.c   |  10 +-
> >   .../staging/media/sunxi/cedrus/cedrus_h265.c  |   2 +-
> >   include/media/hevc-ctrls.h                    | 250 ------
> >   include/media/v4l2-ctrls.h                    |  48 +-
> >   include/uapi/linux/hantro-media.h             |  19 +
> >   include/uapi/linux/v4l2-controls.h            | 439 +++++++++
> >   include/uapi/linux/videodev2.h                |  13 +
> >   23 files changed, 1697 insertions(+), 1170 deletions(-)
> >   delete mode 100644 include/media/hevc-ctrls.h
> >   create mode 100644 include/uapi/linux/hantro-media.h
> >
Benjamin Gaignard April 1, 2022, 1:18 p.m. UTC | #3
Le 31/03/2022 à 08:53, Benjamin Gaignard a écrit :
>
> Le 30/03/2022 à 20:52, Adam Ford a écrit :
>> On Wed, Mar 30, 2022 at 2:53 AM Benjamin Gaignard
>> <benjamin.gaignard@collabora.com> wrote:
>>>
>>> Le 28/02/2022 à 15:08, Benjamin Gaignard a écrit :
>>>> This series aims to make HEVC uapi stable and usable for hardware
>>>> decoder. HEVC uapi is used by 2 mainlined drivers (Cedrus and Hantro)
>>>> and 2 out of the tree drivers (rkvdec and RPI).
>>>>
>>>> After the remarks done on version 2, I have completely reworked to 
>>>> patches
>>>> split so changelogs are meaningless. I have also drop "RFC" from the
>>>> titles.
>>>>
>>>> Version 4:
>>>> - Add num_entry_point_offsets field in  struct 
>>>> v4l2_ctrl_hevc_slice_params
>>>> - Fix V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS name
>>>> - Initialize control V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS
>>>> - Fix space/tab issue in kernel-doc
>>>> - Add patch to change data_bit_offset definition
>>>> - Fix hantro-media SPDX license
>>>> - put controls under stateless section in v4l2-ctrls-defs.c
>>>>
>>>> At the end fluster tests results on IMX8MQ is 77/147 for HEVC codec.
>>> Dear reviewers,
>>>
>>> This series is waiting for your feedback,
>> I tried several times with the suggested repos for both the kernel and
>> g-streamer without success getting Fluster to pass any tests on the
>> imx8mq.  I can try again but I likely won't get to it until this
>> weekend.  If I can get it working, I'll test both the 8mq and 8mm.
>
> Thanks a lot for that.
>
> Benjamin

Adam,

You may need to check if h265parse and v4l2slh265dec are available on your board.

fluster check if v4l2slh265dec is working fine with this command line:

gst-launch-1.0 appsrc num-buffers=0 ! h265parse ! v4l2slh265dec ! fakesink

so if one of them is missing it won't work.

Regards,
Benjamin

>
>>
>> adam
>>> Thanks,
>>> Benjamin
>>>
>>>> Benjamin
>>>>
>>>>
>>>> Benjamin Gaignard (12):
>>>>     media: uapi: HEVC: Add missing fields in HEVC controls
>>>>     media: uapi: HEVC: Rename HEVC stateless controls with STATELESS
>>>>       prefix
>>>>     media: uapi: HEVC: Add document uAPI structure
>>>>     media: uapi: HEVC: Define V4L2_CID_STATELESS_HEVC_SLICE_PARAMS 
>>>> as a
>>>>       dynamic array
>>>>     media: uapi: Move parsed HEVC pixel format out of staging
>>>>     media: uapi: Add V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS 
>>>> control
>>>>     media: uapi: Move the HEVC stateless control type out of staging
>>>>     media: controls: Log HEVC stateless control in .std_log
>>>>     media: uapi: Create a dedicated header for Hantro control
>>>>     media: uapi: HEVC: fix padding in v4l2 control structures
>>>>     media: uapi: Change data_bit_offset definition
>>>>     media: uapi: move HEVC stateless controls out of staging
>>>>
>>>> Hans Verkuil (3):
>>>>     videodev2.h: add V4L2_CTRL_FLAG_DYNAMIC_ARRAY
>>>>     v4l2-ctrls: add support for dynamically allocated arrays.
>>>>     vivid: add dynamic array test control
>>>>
>>>>    .../userspace-api/media/drivers/hantro.rst    |   5 -
>>>>    .../media/v4l/ext-ctrls-codec-stateless.rst   | 833 
>>>> ++++++++++++++++++
>>>>    .../media/v4l/ext-ctrls-codec.rst             | 780 
>>>> ----------------
>>>>    .../media/v4l/pixfmt-compressed.rst           |   7 +-
>>>>    .../media/v4l/vidioc-g-ext-ctrls.rst          |  20 +
>>>>    .../media/v4l/vidioc-queryctrl.rst            |   8 +
>>>>    .../media/videodev2.h.rst.exceptions          |   5 +
>>>>    .../media/test-drivers/vivid/vivid-ctrls.c    |  15 +
>>>>    drivers/media/v4l2-core/v4l2-ctrls-api.c      | 103 ++-
>>>>    drivers/media/v4l2-core/v4l2-ctrls-core.c     | 198 ++++-
>>>>    drivers/media/v4l2-core/v4l2-ctrls-defs.c     |  37 +-
>>>>    drivers/media/v4l2-core/v4l2-ctrls-priv.h     |   3 +-
>>>>    drivers/media/v4l2-core/v4l2-ctrls-request.c  |  13 +-
>>>>    drivers/staging/media/hantro/hantro_drv.c     |  27 +-
>>>>    drivers/staging/media/hantro/hantro_hevc.c    |   8 +-
>>>>    drivers/staging/media/sunxi/cedrus/cedrus.c   |  24 +-
>>>>    .../staging/media/sunxi/cedrus/cedrus_dec.c   |  10 +-
>>>>    .../staging/media/sunxi/cedrus/cedrus_h265.c  |   2 +-
>>>>    include/media/hevc-ctrls.h                    | 250 ------
>>>>    include/media/v4l2-ctrls.h                    |  48 +-
>>>>    include/uapi/linux/hantro-media.h             |  19 +
>>>>    include/uapi/linux/v4l2-controls.h            | 439 +++++++++
>>>>    include/uapi/linux/videodev2.h                |  13 +
>>>>    23 files changed, 1697 insertions(+), 1170 deletions(-)
>>>>    delete mode 100644 include/media/hevc-ctrls.h
>>>>    create mode 100644 include/uapi/linux/hantro-media.h
>>>>
Adam Ford April 2, 2022, 4:59 p.m. UTC | #4
On Sat, Apr 2, 2022 at 11:22 AM Adam Ford <aford173@gmail.com> wrote:
>
> On Fri, Apr 1, 2022 at 8:18 AM Benjamin Gaignard
> <benjamin.gaignard@collabora.com> wrote:
> >
> >
> > Le 31/03/2022 à 08:53, Benjamin Gaignard a écrit :
> > >
> > > Le 30/03/2022 à 20:52, Adam Ford a écrit :
> > >> On Wed, Mar 30, 2022 at 2:53 AM Benjamin Gaignard
> > >> <benjamin.gaignard@collabora.com> wrote:
> > >>>
> > >>> Le 28/02/2022 à 15:08, Benjamin Gaignard a écrit :
> > >>>> This series aims to make HEVC uapi stable and usable for hardware
> > >>>> decoder. HEVC uapi is used by 2 mainlined drivers (Cedrus and Hantro)
> > >>>> and 2 out of the tree drivers (rkvdec and RPI).
> > >>>>
> > >>>> After the remarks done on version 2, I have completely reworked to
> > >>>> patches
> > >>>> split so changelogs are meaningless. I have also drop "RFC" from the
> > >>>> titles.
> > >>>>
> > >>>> Version 4:
> > >>>> - Add num_entry_point_offsets field in  struct
> > >>>> v4l2_ctrl_hevc_slice_params
> > >>>> - Fix V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS name
> > >>>> - Initialize control V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS
> > >>>> - Fix space/tab issue in kernel-doc
> > >>>> - Add patch to change data_bit_offset definition
> > >>>> - Fix hantro-media SPDX license
> > >>>> - put controls under stateless section in v4l2-ctrls-defs.c
> > >>>>
> > >>>> At the end fluster tests results on IMX8MQ is 77/147 for HEVC codec.
> > >>> Dear reviewers,
> > >>>
> > >>> This series is waiting for your feedback,
> > >> I tried several times with the suggested repos for both the kernel and
> > >> g-streamer without success getting Fluster to pass any tests on the
> > >> imx8mq.  I can try again but I likely won't get to it until this
> > >> weekend.  If I can get it working, I'll test both the 8mq and 8mm.
> > >
> > > Thanks a lot for that.
> > >
> > > Benjamin
> >
> > Adam,
> >
> > You may need to check if h265parse and v4l2slh265dec are available on your board.
>
> I ran gst-inspect to see what showed up with 265 in the name.
>
> # gst-inspect-1.0 |grep 265
> libav:  avdec_h265: libav HEVC (High Efficiency Video Coding) decoder
> rtp:  rtph265depay: RTP H265 depayloader
> rtp:  rtph265pay: RTP H265 payloader
> typefindfunctions: video/x-h265: h265, x265, 265
> v4l2codecs:  v4l2slh265dec: V4L2 Stateless H.265 Video Decoder
> videoparsersbad:  h265parse: H.265 parser
>
> It appears I have both h265parse and v4l2slh265dec.
>
> >
> > fluster check if v4l2slh265dec is working fine with this command line:
> >
> > gst-launch-1.0 appsrc num-buffers=0 ! h265parse ! v4l2slh265dec ! fakesink
> >
> > so if one of them is missing it won't work.
>
> gst-launch-1.0 appsrc num-buffers=0 ! h265parse ! v4l2slh265dec ! fakesink
> Setting pipeline to PAUSED ...
> 0:00:00.098389938   526 0xaaaaf9d86ac0 ERROR     v4l2codecs-decoder
> gstv4l2decoder.c:725:gst_v4l2_decoder_get_controls:<v4l2decoder2>
> VIDIOC_G_EXT_CTRLS failed: Invalid argument
> ERROR: from element
> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0: Driver did not
> report framing and start code method.
> Additional debug info:
> ../subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech265dec.c(155):
> gst_v4l2_codec_h265_dec_open ():
> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0:
> gst_v4l2_decoder_get_controls() failed: Invalid argument
> ERROR: pipeline doesn't want to preroll.
> ERROR: from element
> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0: Could not
> initialize supporting library.
> Additional debug info:
> ../subprojects/gst-plugins-base/gst-libs/gst/video/gstvideodecoder.c(2909):
> gst_video_decoder_change_state ():
> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0:
> Failed to open decoder
> ERROR: pipeline doesn't want to preroll.
> Failed to set pipeline to PAUSED.
> Setting pipeline to NULL ...
> Freeing pipeline ...
>
> Does this mean I have a wrong version of the kernel and/or incomplete patches?

I double checked the branches.

Kernel:
https://gitlab.collabora.com/benjamin.gaignard/for-upstream.git
branch:  origin/HEVC_UAPI_V4

Gstreamer:
https://gitlab.freedesktop.org/benjamin.gaignard1/gstreamer.git
branch:  origin/benjamin.gaignard1/gstreamer-HEVC_aligned_with_kernel_5.15


I am still not able to run h.265/HEVC tests.

adam
>
> adam
> >
> > Regards,
> > Benjamin
> >
> > >
> > >>
> > >> adam
> > >>> Thanks,
> > >>> Benjamin
> > >>>
> > >>>> Benjamin
> > >>>>
> > >>>>
> > >>>> Benjamin Gaignard (12):
> > >>>>     media: uapi: HEVC: Add missing fields in HEVC controls
> > >>>>     media: uapi: HEVC: Rename HEVC stateless controls with STATELESS
> > >>>>       prefix
> > >>>>     media: uapi: HEVC: Add document uAPI structure
> > >>>>     media: uapi: HEVC: Define V4L2_CID_STATELESS_HEVC_SLICE_PARAMS
> > >>>> as a
> > >>>>       dynamic array
> > >>>>     media: uapi: Move parsed HEVC pixel format out of staging
> > >>>>     media: uapi: Add V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS
> > >>>> control
> > >>>>     media: uapi: Move the HEVC stateless control type out of staging
> > >>>>     media: controls: Log HEVC stateless control in .std_log
> > >>>>     media: uapi: Create a dedicated header for Hantro control
> > >>>>     media: uapi: HEVC: fix padding in v4l2 control structures
> > >>>>     media: uapi: Change data_bit_offset definition
> > >>>>     media: uapi: move HEVC stateless controls out of staging
> > >>>>
> > >>>> Hans Verkuil (3):
> > >>>>     videodev2.h: add V4L2_CTRL_FLAG_DYNAMIC_ARRAY
> > >>>>     v4l2-ctrls: add support for dynamically allocated arrays.
> > >>>>     vivid: add dynamic array test control
> > >>>>
> > >>>>    .../userspace-api/media/drivers/hantro.rst    |   5 -
> > >>>>    .../media/v4l/ext-ctrls-codec-stateless.rst   | 833
> > >>>> ++++++++++++++++++
> > >>>>    .../media/v4l/ext-ctrls-codec.rst             | 780
> > >>>> ----------------
> > >>>>    .../media/v4l/pixfmt-compressed.rst           |   7 +-
> > >>>>    .../media/v4l/vidioc-g-ext-ctrls.rst          |  20 +
> > >>>>    .../media/v4l/vidioc-queryctrl.rst            |   8 +
> > >>>>    .../media/videodev2.h.rst.exceptions          |   5 +
> > >>>>    .../media/test-drivers/vivid/vivid-ctrls.c    |  15 +
> > >>>>    drivers/media/v4l2-core/v4l2-ctrls-api.c      | 103 ++-
> > >>>>    drivers/media/v4l2-core/v4l2-ctrls-core.c     | 198 ++++-
> > >>>>    drivers/media/v4l2-core/v4l2-ctrls-defs.c     |  37 +-
> > >>>>    drivers/media/v4l2-core/v4l2-ctrls-priv.h     |   3 +-
> > >>>>    drivers/media/v4l2-core/v4l2-ctrls-request.c  |  13 +-
> > >>>>    drivers/staging/media/hantro/hantro_drv.c     |  27 +-
> > >>>>    drivers/staging/media/hantro/hantro_hevc.c    |   8 +-
> > >>>>    drivers/staging/media/sunxi/cedrus/cedrus.c   |  24 +-
> > >>>>    .../staging/media/sunxi/cedrus/cedrus_dec.c   |  10 +-
> > >>>>    .../staging/media/sunxi/cedrus/cedrus_h265.c  |   2 +-
> > >>>>    include/media/hevc-ctrls.h                    | 250 ------
> > >>>>    include/media/v4l2-ctrls.h                    |  48 +-
> > >>>>    include/uapi/linux/hantro-media.h             |  19 +
> > >>>>    include/uapi/linux/v4l2-controls.h            | 439 +++++++++
> > >>>>    include/uapi/linux/videodev2.h                |  13 +
> > >>>>    23 files changed, 1697 insertions(+), 1170 deletions(-)
> > >>>>    delete mode 100644 include/media/hevc-ctrls.h
> > >>>>    create mode 100644 include/uapi/linux/hantro-media.h
> > >>>>
Benjamin Gaignard April 4, 2022, 3:56 p.m. UTC | #5
Le 02/04/2022 à 18:59, Adam Ford a écrit :
> On Sat, Apr 2, 2022 at 11:22 AM Adam Ford <aford173@gmail.com> wrote:
>> On Fri, Apr 1, 2022 at 8:18 AM Benjamin Gaignard
>> <benjamin.gaignard@collabora.com> wrote:
>>>
>>> Le 31/03/2022 à 08:53, Benjamin Gaignard a écrit :
>>>> Le 30/03/2022 à 20:52, Adam Ford a écrit :
>>>>> On Wed, Mar 30, 2022 at 2:53 AM Benjamin Gaignard
>>>>> <benjamin.gaignard@collabora.com> wrote:
>>>>>> Le 28/02/2022 à 15:08, Benjamin Gaignard a écrit :
>>>>>>> This series aims to make HEVC uapi stable and usable for hardware
>>>>>>> decoder. HEVC uapi is used by 2 mainlined drivers (Cedrus and Hantro)
>>>>>>> and 2 out of the tree drivers (rkvdec and RPI).
>>>>>>>
>>>>>>> After the remarks done on version 2, I have completely reworked to
>>>>>>> patches
>>>>>>> split so changelogs are meaningless. I have also drop "RFC" from the
>>>>>>> titles.
>>>>>>>
>>>>>>> Version 4:
>>>>>>> - Add num_entry_point_offsets field in  struct
>>>>>>> v4l2_ctrl_hevc_slice_params
>>>>>>> - Fix V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS name
>>>>>>> - Initialize control V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS
>>>>>>> - Fix space/tab issue in kernel-doc
>>>>>>> - Add patch to change data_bit_offset definition
>>>>>>> - Fix hantro-media SPDX license
>>>>>>> - put controls under stateless section in v4l2-ctrls-defs.c
>>>>>>>
>>>>>>> At the end fluster tests results on IMX8MQ is 77/147 for HEVC codec.
>>>>>> Dear reviewers,
>>>>>>
>>>>>> This series is waiting for your feedback,
>>>>> I tried several times with the suggested repos for both the kernel and
>>>>> g-streamer without success getting Fluster to pass any tests on the
>>>>> imx8mq.  I can try again but I likely won't get to it until this
>>>>> weekend.  If I can get it working, I'll test both the 8mq and 8mm.
>>>> Thanks a lot for that.
>>>>
>>>> Benjamin
>>> Adam,
>>>
>>> You may need to check if h265parse and v4l2slh265dec are available on your board.
>> I ran gst-inspect to see what showed up with 265 in the name.
>>
>> # gst-inspect-1.0 |grep 265
>> libav:  avdec_h265: libav HEVC (High Efficiency Video Coding) decoder
>> rtp:  rtph265depay: RTP H265 depayloader
>> rtp:  rtph265pay: RTP H265 payloader
>> typefindfunctions: video/x-h265: h265, x265, 265
>> v4l2codecs:  v4l2slh265dec: V4L2 Stateless H.265 Video Decoder
>> videoparsersbad:  h265parse: H.265 parser
>>
>> It appears I have both h265parse and v4l2slh265dec.
>>
>>> fluster check if v4l2slh265dec is working fine with this command line:
>>>
>>> gst-launch-1.0 appsrc num-buffers=0 ! h265parse ! v4l2slh265dec ! fakesink
>>>
>>> so if one of them is missing it won't work.
>> gst-launch-1.0 appsrc num-buffers=0 ! h265parse ! v4l2slh265dec ! fakesink
>> Setting pipeline to PAUSED ...
>> 0:00:00.098389938   526 0xaaaaf9d86ac0 ERROR     v4l2codecs-decoder
>> gstv4l2decoder.c:725:gst_v4l2_decoder_get_controls:<v4l2decoder2>
>> VIDIOC_G_EXT_CTRLS failed: Invalid argument
>> ERROR: from element
>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0: Driver did not
>> report framing and start code method.
>> Additional debug info:
>> ../subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech265dec.c(155):
>> gst_v4l2_codec_h265_dec_open ():
>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0:
>> gst_v4l2_decoder_get_controls() failed: Invalid argument
>> ERROR: pipeline doesn't want to preroll.
>> ERROR: from element
>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0: Could not
>> initialize supporting library.
>> Additional debug info:
>> ../subprojects/gst-plugins-base/gst-libs/gst/video/gstvideodecoder.c(2909):
>> gst_video_decoder_change_state ():
>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0:
>> Failed to open decoder
>> ERROR: pipeline doesn't want to preroll.
>> Failed to set pipeline to PAUSED.
>> Setting pipeline to NULL ...
>> Freeing pipeline ...
>>
>> Does this mean I have a wrong version of the kernel and/or incomplete patches?
> I double checked the branches.
>
> Kernel:
> https://gitlab.collabora.com/benjamin.gaignard/for-upstream.git
> branch:  origin/HEVC_UAPI_V4
>
> Gstreamer:
> https://gitlab.freedesktop.org/benjamin.gaignard1/gstreamer.git
> branch:  origin/benjamin.gaignard1/gstreamer-HEVC_aligned_with_kernel_5.15
>
>
> I am still not able to run h.265/HEVC tests.

Hello Adam,

I have updated the following branches with the versions I have used today:

Kernel:
https://gitlab.collabora.com/benjamin.gaignard/for-upstream.git
branch: origin/HEVC_UAPI_V5 only one change in documentation vs version 4 but rebased in v5.18-rc1

Gstreamer:
https://gitlab.freedesktop.org/benjamin.gaignard1/gstreamer.git
branch:  origin/benjamin.gaignard1/gstreamer-HEVC_aligned_with_kernel_5.15 updated on the latest GST main branch

I hope this will work fine this time.

Benjamin

>
> adam
>> adam
>>> Regards,
>>> Benjamin
>>>
>>>>> adam
>>>>>> Thanks,
>>>>>> Benjamin
>>>>>>
>>>>>>> Benjamin
>>>>>>>
>>>>>>>
>>>>>>> Benjamin Gaignard (12):
>>>>>>>      media: uapi: HEVC: Add missing fields in HEVC controls
>>>>>>>      media: uapi: HEVC: Rename HEVC stateless controls with STATELESS
>>>>>>>        prefix
>>>>>>>      media: uapi: HEVC: Add document uAPI structure
>>>>>>>      media: uapi: HEVC: Define V4L2_CID_STATELESS_HEVC_SLICE_PARAMS
>>>>>>> as a
>>>>>>>        dynamic array
>>>>>>>      media: uapi: Move parsed HEVC pixel format out of staging
>>>>>>>      media: uapi: Add V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS
>>>>>>> control
>>>>>>>      media: uapi: Move the HEVC stateless control type out of staging
>>>>>>>      media: controls: Log HEVC stateless control in .std_log
>>>>>>>      media: uapi: Create a dedicated header for Hantro control
>>>>>>>      media: uapi: HEVC: fix padding in v4l2 control structures
>>>>>>>      media: uapi: Change data_bit_offset definition
>>>>>>>      media: uapi: move HEVC stateless controls out of staging
>>>>>>>
>>>>>>> Hans Verkuil (3):
>>>>>>>      videodev2.h: add V4L2_CTRL_FLAG_DYNAMIC_ARRAY
>>>>>>>      v4l2-ctrls: add support for dynamically allocated arrays.
>>>>>>>      vivid: add dynamic array test control
>>>>>>>
>>>>>>>     .../userspace-api/media/drivers/hantro.rst    |   5 -
>>>>>>>     .../media/v4l/ext-ctrls-codec-stateless.rst   | 833
>>>>>>> ++++++++++++++++++
>>>>>>>     .../media/v4l/ext-ctrls-codec.rst             | 780
>>>>>>> ----------------
>>>>>>>     .../media/v4l/pixfmt-compressed.rst           |   7 +-
>>>>>>>     .../media/v4l/vidioc-g-ext-ctrls.rst          |  20 +
>>>>>>>     .../media/v4l/vidioc-queryctrl.rst            |   8 +
>>>>>>>     .../media/videodev2.h.rst.exceptions          |   5 +
>>>>>>>     .../media/test-drivers/vivid/vivid-ctrls.c    |  15 +
>>>>>>>     drivers/media/v4l2-core/v4l2-ctrls-api.c      | 103 ++-
>>>>>>>     drivers/media/v4l2-core/v4l2-ctrls-core.c     | 198 ++++-
>>>>>>>     drivers/media/v4l2-core/v4l2-ctrls-defs.c     |  37 +-
>>>>>>>     drivers/media/v4l2-core/v4l2-ctrls-priv.h     |   3 +-
>>>>>>>     drivers/media/v4l2-core/v4l2-ctrls-request.c  |  13 +-
>>>>>>>     drivers/staging/media/hantro/hantro_drv.c     |  27 +-
>>>>>>>     drivers/staging/media/hantro/hantro_hevc.c    |   8 +-
>>>>>>>     drivers/staging/media/sunxi/cedrus/cedrus.c   |  24 +-
>>>>>>>     .../staging/media/sunxi/cedrus/cedrus_dec.c   |  10 +-
>>>>>>>     .../staging/media/sunxi/cedrus/cedrus_h265.c  |   2 +-
>>>>>>>     include/media/hevc-ctrls.h                    | 250 ------
>>>>>>>     include/media/v4l2-ctrls.h                    |  48 +-
>>>>>>>     include/uapi/linux/hantro-media.h             |  19 +
>>>>>>>     include/uapi/linux/v4l2-controls.h            | 439 +++++++++
>>>>>>>     include/uapi/linux/videodev2.h                |  13 +
>>>>>>>     23 files changed, 1697 insertions(+), 1170 deletions(-)
>>>>>>>     delete mode 100644 include/media/hevc-ctrls.h
>>>>>>>     create mode 100644 include/uapi/linux/hantro-media.h
>>>>>>>
Nicolas Dufresne April 4, 2022, 3:56 p.m. UTC | #6
Le lundi 28 février 2022 à 15:08 +0100, Benjamin Gaignard a écrit :
> Change HEVC  stateless controls names to V4L2_CID_STATELESS_HEVC instead
> of V4L2_CID_MPEG_VIDEO_HEVC be coherent with v4l2 naming convention.
> 
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>

Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>

> ---
> version 4:
> - put controls under stateless section in v4l2-ctrls-defs.c
> 
>  .../media/v4l/ext-ctrls-codec.rst             | 26 +++++++--------
>  drivers/media/v4l2-core/v4l2-ctrls-defs.c     | 32 +++++++++----------
>  drivers/staging/media/hantro/hantro_drv.c     | 26 +++++++--------
>  drivers/staging/media/hantro/hantro_hevc.c    |  8 ++---
>  drivers/staging/media/sunxi/cedrus/cedrus.c   | 24 +++++++-------
>  .../staging/media/sunxi/cedrus/cedrus_dec.c   | 10 +++---
>  include/media/hevc-ctrls.h                    | 26 +++++++--------
>  7 files changed, 76 insertions(+), 76 deletions(-)
> 
> diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
> index d096cb75993a..acf49420e56d 100644
> --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
> +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
> @@ -2639,7 +2639,7 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
>  
>  .. _v4l2-mpeg-hevc:
>  
> -``V4L2_CID_MPEG_VIDEO_HEVC_SPS (struct)``
> +``V4L2_CID_STATELESS_HEVC_SPS (struct)``
>      Specifies the Sequence Parameter Set fields (as extracted from the
>      bitstream) for the associated HEVC slice data.
>      These bitstream parameters are defined according to :ref:`hevc`.
> @@ -2792,7 +2792,7 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
>  
>      \normalsize
>  
> -``V4L2_CID_MPEG_VIDEO_HEVC_PPS (struct)``
> +``V4L2_CID_STATELESS_HEVC_PPS (struct)``
>      Specifies the Picture Parameter Set fields (as extracted from the
>      bitstream) for the associated HEVC slice data.
>      These bitstream parameters are defined according to :ref:`hevc`.
> @@ -2945,7 +2945,7 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
>  
>      \normalsize
>  
> -``V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS (struct)``
> +``V4L2_CID_STATELESS_HEVC_SLICE_PARAMS (struct)``
>      Specifies various slice-specific parameters, especially from the NAL unit
>      header, general slice segment header and weighted prediction parameter
>      parts of the bitstream.
> @@ -3110,7 +3110,7 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
>  
>      \normalsize
>  
> -``V4L2_CID_MPEG_VIDEO_HEVC_SCALING_MATRIX (struct)``
> +``V4L2_CID_STATELESS_HEVC_SCALING_MATRIX (struct)``
>      Specifies the HEVC scaling matrix parameters used for the scaling process
>      for transform coefficients.
>      These matrix and parameters are defined according to :ref:`hevc`.
> @@ -3260,7 +3260,7 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
>  
>      \normalsize
>  
> -``V4L2_CID_MPEG_VIDEO_HEVC_DECODE_MODE (enum)``
> +``V4L2_CID_STATELESS_HEVC_DECODE_MODE (enum)``
>      Specifies the decoding mode to use. Currently exposes slice-based and
>      frame-based decoding but new modes might be added later on.
>      This control is used as a modifier for V4L2_PIX_FMT_HEVC_SLICE
> @@ -3275,7 +3275,7 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
>         This menu control is not yet part of the public kernel API and
>         it is expected to change.
>  
> -.. c:type:: v4l2_mpeg_video_hevc_decode_mode
> +.. c:type:: v4l2_stateless_hevc_decode_mode
>  
>  .. raw:: latex
>  
> @@ -3288,11 +3288,11 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
>      :stub-columns: 0
>      :widths:       1 1 2
>  
> -    * - ``V4L2_MPEG_VIDEO_HEVC_DECODE_MODE_SLICE_BASED``
> +    * - ``V4L2_STATELESS_HEVC_DECODE_MODE_SLICE_BASED``
>        - 0
>        - Decoding is done at the slice granularity.
>          The OUTPUT buffer must contain a single slice.
> -    * - ``V4L2_MPEG_VIDEO_HEVC_DECODE_MODE_FRAME_BASED``
> +    * - ``V4L2_STATELESS_HEVC_DECODE_MODE_FRAME_BASED``
>        - 1
>        - Decoding is done at the frame granularity.
>          The OUTPUT buffer must contain all slices needed to decode the
> @@ -3302,7 +3302,7 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
>  
>      \normalsize
>  
> -``V4L2_CID_MPEG_VIDEO_HEVC_START_CODE (enum)``
> +``V4L2_CID_STATELESS_HEVC_START_CODE (enum)``
>      Specifies the HEVC slice start code expected for each slice.
>      This control is used as a modifier for V4L2_PIX_FMT_HEVC_SLICE
>      pixel format. Applications that support V4L2_PIX_FMT_HEVC_SLICE
> @@ -3316,7 +3316,7 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
>         This menu control is not yet part of the public kernel API and
>         it is expected to change.
>  
> -.. c:type:: v4l2_mpeg_video_hevc_start_code
> +.. c:type:: v4l2_stateless_hevc_start_code
>  
>  .. tabularcolumns:: |p{9.2cm}|p{0.6cm}|p{7.5cm}|
>  
> @@ -3325,13 +3325,13 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
>      :stub-columns: 0
>      :widths:       1 1 2
>  
> -    * - ``V4L2_MPEG_VIDEO_HEVC_START_CODE_NONE``
> +    * - ``V4L2_STATELESS_HEVC_START_CODE_NONE``
>        - 0
>        - Selecting this value specifies that HEVC slices are passed
>          to the driver without any start code. The bitstream data should be
>          according to :ref:`hevc` 7.3.1.1 General NAL unit syntax, hence
>          contains emulation prevention bytes when required.
> -    * - ``V4L2_MPEG_VIDEO_HEVC_START_CODE_ANNEX_B``
> +    * - ``V4L2_STATELESS_HEVC_START_CODE_ANNEX_B``
>        - 1
>        - Selecting this value specifies that HEVC slices are expected
>          to be prefixed by Annex B start codes. According to :ref:`hevc`
> @@ -3364,7 +3364,7 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
>      This provides a bitmask which consists of bits [0, LTR_COUNT-1].
>      This is applicable to the H264 and HEVC encoders.
>  
> -``V4L2_CID_MPEG_VIDEO_HEVC_DECODE_PARAMS (struct)``
> +``V4L2_CID_STATELESS_HEVC_DECODE_PARAMS (struct)``
>      Specifies various decode parameters, especially the references picture order
>      count (POC) for all the lists (short, long, before, current, after) and the
>      number of entries for each of them.
> diff --git a/drivers/media/v4l2-core/v4l2-ctrls-defs.c b/drivers/media/v4l2-core/v4l2-ctrls-defs.c
> index 54ca4e6b820b..4b68cbe23309 100644
> --- a/drivers/media/v4l2-core/v4l2-ctrls-defs.c
> +++ b/drivers/media/v4l2-core/v4l2-ctrls-defs.c
> @@ -699,9 +699,9 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
>  		return hevc_tier;
>  	case V4L2_CID_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE:
>  		return hevc_loop_filter_mode;
> -	case V4L2_CID_MPEG_VIDEO_HEVC_DECODE_MODE:
> +	case V4L2_CID_STATELESS_HEVC_DECODE_MODE:
>  		return hevc_decode_mode;
> -	case V4L2_CID_MPEG_VIDEO_HEVC_START_CODE:
> +	case V4L2_CID_STATELESS_HEVC_START_CODE:
>  		return hevc_start_code;
>  	case V4L2_CID_CAMERA_ORIENTATION:
>  		return camera_orientation;
> @@ -995,13 +995,6 @@ const char *v4l2_ctrl_get_name(u32 id)
>  	case V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD:	return "HEVC Size of Length Field";
>  	case V4L2_CID_MPEG_VIDEO_REF_NUMBER_FOR_PFRAMES:	return "Reference Frames for a P-Frame";
>  	case V4L2_CID_MPEG_VIDEO_PREPEND_SPSPPS_TO_IDR:		return "Prepend SPS and PPS to IDR";
> -	case V4L2_CID_MPEG_VIDEO_HEVC_SPS:			return "HEVC Sequence Parameter Set";
> -	case V4L2_CID_MPEG_VIDEO_HEVC_PPS:			return "HEVC Picture Parameter Set";
> -	case V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS:		return "HEVC Slice Parameters";
> -	case V4L2_CID_MPEG_VIDEO_HEVC_SCALING_MATRIX:		return "HEVC Scaling Matrix";
> -	case V4L2_CID_MPEG_VIDEO_HEVC_DECODE_PARAMS:		return "HEVC Decode Parameters";
> -	case V4L2_CID_MPEG_VIDEO_HEVC_DECODE_MODE:		return "HEVC Decode Mode";
> -	case V4L2_CID_MPEG_VIDEO_HEVC_START_CODE:		return "HEVC Start Code";
>  
>  	/* CAMERA controls */
>  	/* Keep the order of the 'case's the same as in v4l2-controls.h! */
> @@ -1180,6 +1173,13 @@ const char *v4l2_ctrl_get_name(u32 id)
>  	case V4L2_CID_STATELESS_MPEG2_QUANTISATION:		return "MPEG-2 Quantisation Matrices";
>  	case V4L2_CID_STATELESS_VP9_COMPRESSED_HDR:	return "VP9 Probabilities Updates";
>  	case V4L2_CID_STATELESS_VP9_FRAME:			return "VP9 Frame Decode Parameters";
> +	case V4L2_CID_STATELESS_HEVC_SPS:			return "HEVC Sequence Parameter Set";
> +	case V4L2_CID_STATELESS_HEVC_PPS:			return "HEVC Picture Parameter Set";
> +	case V4L2_CID_STATELESS_HEVC_SLICE_PARAMS:		return "HEVC Slice Parameters";
> +	case V4L2_CID_STATELESS_HEVC_SCALING_MATRIX:		return "HEVC Scaling Matrix";
> +	case V4L2_CID_STATELESS_HEVC_DECODE_PARAMS:		return "HEVC Decode Parameters";
> +	case V4L2_CID_STATELESS_HEVC_DECODE_MODE:		return "HEVC Decode Mode";
> +	case V4L2_CID_STATELESS_HEVC_START_CODE:		return "HEVC Start Code";
>  
>  	/* Colorimetry controls */
>  	/* Keep the order of the 'case's the same as in v4l2-controls.h! */
> @@ -1355,8 +1355,8 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
>  	case V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD:
>  	case V4L2_CID_MPEG_VIDEO_HEVC_TIER:
>  	case V4L2_CID_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE:
> -	case V4L2_CID_MPEG_VIDEO_HEVC_DECODE_MODE:
> -	case V4L2_CID_MPEG_VIDEO_HEVC_START_CODE:
> +	case V4L2_CID_STATELESS_HEVC_DECODE_MODE:
> +	case V4L2_CID_STATELESS_HEVC_START_CODE:
>  	case V4L2_CID_STATELESS_H264_DECODE_MODE:
>  	case V4L2_CID_STATELESS_H264_START_CODE:
>  	case V4L2_CID_CAMERA_ORIENTATION:
> @@ -1493,19 +1493,19 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
>  	case V4L2_CID_STATELESS_VP8_FRAME:
>  		*type = V4L2_CTRL_TYPE_VP8_FRAME;
>  		break;
> -	case V4L2_CID_MPEG_VIDEO_HEVC_SPS:
> +	case V4L2_CID_STATELESS_HEVC_SPS:
>  		*type = V4L2_CTRL_TYPE_HEVC_SPS;
>  		break;
> -	case V4L2_CID_MPEG_VIDEO_HEVC_PPS:
> +	case V4L2_CID_STATELESS_HEVC_PPS:
>  		*type = V4L2_CTRL_TYPE_HEVC_PPS;
>  		break;
> -	case V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS:
> +	case V4L2_CID_STATELESS_HEVC_SLICE_PARAMS:
>  		*type = V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS;
>  		break;
> -	case V4L2_CID_MPEG_VIDEO_HEVC_SCALING_MATRIX:
> +	case V4L2_CID_STATELESS_HEVC_SCALING_MATRIX:
>  		*type = V4L2_CTRL_TYPE_HEVC_SCALING_MATRIX;
>  		break;
> -	case V4L2_CID_MPEG_VIDEO_HEVC_DECODE_PARAMS:
> +	case V4L2_CID_STATELESS_HEVC_DECODE_PARAMS:
>  		*type = V4L2_CTRL_TYPE_HEVC_DECODE_PARAMS;
>  		break;
>  	case V4L2_CID_STATELESS_VP9_COMPRESSED_HDR:
> diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c
> index dc768884cb79..6f58c259d8fc 100644
> --- a/drivers/staging/media/hantro/hantro_drv.c
> +++ b/drivers/staging/media/hantro/hantro_drv.c
> @@ -255,7 +255,7 @@ static int hantro_try_ctrl(struct v4l2_ctrl *ctrl)
>  		if (sps->bit_depth_luma_minus8 != 0)
>  			/* Only 8-bit is supported */
>  			return -EINVAL;
> -	} else if (ctrl->id == V4L2_CID_MPEG_VIDEO_HEVC_SPS) {
> +	} else if (ctrl->id == V4L2_CID_STATELESS_HEVC_SPS) {
>  		const struct v4l2_ctrl_hevc_sps *sps = ctrl->p_new.p_hevc_sps;
>  
>  		if (sps->bit_depth_luma_minus8 != sps->bit_depth_chroma_minus8)
> @@ -428,18 +428,18 @@ static const struct hantro_ctrl controls[] = {
>  	}, {
>  		.codec = HANTRO_HEVC_DECODER,
>  		.cfg = {
> -			.id = V4L2_CID_MPEG_VIDEO_HEVC_DECODE_MODE,
> -			.min = V4L2_MPEG_VIDEO_HEVC_DECODE_MODE_FRAME_BASED,
> -			.max = V4L2_MPEG_VIDEO_HEVC_DECODE_MODE_FRAME_BASED,
> -			.def = V4L2_MPEG_VIDEO_HEVC_DECODE_MODE_FRAME_BASED,
> +			.id = V4L2_CID_STATELESS_HEVC_DECODE_MODE,
> +			.min = V4L2_STATELESS_HEVC_DECODE_MODE_FRAME_BASED,
> +			.max = V4L2_STATELESS_HEVC_DECODE_MODE_FRAME_BASED,
> +			.def = V4L2_STATELESS_HEVC_DECODE_MODE_FRAME_BASED,
>  		},
>  	}, {
>  		.codec = HANTRO_HEVC_DECODER,
>  		.cfg = {
> -			.id = V4L2_CID_MPEG_VIDEO_HEVC_START_CODE,
> -			.min = V4L2_MPEG_VIDEO_HEVC_START_CODE_ANNEX_B,
> -			.max = V4L2_MPEG_VIDEO_HEVC_START_CODE_ANNEX_B,
> -			.def = V4L2_MPEG_VIDEO_HEVC_START_CODE_ANNEX_B,
> +			.id = V4L2_CID_STATELESS_HEVC_START_CODE,
> +			.min = V4L2_STATELESS_HEVC_START_CODE_ANNEX_B,
> +			.max = V4L2_STATELESS_HEVC_START_CODE_ANNEX_B,
> +			.def = V4L2_STATELESS_HEVC_START_CODE_ANNEX_B,
>  		},
>  	}, {
>  		.codec = HANTRO_HEVC_DECODER,
> @@ -459,23 +459,23 @@ static const struct hantro_ctrl controls[] = {
>  	}, {
>  		.codec = HANTRO_HEVC_DECODER,
>  		.cfg = {
> -			.id = V4L2_CID_MPEG_VIDEO_HEVC_SPS,
> +			.id = V4L2_CID_STATELESS_HEVC_SPS,
>  			.ops = &hantro_ctrl_ops,
>  		},
>  	}, {
>  		.codec = HANTRO_HEVC_DECODER,
>  		.cfg = {
> -			.id = V4L2_CID_MPEG_VIDEO_HEVC_PPS,
> +			.id = V4L2_CID_STATELESS_HEVC_PPS,
>  		},
>  	}, {
>  		.codec = HANTRO_HEVC_DECODER,
>  		.cfg = {
> -			.id = V4L2_CID_MPEG_VIDEO_HEVC_DECODE_PARAMS,
> +			.id = V4L2_CID_STATELESS_HEVC_DECODE_PARAMS,
>  		},
>  	}, {
>  		.codec = HANTRO_HEVC_DECODER,
>  		.cfg = {
> -			.id = V4L2_CID_MPEG_VIDEO_HEVC_SCALING_MATRIX,
> +			.id = V4L2_CID_STATELESS_HEVC_SCALING_MATRIX,
>  		},
>  	}, {
>  		.codec = HANTRO_HEVC_DECODER,
> diff --git a/drivers/staging/media/hantro/hantro_hevc.c b/drivers/staging/media/hantro/hantro_hevc.c
> index b49a41d7ae91..b6ec86d03d91 100644
> --- a/drivers/staging/media/hantro/hantro_hevc.c
> +++ b/drivers/staging/media/hantro/hantro_hevc.c
> @@ -201,22 +201,22 @@ int hantro_hevc_dec_prepare_run(struct hantro_ctx *ctx)
>  	hantro_start_prepare_run(ctx);
>  
>  	ctrls->decode_params =
> -		hantro_get_ctrl(ctx, V4L2_CID_MPEG_VIDEO_HEVC_DECODE_PARAMS);
> +		hantro_get_ctrl(ctx, V4L2_CID_STATELESS_HEVC_DECODE_PARAMS);
>  	if (WARN_ON(!ctrls->decode_params))
>  		return -EINVAL;
>  
>  	ctrls->scaling =
> -		hantro_get_ctrl(ctx, V4L2_CID_MPEG_VIDEO_HEVC_SCALING_MATRIX);
> +		hantro_get_ctrl(ctx, V4L2_CID_STATELESS_HEVC_SCALING_MATRIX);
>  	if (WARN_ON(!ctrls->scaling))
>  		return -EINVAL;
>  
>  	ctrls->sps =
> -		hantro_get_ctrl(ctx, V4L2_CID_MPEG_VIDEO_HEVC_SPS);
> +		hantro_get_ctrl(ctx, V4L2_CID_STATELESS_HEVC_SPS);
>  	if (WARN_ON(!ctrls->sps))
>  		return -EINVAL;
>  
>  	ctrls->pps =
> -		hantro_get_ctrl(ctx, V4L2_CID_MPEG_VIDEO_HEVC_PPS);
> +		hantro_get_ctrl(ctx, V4L2_CID_STATELESS_HEVC_PPS);
>  	if (WARN_ON(!ctrls->pps))
>  		return -EINVAL;
>  
> diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c
> index 4a4b714b0f26..e0428163f82c 100644
> --- a/drivers/staging/media/sunxi/cedrus/cedrus.c
> +++ b/drivers/staging/media/sunxi/cedrus/cedrus.c
> @@ -42,7 +42,7 @@ static int cedrus_try_ctrl(struct v4l2_ctrl *ctrl)
>  		if (sps->bit_depth_luma_minus8 != 0)
>  			/* Only 8-bit is supported */
>  			return -EINVAL;
> -	} else if (ctrl->id == V4L2_CID_MPEG_VIDEO_HEVC_SPS) {
> +	} else if (ctrl->id == V4L2_CID_STATELESS_HEVC_SPS) {
>  		const struct v4l2_ctrl_hevc_sps *sps = ctrl->p_new.p_hevc_sps;
>  		struct cedrus_ctx *ctx = container_of(ctrl->handler, struct cedrus_ctx, hdl);
>  
> @@ -164,42 +164,42 @@ static const struct cedrus_control cedrus_controls[] = {
>  	},
>  	{
>  		.cfg = {
> -			.id	= V4L2_CID_MPEG_VIDEO_HEVC_SPS,
> +			.id	= V4L2_CID_STATELESS_HEVC_SPS,
>  			.ops	= &cedrus_ctrl_ops,
>  		},
>  		.codec		= CEDRUS_CODEC_H265,
>  	},
>  	{
>  		.cfg = {
> -			.id	= V4L2_CID_MPEG_VIDEO_HEVC_PPS,
> +			.id	= V4L2_CID_STATELESS_HEVC_PPS,
>  		},
>  		.codec		= CEDRUS_CODEC_H265,
>  	},
>  	{
>  		.cfg = {
> -			.id	= V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS,
> +			.id	= V4L2_CID_STATELESS_HEVC_SLICE_PARAMS,
>  		},
>  		.codec		= CEDRUS_CODEC_H265,
>  	},
>  	{
>  		.cfg = {
> -			.id	= V4L2_CID_MPEG_VIDEO_HEVC_SCALING_MATRIX,
> +			.id	= V4L2_CID_STATELESS_HEVC_SCALING_MATRIX,
>  		},
>  		.codec		= CEDRUS_CODEC_H265,
>  	},
>  	{
>  		.cfg = {
> -			.id	= V4L2_CID_MPEG_VIDEO_HEVC_DECODE_MODE,
> -			.max	= V4L2_MPEG_VIDEO_HEVC_DECODE_MODE_SLICE_BASED,
> -			.def	= V4L2_MPEG_VIDEO_HEVC_DECODE_MODE_SLICE_BASED,
> +			.id	= V4L2_CID_STATELESS_HEVC_DECODE_MODE,
> +			.max	= V4L2_STATELESS_HEVC_DECODE_MODE_SLICE_BASED,
> +			.def	= V4L2_STATELESS_HEVC_DECODE_MODE_SLICE_BASED,
>  		},
>  		.codec		= CEDRUS_CODEC_H265,
>  	},
>  	{
>  		.cfg = {
> -			.id	= V4L2_CID_MPEG_VIDEO_HEVC_START_CODE,
> -			.max	= V4L2_MPEG_VIDEO_HEVC_START_CODE_NONE,
> -			.def	= V4L2_MPEG_VIDEO_HEVC_START_CODE_NONE,
> +			.id	= V4L2_CID_STATELESS_HEVC_START_CODE,
> +			.max	= V4L2_STATELESS_HEVC_START_CODE_NONE,
> +			.def	= V4L2_STATELESS_HEVC_START_CODE_NONE,
>  		},
>  		.codec		= CEDRUS_CODEC_H265,
>  	},
> @@ -211,7 +211,7 @@ static const struct cedrus_control cedrus_controls[] = {
>  	},
>  	{
>  		.cfg = {
> -			.id = V4L2_CID_MPEG_VIDEO_HEVC_DECODE_PARAMS,
> +			.id = V4L2_CID_STATELESS_HEVC_DECODE_PARAMS,
>  		},
>  		.codec		= CEDRUS_CODEC_H265,
>  	},
> diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_dec.c b/drivers/staging/media/sunxi/cedrus/cedrus_dec.c
> index a16c1422558f..f6be4ae72ee2 100644
> --- a/drivers/staging/media/sunxi/cedrus/cedrus_dec.c
> +++ b/drivers/staging/media/sunxi/cedrus/cedrus_dec.c
> @@ -65,15 +65,15 @@ void cedrus_device_run(void *priv)
>  
>  	case V4L2_PIX_FMT_HEVC_SLICE:
>  		run.h265.sps = cedrus_find_control_data(ctx,
> -			V4L2_CID_MPEG_VIDEO_HEVC_SPS);
> +			V4L2_CID_STATELESS_HEVC_SPS);
>  		run.h265.pps = cedrus_find_control_data(ctx,
> -			V4L2_CID_MPEG_VIDEO_HEVC_PPS);
> +			V4L2_CID_STATELESS_HEVC_PPS);
>  		run.h265.slice_params = cedrus_find_control_data(ctx,
> -			V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS);
> +			V4L2_CID_STATELESS_HEVC_SLICE_PARAMS);
>  		run.h265.decode_params = cedrus_find_control_data(ctx,
> -			V4L2_CID_MPEG_VIDEO_HEVC_DECODE_PARAMS);
> +			V4L2_CID_STATELESS_HEVC_DECODE_PARAMS);
>  		run.h265.scaling_matrix = cedrus_find_control_data(ctx,
> -			V4L2_CID_MPEG_VIDEO_HEVC_SCALING_MATRIX);
> +			V4L2_CID_STATELESS_HEVC_SCALING_MATRIX);
>  		break;
>  
>  	case V4L2_PIX_FMT_VP8_FRAME:
> diff --git a/include/media/hevc-ctrls.h b/include/media/hevc-ctrls.h
> index a329e086a89a..b3540167df9e 100644
> --- a/include/media/hevc-ctrls.h
> +++ b/include/media/hevc-ctrls.h
> @@ -16,13 +16,13 @@
>  /* The pixel format isn't stable at the moment and will likely be renamed. */
>  #define V4L2_PIX_FMT_HEVC_SLICE v4l2_fourcc('S', '2', '6', '5') /* HEVC parsed slices */
>  
> -#define V4L2_CID_MPEG_VIDEO_HEVC_SPS		(V4L2_CID_CODEC_BASE + 1008)
> -#define V4L2_CID_MPEG_VIDEO_HEVC_PPS		(V4L2_CID_CODEC_BASE + 1009)
> -#define V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS	(V4L2_CID_CODEC_BASE + 1010)
> -#define V4L2_CID_MPEG_VIDEO_HEVC_SCALING_MATRIX	(V4L2_CID_CODEC_BASE + 1011)
> -#define V4L2_CID_MPEG_VIDEO_HEVC_DECODE_PARAMS	(V4L2_CID_CODEC_BASE + 1012)
> -#define V4L2_CID_MPEG_VIDEO_HEVC_DECODE_MODE	(V4L2_CID_CODEC_BASE + 1015)
> -#define V4L2_CID_MPEG_VIDEO_HEVC_START_CODE	(V4L2_CID_CODEC_BASE + 1016)
> +#define V4L2_CID_STATELESS_HEVC_SPS		(V4L2_CID_CODEC_BASE + 1008)
> +#define V4L2_CID_STATELESS_HEVC_PPS		(V4L2_CID_CODEC_BASE + 1009)
> +#define V4L2_CID_STATELESS_HEVC_SLICE_PARAMS	(V4L2_CID_CODEC_BASE + 1010)
> +#define V4L2_CID_STATELESS_HEVC_SCALING_MATRIX	(V4L2_CID_CODEC_BASE + 1011)
> +#define V4L2_CID_STATELESS_HEVC_DECODE_PARAMS	(V4L2_CID_CODEC_BASE + 1012)
> +#define V4L2_CID_STATELESS_HEVC_DECODE_MODE	(V4L2_CID_CODEC_BASE + 1015)
> +#define V4L2_CID_STATELESS_HEVC_START_CODE	(V4L2_CID_CODEC_BASE + 1016)
>  
>  /* enum v4l2_ctrl_type type values */
>  #define V4L2_CTRL_TYPE_HEVC_SPS 0x0120
> @@ -31,14 +31,14 @@
>  #define V4L2_CTRL_TYPE_HEVC_SCALING_MATRIX 0x0123
>  #define V4L2_CTRL_TYPE_HEVC_DECODE_PARAMS 0x0124
>  
> -enum v4l2_mpeg_video_hevc_decode_mode {
> -	V4L2_MPEG_VIDEO_HEVC_DECODE_MODE_SLICE_BASED,
> -	V4L2_MPEG_VIDEO_HEVC_DECODE_MODE_FRAME_BASED,
> +enum v4l2_stateless_hevc_decode_mode {
> +	V4L2_STATELESS_HEVC_DECODE_MODE_SLICE_BASED,
> +	V4L2_STATELESS_HEVC_DECODE_MODE_FRAME_BASED,
>  };
>  
> -enum v4l2_mpeg_video_hevc_start_code {
> -	V4L2_MPEG_VIDEO_HEVC_START_CODE_NONE,
> -	V4L2_MPEG_VIDEO_HEVC_START_CODE_ANNEX_B,
> +enum v4l2_stateless_hevc_start_code {
> +	V4L2_STATELESS_HEVC_START_CODE_NONE,
> +	V4L2_STATELESS_HEVC_START_CODE_ANNEX_B,
>  };
>  
>  #define V4L2_HEVC_SLICE_TYPE_B	0
Adam Ford April 5, 2022, 9:27 p.m. UTC | #7
On Mon, Apr 4, 2022 at 10:56 AM Benjamin Gaignard
<benjamin.gaignard@collabora.com> wrote:
>
>
> Le 02/04/2022 à 18:59, Adam Ford a écrit :
> > On Sat, Apr 2, 2022 at 11:22 AM Adam Ford <aford173@gmail.com> wrote:
> >> On Fri, Apr 1, 2022 at 8:18 AM Benjamin Gaignard
> >> <benjamin.gaignard@collabora.com> wrote:
> >>>
> >>> Le 31/03/2022 à 08:53, Benjamin Gaignard a écrit :
> >>>> Le 30/03/2022 à 20:52, Adam Ford a écrit :
> >>>>> On Wed, Mar 30, 2022 at 2:53 AM Benjamin Gaignard
> >>>>> <benjamin.gaignard@collabora.com> wrote:
> >>>>>> Le 28/02/2022 à 15:08, Benjamin Gaignard a écrit :
> >>>>>>> This series aims to make HEVC uapi stable and usable for hardware
> >>>>>>> decoder. HEVC uapi is used by 2 mainlined drivers (Cedrus and Hantro)
> >>>>>>> and 2 out of the tree drivers (rkvdec and RPI).
> >>>>>>>
> >>>>>>> After the remarks done on version 2, I have completely reworked to
> >>>>>>> patches
> >>>>>>> split so changelogs are meaningless. I have also drop "RFC" from the
> >>>>>>> titles.
> >>>>>>>
> >>>>>>> Version 4:
> >>>>>>> - Add num_entry_point_offsets field in  struct
> >>>>>>> v4l2_ctrl_hevc_slice_params
> >>>>>>> - Fix V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS name
> >>>>>>> - Initialize control V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS
> >>>>>>> - Fix space/tab issue in kernel-doc
> >>>>>>> - Add patch to change data_bit_offset definition
> >>>>>>> - Fix hantro-media SPDX license
> >>>>>>> - put controls under stateless section in v4l2-ctrls-defs.c
> >>>>>>>
> >>>>>>> At the end fluster tests results on IMX8MQ is 77/147 for HEVC codec.
> >>>>>> Dear reviewers,
> >>>>>>
> >>>>>> This series is waiting for your feedback,
> >>>>> I tried several times with the suggested repos for both the kernel and
> >>>>> g-streamer without success getting Fluster to pass any tests on the
> >>>>> imx8mq.  I can try again but I likely won't get to it until this
> >>>>> weekend.  If I can get it working, I'll test both the 8mq and 8mm.
> >>>> Thanks a lot for that.
> >>>>
> >>>> Benjamin
> >>> Adam,
> >>>
> >>> You may need to check if h265parse and v4l2slh265dec are available on your board.
> >> I ran gst-inspect to see what showed up with 265 in the name.
> >>
> >> # gst-inspect-1.0 |grep 265
> >> libav:  avdec_h265: libav HEVC (High Efficiency Video Coding) decoder
> >> rtp:  rtph265depay: RTP H265 depayloader
> >> rtp:  rtph265pay: RTP H265 payloader
> >> typefindfunctions: video/x-h265: h265, x265, 265
> >> v4l2codecs:  v4l2slh265dec: V4L2 Stateless H.265 Video Decoder
> >> videoparsersbad:  h265parse: H.265 parser
> >>
> >> It appears I have both h265parse and v4l2slh265dec.
> >>
> >>> fluster check if v4l2slh265dec is working fine with this command line:
> >>>
> >>> gst-launch-1.0 appsrc num-buffers=0 ! h265parse ! v4l2slh265dec ! fakesink
> >>>
> >>> so if one of them is missing it won't work.
> >> gst-launch-1.0 appsrc num-buffers=0 ! h265parse ! v4l2slh265dec ! fakesink
> >> Setting pipeline to PAUSED ...
> >> 0:00:00.098389938   526 0xaaaaf9d86ac0 ERROR     v4l2codecs-decoder
> >> gstv4l2decoder.c:725:gst_v4l2_decoder_get_controls:<v4l2decoder2>
> >> VIDIOC_G_EXT_CTRLS failed: Invalid argument
> >> ERROR: from element
> >> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0: Driver did not
> >> report framing and start code method.
> >> Additional debug info:
> >> ../subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech265dec.c(155):
> >> gst_v4l2_codec_h265_dec_open ():
> >> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0:
> >> gst_v4l2_decoder_get_controls() failed: Invalid argument
> >> ERROR: pipeline doesn't want to preroll.
> >> ERROR: from element
> >> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0: Could not
> >> initialize supporting library.
> >> Additional debug info:
> >> ../subprojects/gst-plugins-base/gst-libs/gst/video/gstvideodecoder.c(2909):
> >> gst_video_decoder_change_state ():
> >> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0:
> >> Failed to open decoder
> >> ERROR: pipeline doesn't want to preroll.
> >> Failed to set pipeline to PAUSED.
> >> Setting pipeline to NULL ...
> >> Freeing pipeline ...
> >>
> >> Does this mean I have a wrong version of the kernel and/or incomplete patches?
> > I double checked the branches.
> >
> > Kernel:
> > https://gitlab.collabora.com/benjamin.gaignard/for-upstream.git
> > branch:  origin/HEVC_UAPI_V4
> >
> > Gstreamer:
> > https://gitlab.freedesktop.org/benjamin.gaignard1/gstreamer.git
> > branch:  origin/benjamin.gaignard1/gstreamer-HEVC_aligned_with_kernel_5.15
> >
> >
> > I am still not able to run h.265/HEVC tests.
>
> Hello Adam,
>
> I have updated the following branches with the versions I have used today:
>
> Kernel:
> https://gitlab.collabora.com/benjamin.gaignard/for-upstream.git
> branch: origin/HEVC_UAPI_V5 only one change in documentation vs version 4 but rebased in v5.18-rc1
>
> Gstreamer:
> https://gitlab.freedesktop.org/benjamin.gaignard1/gstreamer.git
> branch:  origin/benjamin.gaignard1/gstreamer-HEVC_aligned_with_kernel_5.15 updated on the latest GST main branch
>
> I hope this will work fine this time.

I wish I had better news for you:

dmesg shows the hantro driver is being loaded:

[   38.612243] hantro-vpu 38300000.video-codec: registered
nxp,imx8mq-vpu-g1-dec as /dev/video0
[   38.612618] hantro-vpu 38310000.video-codec: registered
nxp,imx8mq-vpu-g2-dec as /dev/video1

# gst-inspect-1.0 |grep 265
libav:  avdec_h265: libav HEVC (High Efficiency Video Coding) decoder
rtp:  rtph265depay: RTP H265 depayloader
rtp:  rtph265pay: RTP H265 payloader
typefindfunctions: video/x-h265: h265, x265, 265
v4l2codecs:  v4l2slh265dec: V4L2 Stateless H.265 Video Decoder
videoparsersbad:  h265parse: H.265 parser

Fluster reports:
GStreamer-H.265-V4L2SL-Gst1.0: GStreamer H.265 V4L2SL decoder for
GStreamer 1.0... ❌

adam
>
> Benjamin
>
> >
> > adam
> >> adam
> >>> Regards,
> >>> Benjamin
> >>>
> >>>>> adam
> >>>>>> Thanks,
> >>>>>> Benjamin
> >>>>>>
> >>>>>>> Benjamin
> >>>>>>>
> >>>>>>>
> >>>>>>> Benjamin Gaignard (12):
> >>>>>>>      media: uapi: HEVC: Add missing fields in HEVC controls
> >>>>>>>      media: uapi: HEVC: Rename HEVC stateless controls with STATELESS
> >>>>>>>        prefix
> >>>>>>>      media: uapi: HEVC: Add document uAPI structure
> >>>>>>>      media: uapi: HEVC: Define V4L2_CID_STATELESS_HEVC_SLICE_PARAMS
> >>>>>>> as a
> >>>>>>>        dynamic array
> >>>>>>>      media: uapi: Move parsed HEVC pixel format out of staging
> >>>>>>>      media: uapi: Add V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS
> >>>>>>> control
> >>>>>>>      media: uapi: Move the HEVC stateless control type out of staging
> >>>>>>>      media: controls: Log HEVC stateless control in .std_log
> >>>>>>>      media: uapi: Create a dedicated header for Hantro control
> >>>>>>>      media: uapi: HEVC: fix padding in v4l2 control structures
> >>>>>>>      media: uapi: Change data_bit_offset definition
> >>>>>>>      media: uapi: move HEVC stateless controls out of staging
> >>>>>>>
> >>>>>>> Hans Verkuil (3):
> >>>>>>>      videodev2.h: add V4L2_CTRL_FLAG_DYNAMIC_ARRAY
> >>>>>>>      v4l2-ctrls: add support for dynamically allocated arrays.
> >>>>>>>      vivid: add dynamic array test control
> >>>>>>>
> >>>>>>>     .../userspace-api/media/drivers/hantro.rst    |   5 -
> >>>>>>>     .../media/v4l/ext-ctrls-codec-stateless.rst   | 833
> >>>>>>> ++++++++++++++++++
> >>>>>>>     .../media/v4l/ext-ctrls-codec.rst             | 780
> >>>>>>> ----------------
> >>>>>>>     .../media/v4l/pixfmt-compressed.rst           |   7 +-
> >>>>>>>     .../media/v4l/vidioc-g-ext-ctrls.rst          |  20 +
> >>>>>>>     .../media/v4l/vidioc-queryctrl.rst            |   8 +
> >>>>>>>     .../media/videodev2.h.rst.exceptions          |   5 +
> >>>>>>>     .../media/test-drivers/vivid/vivid-ctrls.c    |  15 +
> >>>>>>>     drivers/media/v4l2-core/v4l2-ctrls-api.c      | 103 ++-
> >>>>>>>     drivers/media/v4l2-core/v4l2-ctrls-core.c     | 198 ++++-
> >>>>>>>     drivers/media/v4l2-core/v4l2-ctrls-defs.c     |  37 +-
> >>>>>>>     drivers/media/v4l2-core/v4l2-ctrls-priv.h     |   3 +-
> >>>>>>>     drivers/media/v4l2-core/v4l2-ctrls-request.c  |  13 +-
> >>>>>>>     drivers/staging/media/hantro/hantro_drv.c     |  27 +-
> >>>>>>>     drivers/staging/media/hantro/hantro_hevc.c    |   8 +-
> >>>>>>>     drivers/staging/media/sunxi/cedrus/cedrus.c   |  24 +-
> >>>>>>>     .../staging/media/sunxi/cedrus/cedrus_dec.c   |  10 +-
> >>>>>>>     .../staging/media/sunxi/cedrus/cedrus_h265.c  |   2 +-
> >>>>>>>     include/media/hevc-ctrls.h                    | 250 ------
> >>>>>>>     include/media/v4l2-ctrls.h                    |  48 +-
> >>>>>>>     include/uapi/linux/hantro-media.h             |  19 +
> >>>>>>>     include/uapi/linux/v4l2-controls.h            | 439 +++++++++
> >>>>>>>     include/uapi/linux/videodev2.h                |  13 +
> >>>>>>>     23 files changed, 1697 insertions(+), 1170 deletions(-)
> >>>>>>>     delete mode 100644 include/media/hevc-ctrls.h
> >>>>>>>     create mode 100644 include/uapi/linux/hantro-media.h
> >>>>>>>
Benjamin Gaignard April 6, 2022, 6:56 a.m. UTC | #8
Le 05/04/2022 à 23:27, Adam Ford a écrit :
> On Mon, Apr 4, 2022 at 10:56 AM Benjamin Gaignard
> <benjamin.gaignard@collabora.com> wrote:
>>
>> Le 02/04/2022 à 18:59, Adam Ford a écrit :
>>> On Sat, Apr 2, 2022 at 11:22 AM Adam Ford <aford173@gmail.com> wrote:
>>>> On Fri, Apr 1, 2022 at 8:18 AM Benjamin Gaignard
>>>> <benjamin.gaignard@collabora.com> wrote:
>>>>> Le 31/03/2022 à 08:53, Benjamin Gaignard a écrit :
>>>>>> Le 30/03/2022 à 20:52, Adam Ford a écrit :
>>>>>>> On Wed, Mar 30, 2022 at 2:53 AM Benjamin Gaignard
>>>>>>> <benjamin.gaignard@collabora.com> wrote:
>>>>>>>> Le 28/02/2022 à 15:08, Benjamin Gaignard a écrit :
>>>>>>>>> This series aims to make HEVC uapi stable and usable for hardware
>>>>>>>>> decoder. HEVC uapi is used by 2 mainlined drivers (Cedrus and Hantro)
>>>>>>>>> and 2 out of the tree drivers (rkvdec and RPI).
>>>>>>>>>
>>>>>>>>> After the remarks done on version 2, I have completely reworked to
>>>>>>>>> patches
>>>>>>>>> split so changelogs are meaningless. I have also drop "RFC" from the
>>>>>>>>> titles.
>>>>>>>>>
>>>>>>>>> Version 4:
>>>>>>>>> - Add num_entry_point_offsets field in  struct
>>>>>>>>> v4l2_ctrl_hevc_slice_params
>>>>>>>>> - Fix V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS name
>>>>>>>>> - Initialize control V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS
>>>>>>>>> - Fix space/tab issue in kernel-doc
>>>>>>>>> - Add patch to change data_bit_offset definition
>>>>>>>>> - Fix hantro-media SPDX license
>>>>>>>>> - put controls under stateless section in v4l2-ctrls-defs.c
>>>>>>>>>
>>>>>>>>> At the end fluster tests results on IMX8MQ is 77/147 for HEVC codec.
>>>>>>>> Dear reviewers,
>>>>>>>>
>>>>>>>> This series is waiting for your feedback,
>>>>>>> I tried several times with the suggested repos for both the kernel and
>>>>>>> g-streamer without success getting Fluster to pass any tests on the
>>>>>>> imx8mq.  I can try again but I likely won't get to it until this
>>>>>>> weekend.  If I can get it working, I'll test both the 8mq and 8mm.
>>>>>> Thanks a lot for that.
>>>>>>
>>>>>> Benjamin
>>>>> Adam,
>>>>>
>>>>> You may need to check if h265parse and v4l2slh265dec are available on your board.
>>>> I ran gst-inspect to see what showed up with 265 in the name.
>>>>
>>>> # gst-inspect-1.0 |grep 265
>>>> libav:  avdec_h265: libav HEVC (High Efficiency Video Coding) decoder
>>>> rtp:  rtph265depay: RTP H265 depayloader
>>>> rtp:  rtph265pay: RTP H265 payloader
>>>> typefindfunctions: video/x-h265: h265, x265, 265
>>>> v4l2codecs:  v4l2slh265dec: V4L2 Stateless H.265 Video Decoder
>>>> videoparsersbad:  h265parse: H.265 parser
>>>>
>>>> It appears I have both h265parse and v4l2slh265dec.
>>>>
>>>>> fluster check if v4l2slh265dec is working fine with this command line:
>>>>>
>>>>> gst-launch-1.0 appsrc num-buffers=0 ! h265parse ! v4l2slh265dec ! fakesink
>>>>>
>>>>> so if one of them is missing it won't work.
>>>> gst-launch-1.0 appsrc num-buffers=0 ! h265parse ! v4l2slh265dec ! fakesink
>>>> Setting pipeline to PAUSED ...
>>>> 0:00:00.098389938   526 0xaaaaf9d86ac0 ERROR     v4l2codecs-decoder
>>>> gstv4l2decoder.c:725:gst_v4l2_decoder_get_controls:<v4l2decoder2>
>>>> VIDIOC_G_EXT_CTRLS failed: Invalid argument
>>>> ERROR: from element
>>>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0: Driver did not
>>>> report framing and start code method.
>>>> Additional debug info:
>>>> ../subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech265dec.c(155):
>>>> gst_v4l2_codec_h265_dec_open ():
>>>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0:
>>>> gst_v4l2_decoder_get_controls() failed: Invalid argument
>>>> ERROR: pipeline doesn't want to preroll.
>>>> ERROR: from element
>>>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0: Could not
>>>> initialize supporting library.
>>>> Additional debug info:
>>>> ../subprojects/gst-plugins-base/gst-libs/gst/video/gstvideodecoder.c(2909):
>>>> gst_video_decoder_change_state ():
>>>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0:
>>>> Failed to open decoder
>>>> ERROR: pipeline doesn't want to preroll.
>>>> Failed to set pipeline to PAUSED.
>>>> Setting pipeline to NULL ...
>>>> Freeing pipeline ...
>>>>
>>>> Does this mean I have a wrong version of the kernel and/or incomplete patches?
>>> I double checked the branches.
>>>
>>> Kernel:
>>> https://gitlab.collabora.com/benjamin.gaignard/for-upstream.git
>>> branch:  origin/HEVC_UAPI_V4
>>>
>>> Gstreamer:
>>> https://gitlab.freedesktop.org/benjamin.gaignard1/gstreamer.git
>>> branch:  origin/benjamin.gaignard1/gstreamer-HEVC_aligned_with_kernel_5.15
>>>
>>>
>>> I am still not able to run h.265/HEVC tests.
>> Hello Adam,
>>
>> I have updated the following branches with the versions I have used today:
>>
>> Kernel:
>> https://gitlab.collabora.com/benjamin.gaignard/for-upstream.git
>> branch: origin/HEVC_UAPI_V5 only one change in documentation vs version 4 but rebased in v5.18-rc1
>>
>> Gstreamer:
>> https://gitlab.freedesktop.org/benjamin.gaignard1/gstreamer.git
>> branch:  origin/benjamin.gaignard1/gstreamer-HEVC_aligned_with_kernel_5.15 updated on the latest GST main branch
>>
>> I hope this will work fine this time.
> I wish I had better news for you:
>
> dmesg shows the hantro driver is being loaded:
>
> [   38.612243] hantro-vpu 38300000.video-codec: registered
> nxp,imx8mq-vpu-g1-dec as /dev/video0
> [   38.612618] hantro-vpu 38310000.video-codec: registered
> nxp,imx8mq-vpu-g2-dec as /dev/video1
>
> # gst-inspect-1.0 |grep 265
> libav:  avdec_h265: libav HEVC (High Efficiency Video Coding) decoder
> rtp:  rtph265depay: RTP H265 depayloader
> rtp:  rtph265pay: RTP H265 payloader
> typefindfunctions: video/x-h265: h265, x265, 265
> v4l2codecs:  v4l2slh265dec: V4L2 Stateless H.265 Video Decoder
> videoparsersbad:  h265parse: H.265 parser
>
> Fluster reports:
> GStreamer-H.265-V4L2SL-Gst1.0: GStreamer H.265 V4L2SL decoder for
> GStreamer 1.0... ❌

Still the same error about non supported control ?

Benjamin

> adam
>> Benjamin
>>
>>> adam
>>>> adam
>>>>> Regards,
>>>>> Benjamin
>>>>>
>>>>>>> adam
>>>>>>>> Thanks,
>>>>>>>> Benjamin
>>>>>>>>
>>>>>>>>> Benjamin
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Benjamin Gaignard (12):
>>>>>>>>>       media: uapi: HEVC: Add missing fields in HEVC controls
>>>>>>>>>       media: uapi: HEVC: Rename HEVC stateless controls with STATELESS
>>>>>>>>>         prefix
>>>>>>>>>       media: uapi: HEVC: Add document uAPI structure
>>>>>>>>>       media: uapi: HEVC: Define V4L2_CID_STATELESS_HEVC_SLICE_PARAMS
>>>>>>>>> as a
>>>>>>>>>         dynamic array
>>>>>>>>>       media: uapi: Move parsed HEVC pixel format out of staging
>>>>>>>>>       media: uapi: Add V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS
>>>>>>>>> control
>>>>>>>>>       media: uapi: Move the HEVC stateless control type out of staging
>>>>>>>>>       media: controls: Log HEVC stateless control in .std_log
>>>>>>>>>       media: uapi: Create a dedicated header for Hantro control
>>>>>>>>>       media: uapi: HEVC: fix padding in v4l2 control structures
>>>>>>>>>       media: uapi: Change data_bit_offset definition
>>>>>>>>>       media: uapi: move HEVC stateless controls out of staging
>>>>>>>>>
>>>>>>>>> Hans Verkuil (3):
>>>>>>>>>       videodev2.h: add V4L2_CTRL_FLAG_DYNAMIC_ARRAY
>>>>>>>>>       v4l2-ctrls: add support for dynamically allocated arrays.
>>>>>>>>>       vivid: add dynamic array test control
>>>>>>>>>
>>>>>>>>>      .../userspace-api/media/drivers/hantro.rst    |   5 -
>>>>>>>>>      .../media/v4l/ext-ctrls-codec-stateless.rst   | 833
>>>>>>>>> ++++++++++++++++++
>>>>>>>>>      .../media/v4l/ext-ctrls-codec.rst             | 780
>>>>>>>>> ----------------
>>>>>>>>>      .../media/v4l/pixfmt-compressed.rst           |   7 +-
>>>>>>>>>      .../media/v4l/vidioc-g-ext-ctrls.rst          |  20 +
>>>>>>>>>      .../media/v4l/vidioc-queryctrl.rst            |   8 +
>>>>>>>>>      .../media/videodev2.h.rst.exceptions          |   5 +
>>>>>>>>>      .../media/test-drivers/vivid/vivid-ctrls.c    |  15 +
>>>>>>>>>      drivers/media/v4l2-core/v4l2-ctrls-api.c      | 103 ++-
>>>>>>>>>      drivers/media/v4l2-core/v4l2-ctrls-core.c     | 198 ++++-
>>>>>>>>>      drivers/media/v4l2-core/v4l2-ctrls-defs.c     |  37 +-
>>>>>>>>>      drivers/media/v4l2-core/v4l2-ctrls-priv.h     |   3 +-
>>>>>>>>>      drivers/media/v4l2-core/v4l2-ctrls-request.c  |  13 +-
>>>>>>>>>      drivers/staging/media/hantro/hantro_drv.c     |  27 +-
>>>>>>>>>      drivers/staging/media/hantro/hantro_hevc.c    |   8 +-
>>>>>>>>>      drivers/staging/media/sunxi/cedrus/cedrus.c   |  24 +-
>>>>>>>>>      .../staging/media/sunxi/cedrus/cedrus_dec.c   |  10 +-
>>>>>>>>>      .../staging/media/sunxi/cedrus/cedrus_h265.c  |   2 +-
>>>>>>>>>      include/media/hevc-ctrls.h                    | 250 ------
>>>>>>>>>      include/media/v4l2-ctrls.h                    |  48 +-
>>>>>>>>>      include/uapi/linux/hantro-media.h             |  19 +
>>>>>>>>>      include/uapi/linux/v4l2-controls.h            | 439 +++++++++
>>>>>>>>>      include/uapi/linux/videodev2.h                |  13 +
>>>>>>>>>      23 files changed, 1697 insertions(+), 1170 deletions(-)
>>>>>>>>>      delete mode 100644 include/media/hevc-ctrls.h
>>>>>>>>>      create mode 100644 include/uapi/linux/hantro-media.h
>>>>>>>>>
Benjamin Gaignard April 6, 2022, 12:40 p.m. UTC | #9
Le 06/04/2022 à 14:28, Adam Ford a écrit :
> On Wed, Apr 6, 2022 at 1:56 AM Benjamin Gaignard
> <benjamin.gaignard@collabora.com> wrote:
>>
>> Le 05/04/2022 à 23:27, Adam Ford a écrit :
>>> On Mon, Apr 4, 2022 at 10:56 AM Benjamin Gaignard
>>> <benjamin.gaignard@collabora.com> wrote:
>>>> Le 02/04/2022 à 18:59, Adam Ford a écrit :
>>>>> On Sat, Apr 2, 2022 at 11:22 AM Adam Ford <aford173@gmail.com> wrote:
>>>>>> On Fri, Apr 1, 2022 at 8:18 AM Benjamin Gaignard
>>>>>> <benjamin.gaignard@collabora.com> wrote:
>>>>>>> Le 31/03/2022 à 08:53, Benjamin Gaignard a écrit :
>>>>>>>> Le 30/03/2022 à 20:52, Adam Ford a écrit :
>>>>>>>>> On Wed, Mar 30, 2022 at 2:53 AM Benjamin Gaignard
>>>>>>>>> <benjamin.gaignard@collabora.com> wrote:
>>>>>>>>>> Le 28/02/2022 à 15:08, Benjamin Gaignard a écrit :
>>>>>>>>>>> This series aims to make HEVC uapi stable and usable for hardware
>>>>>>>>>>> decoder. HEVC uapi is used by 2 mainlined drivers (Cedrus and Hantro)
>>>>>>>>>>> and 2 out of the tree drivers (rkvdec and RPI).
>>>>>>>>>>>
>>>>>>>>>>> After the remarks done on version 2, I have completely reworked to
>>>>>>>>>>> patches
>>>>>>>>>>> split so changelogs are meaningless. I have also drop "RFC" from the
>>>>>>>>>>> titles.
>>>>>>>>>>>
>>>>>>>>>>> Version 4:
>>>>>>>>>>> - Add num_entry_point_offsets field in  struct
>>>>>>>>>>> v4l2_ctrl_hevc_slice_params
>>>>>>>>>>> - Fix V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS name
>>>>>>>>>>> - Initialize control V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS
>>>>>>>>>>> - Fix space/tab issue in kernel-doc
>>>>>>>>>>> - Add patch to change data_bit_offset definition
>>>>>>>>>>> - Fix hantro-media SPDX license
>>>>>>>>>>> - put controls under stateless section in v4l2-ctrls-defs.c
>>>>>>>>>>>
>>>>>>>>>>> At the end fluster tests results on IMX8MQ is 77/147 for HEVC codec.
>>>>>>>>>> Dear reviewers,
>>>>>>>>>>
>>>>>>>>>> This series is waiting for your feedback,
>>>>>>>>> I tried several times with the suggested repos for both the kernel and
>>>>>>>>> g-streamer without success getting Fluster to pass any tests on the
>>>>>>>>> imx8mq.  I can try again but I likely won't get to it until this
>>>>>>>>> weekend.  If I can get it working, I'll test both the 8mq and 8mm.
>>>>>>>> Thanks a lot for that.
>>>>>>>>
>>>>>>>> Benjamin
>>>>>>> Adam,
>>>>>>>
>>>>>>> You may need to check if h265parse and v4l2slh265dec are available on your board.
>>>>>> I ran gst-inspect to see what showed up with 265 in the name.
>>>>>>
>>>>>> # gst-inspect-1.0 |grep 265
>>>>>> libav:  avdec_h265: libav HEVC (High Efficiency Video Coding) decoder
>>>>>> rtp:  rtph265depay: RTP H265 depayloader
>>>>>> rtp:  rtph265pay: RTP H265 payloader
>>>>>> typefindfunctions: video/x-h265: h265, x265, 265
>>>>>> v4l2codecs:  v4l2slh265dec: V4L2 Stateless H.265 Video Decoder
>>>>>> videoparsersbad:  h265parse: H.265 parser
>>>>>>
>>>>>> It appears I have both h265parse and v4l2slh265dec.
>>>>>>
>>>>>>> fluster check if v4l2slh265dec is working fine with this command line:
>>>>>>>
>>>>>>> gst-launch-1.0 appsrc num-buffers=0 ! h265parse ! v4l2slh265dec ! fakesink
>>>>>>>
>>>>>>> so if one of them is missing it won't work.
>>>>>> gst-launch-1.0 appsrc num-buffers=0 ! h265parse ! v4l2slh265dec ! fakesink
>>>>>> Setting pipeline to PAUSED ...
>>>>>> 0:00:00.098389938   526 0xaaaaf9d86ac0 ERROR     v4l2codecs-decoder
>>>>>> gstv4l2decoder.c:725:gst_v4l2_decoder_get_controls:<v4l2decoder2>
>>>>>> VIDIOC_G_EXT_CTRLS failed: Invalid argument
>>>>>> ERROR: from element
>>>>>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0: Driver did not
>>>>>> report framing and start code method.
>>>>>> Additional debug info:
>>>>>> ../subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech265dec.c(155):
>>>>>> gst_v4l2_codec_h265_dec_open ():
>>>>>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0:
>>>>>> gst_v4l2_decoder_get_controls() failed: Invalid argument
>>>>>> ERROR: pipeline doesn't want to preroll.
>>>>>> ERROR: from element
>>>>>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0: Could not
>>>>>> initialize supporting library.
>>>>>> Additional debug info:
>>>>>> ../subprojects/gst-plugins-base/gst-libs/gst/video/gstvideodecoder.c(2909):
>>>>>> gst_video_decoder_change_state ():
>>>>>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0:
>>>>>> Failed to open decoder
>>>>>> ERROR: pipeline doesn't want to preroll.
>>>>>> Failed to set pipeline to PAUSED.
>>>>>> Setting pipeline to NULL ...
>>>>>> Freeing pipeline ...
>>>>>>
>>>>>> Does this mean I have a wrong version of the kernel and/or incomplete patches?
>>>>> I double checked the branches.
>>>>>
>>>>> Kernel:
>>>>> https://gitlab.collabora.com/benjamin.gaignard/for-upstream.git
>>>>> branch:  origin/HEVC_UAPI_V4
>>>>>
>>>>> Gstreamer:
>>>>> https://gitlab.freedesktop.org/benjamin.gaignard1/gstreamer.git
>>>>> branch:  origin/benjamin.gaignard1/gstreamer-HEVC_aligned_with_kernel_5.15
>>>>>
>>>>>
>>>>> I am still not able to run h.265/HEVC tests.
>>>> Hello Adam,
>>>>
>>>> I have updated the following branches with the versions I have used today:
>>>>
>>>> Kernel:
>>>> https://gitlab.collabora.com/benjamin.gaignard/for-upstream.git
>>>> branch: origin/HEVC_UAPI_V5 only one change in documentation vs version 4 but rebased in v5.18-rc1
>>>>
>>>> Gstreamer:
>>>> https://gitlab.freedesktop.org/benjamin.gaignard1/gstreamer.git
>>>> branch:  origin/benjamin.gaignard1/gstreamer-HEVC_aligned_with_kernel_5.15 updated on the latest GST main branch
>>>>
>>>> I hope this will work fine this time.
>>> I wish I had better news for you:
>>>
>>> dmesg shows the hantro driver is being loaded:
>>>
>>> [   38.612243] hantro-vpu 38300000.video-codec: registered
>>> nxp,imx8mq-vpu-g1-dec as /dev/video0
>>> [   38.612618] hantro-vpu 38310000.video-codec: registered
>>> nxp,imx8mq-vpu-g2-dec as /dev/video1
>>>
>>> # gst-inspect-1.0 |grep 265
>>> libav:  avdec_h265: libav HEVC (High Efficiency Video Coding) decoder
>>> rtp:  rtph265depay: RTP H265 depayloader
>>> rtp:  rtph265pay: RTP H265 payloader
>>> typefindfunctions: video/x-h265: h265, x265, 265
>>> v4l2codecs:  v4l2slh265dec: V4L2 Stateless H.265 Video Decoder
>>> videoparsersbad:  h265parse: H.265 parser
>>>
>>> Fluster reports:
>>> GStreamer-H.265-V4L2SL-Gst1.0: GStreamer H.265 V4L2SL decoder for
>>> GStreamer 1.0... ❌
>> Still the same error about non supported control ?
> # gst-lagst-launch-1.0 appsrc num-buffers=0 ! h265parse !
> v4l2slh265dec ! fakesink
> Setting pipeline to PAUSED ...
> 0:00:01.704385508   420 0xaaaaec0a76c0 ERROR     v4l2codecs-decoder
> gstv4l2decoder.c:725:gst_v4l2_decoder_get_controls:<v4l2decoder2>
> VIDIOC_G_EXT_CTRLS failed: Invalid argument
> ERROR: from element
> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0: Driver did not
> report framing and start code method.
> Additional debug info:
> ../subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech265dec.c(155):
> gst_v4l2_codec_h265_dec_open ():
> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0:
> gst_v4l2_decoder_get_controls() failed: Invalid argument
> ERROR: pipeline doesn't want to preroll.
> ERROR: from element
> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0: Could not
> initialize supporting library.
> Additional debug info:
> ../subprojects/gst-plugins-base/gst-libs/gst/video/gstvideodecoder.c(2909):
> gst_video_decoder_change_state ():
> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0:
> Failed to open decoder
> ERROR: pipeline doesn't want to preroll.
> Failed to set pipeline to PAUSED.
> Setting pipeline to NULL ...
> Freeing pipeline ...

What is the result of v4l2-ctl ?
Here I have:
v4l2-ctl --all -d 1
Driver Info:
	Driver name      : hantro-vpu
	Card type        : nxp,imx8mq-vpu-g2-dec
	Bus info         : platform: hantro-vpu
	Driver version   : 5.18.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
Media Driver Info:
	Driver name      : hantro-vpu
	Model            : hantro-vpu
	Serial           :
	Bus info         : platform: hantro-vpu
	Media version    : 5.18.0
	Hardware revision: 0x00000000 (0)
	Driver version   : 5.18.0
Interface Info:
	ID               : 0x0300000c
	Type             : V4L Video
Entity Info:
	ID               : 0x00000001 (1)
	Name             : nxp,imx8mq-vpu-g2-dec-source
	Function         : V4L2 I/O
	Pad 0x01000002   : 0: Source
	  Link 0x02000008: to remote pad 0x1000004 of entity 'nxp,imx8mq-vpu-g2-dec-proc': Data, Enabled, Immutable
Priority: 2
Format Video Capture Multiplanar:
	Width/Height      : 48/48
	Pixel Format      : 'VT12' (Y/CbCr 4:2:0 (4x4 Linear))
	Field             : None
	Number of planes  : 1
	Flags             :
	Colorspace        : JPEG
	Transfer Function : Default
	YCbCr/HSV Encoding: Default
	Quantization      : Default
	Plane 0           :
	   Bytes per Line : 48
	   Size Image     : 3600
Format Video Output Multiplanar:
	Width/Height      : 48/48
	Pixel Format      : 'S265' (HEVC Parsed Slice Data)
	Field             : None
	Number of planes  : 1
	Flags             :
	Colorspace        : JPEG
	Transfer Function : Default
	YCbCr/HSV Encoding: Default
	Quantization      : Default
	Plane 0           :
	   Bytes per Line : 0
	   Size Image     : 4608

User Controls

hantro_hevc_slice_header_skip_b 0x00981a80 (int)    : min=0 max=256 step=1 default=0 value=0

Codec Controls

                    hevc_profile 0x00990b67 (menu)   : min=0 max=2 default=0 value=0
				0: Main
				1: Main Still Picture
				2: Main 10
                      hevc_level 0x00990b68 (menu)   : min=0 max=8 default=0 value=0
				0: 1
				1: 2
				2: 2.1
				3: 3
				4: 3.1
				5: 4
				6: 4.1
				7: 5
				8: 5.1

Stateless Codec Controls

     vp9_frame_decode_parameters 0x00a40a2c (unknown): type=261 flags=has-payload
       vp9_probabilities_updates 0x00a40a2d (unknown): type=260 flags=has-payload
     hevc_sequence_parameter_set 0x00a40a90 (unknown): type=270 flags=has-payload
      hevc_picture_parameter_set 0x00a40a91 (unknown): type=271 flags=has-payload
             hevc_scaling_matrix 0x00a40a93 (unknown): type=273 flags=has-payload
          hevc_decode_parameters 0x00a40a94 (unknown): type=274 flags=has-payload
                hevc_decode_mode 0x00a40a95 (menu)   : min=1 max=1 default=1 value=1
				1: Frame-Based
                 hevc_start_code 0x00a40a96 (menu)   : min=1 max=1 default=1 value=1
				1: Annex B Start Code

>
>> Benjamin
>>
>>> adam
>>>> Benjamin
>>>>
>>>>> adam
>>>>>> adam
>>>>>>> Regards,
>>>>>>> Benjamin
>>>>>>>
>>>>>>>>> adam
>>>>>>>>>> Thanks,
>>>>>>>>>> Benjamin
>>>>>>>>>>
>>>>>>>>>>> Benjamin
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Benjamin Gaignard (12):
>>>>>>>>>>>        media: uapi: HEVC: Add missing fields in HEVC controls
>>>>>>>>>>>        media: uapi: HEVC: Rename HEVC stateless controls with STATELESS
>>>>>>>>>>>          prefix
>>>>>>>>>>>        media: uapi: HEVC: Add document uAPI structure
>>>>>>>>>>>        media: uapi: HEVC: Define V4L2_CID_STATELESS_HEVC_SLICE_PARAMS
>>>>>>>>>>> as a
>>>>>>>>>>>          dynamic array
>>>>>>>>>>>        media: uapi: Move parsed HEVC pixel format out of staging
>>>>>>>>>>>        media: uapi: Add V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS
>>>>>>>>>>> control
>>>>>>>>>>>        media: uapi: Move the HEVC stateless control type out of staging
>>>>>>>>>>>        media: controls: Log HEVC stateless control in .std_log
>>>>>>>>>>>        media: uapi: Create a dedicated header for Hantro control
>>>>>>>>>>>        media: uapi: HEVC: fix padding in v4l2 control structures
>>>>>>>>>>>        media: uapi: Change data_bit_offset definition
>>>>>>>>>>>        media: uapi: move HEVC stateless controls out of staging
>>>>>>>>>>>
>>>>>>>>>>> Hans Verkuil (3):
>>>>>>>>>>>        videodev2.h: add V4L2_CTRL_FLAG_DYNAMIC_ARRAY
>>>>>>>>>>>        v4l2-ctrls: add support for dynamically allocated arrays.
>>>>>>>>>>>        vivid: add dynamic array test control
>>>>>>>>>>>
>>>>>>>>>>>       .../userspace-api/media/drivers/hantro.rst    |   5 -
>>>>>>>>>>>       .../media/v4l/ext-ctrls-codec-stateless.rst   | 833
>>>>>>>>>>> ++++++++++++++++++
>>>>>>>>>>>       .../media/v4l/ext-ctrls-codec.rst             | 780
>>>>>>>>>>> ----------------
>>>>>>>>>>>       .../media/v4l/pixfmt-compressed.rst           |   7 +-
>>>>>>>>>>>       .../media/v4l/vidioc-g-ext-ctrls.rst          |  20 +
>>>>>>>>>>>       .../media/v4l/vidioc-queryctrl.rst            |   8 +
>>>>>>>>>>>       .../media/videodev2.h.rst.exceptions          |   5 +
>>>>>>>>>>>       .../media/test-drivers/vivid/vivid-ctrls.c    |  15 +
>>>>>>>>>>>       drivers/media/v4l2-core/v4l2-ctrls-api.c      | 103 ++-
>>>>>>>>>>>       drivers/media/v4l2-core/v4l2-ctrls-core.c     | 198 ++++-
>>>>>>>>>>>       drivers/media/v4l2-core/v4l2-ctrls-defs.c     |  37 +-
>>>>>>>>>>>       drivers/media/v4l2-core/v4l2-ctrls-priv.h     |   3 +-
>>>>>>>>>>>       drivers/media/v4l2-core/v4l2-ctrls-request.c  |  13 +-
>>>>>>>>>>>       drivers/staging/media/hantro/hantro_drv.c     |  27 +-
>>>>>>>>>>>       drivers/staging/media/hantro/hantro_hevc.c    |   8 +-
>>>>>>>>>>>       drivers/staging/media/sunxi/cedrus/cedrus.c   |  24 +-
>>>>>>>>>>>       .../staging/media/sunxi/cedrus/cedrus_dec.c   |  10 +-
>>>>>>>>>>>       .../staging/media/sunxi/cedrus/cedrus_h265.c  |   2 +-
>>>>>>>>>>>       include/media/hevc-ctrls.h                    | 250 ------
>>>>>>>>>>>       include/media/v4l2-ctrls.h                    |  48 +-
>>>>>>>>>>>       include/uapi/linux/hantro-media.h             |  19 +
>>>>>>>>>>>       include/uapi/linux/v4l2-controls.h            | 439 +++++++++
>>>>>>>>>>>       include/uapi/linux/videodev2.h                |  13 +
>>>>>>>>>>>       23 files changed, 1697 insertions(+), 1170 deletions(-)
>>>>>>>>>>>       delete mode 100644 include/media/hevc-ctrls.h
>>>>>>>>>>>       create mode 100644 include/uapi/linux/hantro-media.h
>>>>>>>>>>>
Benjamin Gaignard April 6, 2022, 12:50 p.m. UTC | #10
Le 06/04/2022 à 14:46, Adam Ford a écrit :
> On Wed, Apr 6, 2022 at 7:41 AM Benjamin Gaignard
> <benjamin.gaignard@collabora.com> wrote:
>>
>> Le 06/04/2022 à 14:28, Adam Ford a écrit :
>>> On Wed, Apr 6, 2022 at 1:56 AM Benjamin Gaignard
>>> <benjamin.gaignard@collabora.com> wrote:
>>>> Le 05/04/2022 à 23:27, Adam Ford a écrit :
>>>>> On Mon, Apr 4, 2022 at 10:56 AM Benjamin Gaignard
>>>>> <benjamin.gaignard@collabora.com> wrote:
>>>>>> Le 02/04/2022 à 18:59, Adam Ford a écrit :
>>>>>>> On Sat, Apr 2, 2022 at 11:22 AM Adam Ford <aford173@gmail.com> wrote:
>>>>>>>> On Fri, Apr 1, 2022 at 8:18 AM Benjamin Gaignard
>>>>>>>> <benjamin.gaignard@collabora.com> wrote:
>>>>>>>>> Le 31/03/2022 à 08:53, Benjamin Gaignard a écrit :
>>>>>>>>>> Le 30/03/2022 à 20:52, Adam Ford a écrit :
>>>>>>>>>>> On Wed, Mar 30, 2022 at 2:53 AM Benjamin Gaignard
>>>>>>>>>>> <benjamin.gaignard@collabora.com> wrote:
>>>>>>>>>>>> Le 28/02/2022 à 15:08, Benjamin Gaignard a écrit :
>>>>>>>>>>>>> This series aims to make HEVC uapi stable and usable for hardware
>>>>>>>>>>>>> decoder. HEVC uapi is used by 2 mainlined drivers (Cedrus and Hantro)
>>>>>>>>>>>>> and 2 out of the tree drivers (rkvdec and RPI).
>>>>>>>>>>>>>
>>>>>>>>>>>>> After the remarks done on version 2, I have completely reworked to
>>>>>>>>>>>>> patches
>>>>>>>>>>>>> split so changelogs are meaningless. I have also drop "RFC" from the
>>>>>>>>>>>>> titles.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Version 4:
>>>>>>>>>>>>> - Add num_entry_point_offsets field in  struct
>>>>>>>>>>>>> v4l2_ctrl_hevc_slice_params
>>>>>>>>>>>>> - Fix V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS name
>>>>>>>>>>>>> - Initialize control V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS
>>>>>>>>>>>>> - Fix space/tab issue in kernel-doc
>>>>>>>>>>>>> - Add patch to change data_bit_offset definition
>>>>>>>>>>>>> - Fix hantro-media SPDX license
>>>>>>>>>>>>> - put controls under stateless section in v4l2-ctrls-defs.c
>>>>>>>>>>>>>
>>>>>>>>>>>>> At the end fluster tests results on IMX8MQ is 77/147 for HEVC codec.
>>>>>>>>>>>> Dear reviewers,
>>>>>>>>>>>>
>>>>>>>>>>>> This series is waiting for your feedback,
>>>>>>>>>>> I tried several times with the suggested repos for both the kernel and
>>>>>>>>>>> g-streamer without success getting Fluster to pass any tests on the
>>>>>>>>>>> imx8mq.  I can try again but I likely won't get to it until this
>>>>>>>>>>> weekend.  If I can get it working, I'll test both the 8mq and 8mm.
>>>>>>>>>> Thanks a lot for that.
>>>>>>>>>>
>>>>>>>>>> Benjamin
>>>>>>>>> Adam,
>>>>>>>>>
>>>>>>>>> You may need to check if h265parse and v4l2slh265dec are available on your board.
>>>>>>>> I ran gst-inspect to see what showed up with 265 in the name.
>>>>>>>>
>>>>>>>> # gst-inspect-1.0 |grep 265
>>>>>>>> libav:  avdec_h265: libav HEVC (High Efficiency Video Coding) decoder
>>>>>>>> rtp:  rtph265depay: RTP H265 depayloader
>>>>>>>> rtp:  rtph265pay: RTP H265 payloader
>>>>>>>> typefindfunctions: video/x-h265: h265, x265, 265
>>>>>>>> v4l2codecs:  v4l2slh265dec: V4L2 Stateless H.265 Video Decoder
>>>>>>>> videoparsersbad:  h265parse: H.265 parser
>>>>>>>>
>>>>>>>> It appears I have both h265parse and v4l2slh265dec.
>>>>>>>>
>>>>>>>>> fluster check if v4l2slh265dec is working fine with this command line:
>>>>>>>>>
>>>>>>>>> gst-launch-1.0 appsrc num-buffers=0 ! h265parse ! v4l2slh265dec ! fakesink
>>>>>>>>>
>>>>>>>>> so if one of them is missing it won't work.
>>>>>>>> gst-launch-1.0 appsrc num-buffers=0 ! h265parse ! v4l2slh265dec ! fakesink
>>>>>>>> Setting pipeline to PAUSED ...
>>>>>>>> 0:00:00.098389938   526 0xaaaaf9d86ac0 ERROR     v4l2codecs-decoder
>>>>>>>> gstv4l2decoder.c:725:gst_v4l2_decoder_get_controls:<v4l2decoder2>
>>>>>>>> VIDIOC_G_EXT_CTRLS failed: Invalid argument
>>>>>>>> ERROR: from element
>>>>>>>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0: Driver did not
>>>>>>>> report framing and start code method.
>>>>>>>> Additional debug info:
>>>>>>>> ../subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech265dec.c(155):
>>>>>>>> gst_v4l2_codec_h265_dec_open ():
>>>>>>>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0:
>>>>>>>> gst_v4l2_decoder_get_controls() failed: Invalid argument
>>>>>>>> ERROR: pipeline doesn't want to preroll.
>>>>>>>> ERROR: from element
>>>>>>>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0: Could not
>>>>>>>> initialize supporting library.
>>>>>>>> Additional debug info:
>>>>>>>> ../subprojects/gst-plugins-base/gst-libs/gst/video/gstvideodecoder.c(2909):
>>>>>>>> gst_video_decoder_change_state ():
>>>>>>>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0:
>>>>>>>> Failed to open decoder
>>>>>>>> ERROR: pipeline doesn't want to preroll.
>>>>>>>> Failed to set pipeline to PAUSED.
>>>>>>>> Setting pipeline to NULL ...
>>>>>>>> Freeing pipeline ...
>>>>>>>>
>>>>>>>> Does this mean I have a wrong version of the kernel and/or incomplete patches?
>>>>>>> I double checked the branches.
>>>>>>>
>>>>>>> Kernel:
>>>>>>> https://gitlab.collabora.com/benjamin.gaignard/for-upstream.git
>>>>>>> branch:  origin/HEVC_UAPI_V4
>>>>>>>
>>>>>>> Gstreamer:
>>>>>>> https://gitlab.freedesktop.org/benjamin.gaignard1/gstreamer.git
>>>>>>> branch:  origin/benjamin.gaignard1/gstreamer-HEVC_aligned_with_kernel_5.15
>>>>>>>
>>>>>>>
>>>>>>> I am still not able to run h.265/HEVC tests.
>>>>>> Hello Adam,
>>>>>>
>>>>>> I have updated the following branches with the versions I have used today:
>>>>>>
>>>>>> Kernel:
>>>>>> https://gitlab.collabora.com/benjamin.gaignard/for-upstream.git
>>>>>> branch: origin/HEVC_UAPI_V5 only one change in documentation vs version 4 but rebased in v5.18-rc1
>>>>>>
>>>>>> Gstreamer:
>>>>>> https://gitlab.freedesktop.org/benjamin.gaignard1/gstreamer.git
>>>>>> branch:  origin/benjamin.gaignard1/gstreamer-HEVC_aligned_with_kernel_5.15 updated on the latest GST main branch
>>>>>>
>>>>>> I hope this will work fine this time.
>>>>> I wish I had better news for you:
>>>>>
>>>>> dmesg shows the hantro driver is being loaded:
>>>>>
>>>>> [   38.612243] hantro-vpu 38300000.video-codec: registered
>>>>> nxp,imx8mq-vpu-g1-dec as /dev/video0
>>>>> [   38.612618] hantro-vpu 38310000.video-codec: registered
>>>>> nxp,imx8mq-vpu-g2-dec as /dev/video1
>>>>>
>>>>> # gst-inspect-1.0 |grep 265
>>>>> libav:  avdec_h265: libav HEVC (High Efficiency Video Coding) decoder
>>>>> rtp:  rtph265depay: RTP H265 depayloader
>>>>> rtp:  rtph265pay: RTP H265 payloader
>>>>> typefindfunctions: video/x-h265: h265, x265, 265
>>>>> v4l2codecs:  v4l2slh265dec: V4L2 Stateless H.265 Video Decoder
>>>>> videoparsersbad:  h265parse: H.265 parser
>>>>>
>>>>> Fluster reports:
>>>>> GStreamer-H.265-V4L2SL-Gst1.0: GStreamer H.265 V4L2SL decoder for
>>>>> GStreamer 1.0... ❌
>>>> Still the same error about non supported control ?
>>> # gst-lagst-launch-1.0 appsrc num-buffers=0 ! h265parse !
>>> v4l2slh265dec ! fakesink
>>> Setting pipeline to PAUSED ...
>>> 0:00:01.704385508   420 0xaaaaec0a76c0 ERROR     v4l2codecs-decoder
>>> gstv4l2decoder.c:725:gst_v4l2_decoder_get_controls:<v4l2decoder2>
>>> VIDIOC_G_EXT_CTRLS failed: Invalid argument
>>> ERROR: from element
>>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0: Driver did not
>>> report framing and start code method.
>>> Additional debug info:
>>> ../subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech265dec.c(155):
>>> gst_v4l2_codec_h265_dec_open ():
>>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0:
>>> gst_v4l2_decoder_get_controls() failed: Invalid argument
>>> ERROR: pipeline doesn't want to preroll.
>>> ERROR: from element
>>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0: Could not
>>> initialize supporting library.
>>> Additional debug info:
>>> ../subprojects/gst-plugins-base/gst-libs/gst/video/gstvideodecoder.c(2909):
>>> gst_video_decoder_change_state ():
>>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0:
>>> Failed to open decoder
>>> ERROR: pipeline doesn't want to preroll.
>>> Failed to set pipeline to PAUSED.
>>> Setting pipeline to NULL ...
>>> Freeing pipeline ...
>> What is the result of v4l2-ctl ?
>> Here I have:
>> v4l2-ctl --all -d 1
>> Driver Info:
>>          Driver name      : hantro-vpu
>>          Card type        : nxp,imx8mq-vpu-g2-dec
>>          Bus info         : platform: hantro-vpu
>>          Driver version   : 5.18.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
>> Media Driver Info:
>>          Driver name      : hantro-vpu
>>          Model            : hantro-vpu
>>          Serial           :
>>          Bus info         : platform: hantro-vpu
>>          Media version    : 5.18.0
>>          Hardware revision: 0x00000000 (0)
>>          Driver version   : 5.18.0
>> Interface Info:
>>          ID               : 0x0300000c
>>          Type             : V4L Video
>> Entity Info:
>>          ID               : 0x00000001 (1)
>>          Name             : nxp,imx8mq-vpu-g2-dec-source
>>          Function         : V4L2 I/O
>>          Pad 0x01000002   : 0: Source
>>            Link 0x02000008: to remote pad 0x1000004 of entity 'nxp,imx8mq-vpu-g2-dec-proc': Data, Enabled, Immutable
>> Priority: 2
>> Format Video Capture Multiplanar:
>>          Width/Height      : 48/48
>>          Pixel Format      : 'VT12' (Y/CbCr 4:2:0 (4x4 Linear))
>>          Field             : None
>>          Number of planes  : 1
>>          Flags             :
>>          Colorspace        : JPEG
>>          Transfer Function : Default
>>          YCbCr/HSV Encoding: Default
>>          Quantization      : Default
>>          Plane 0           :
>>             Bytes per Line : 48
>>             Size Image     : 3600
>> Format Video Output Multiplanar:
>>          Width/Height      : 48/48
>>          Pixel Format      : 'S265' (HEVC Parsed Slice Data)
>>          Field             : None
>>          Number of planes  : 1
>>          Flags             :
>>          Colorspace        : JPEG
>>          Transfer Function : Default
>>          YCbCr/HSV Encoding: Default
>>          Quantization      : Default
>>          Plane 0           :
>>             Bytes per Line : 0
>>             Size Image     : 4608
>>
>> User Controls
>>
>> hantro_hevc_slice_header_skip_b 0x00981a80 (int)    : min=0 max=256 step=1 default=0 value=0
>>
>> Codec Controls
>>
>>                      hevc_profile 0x00990b67 (menu)   : min=0 max=2 default=0 value=0
>>                                  0: Main
>>                                  1: Main Still Picture
>>                                  2: Main 10
>>                        hevc_level 0x00990b68 (menu)   : min=0 max=8 default=0 value=0
>>                                  0: 1
>>                                  1: 2
>>                                  2: 2.1
>>                                  3: 3
>>                                  4: 3.1
>>                                  5: 4
>>                                  6: 4.1
>>                                  7: 5
>>                                  8: 5.1
>>
>> Stateless Codec Controls
>>
>>       vp9_frame_decode_parameters 0x00a40a2c (unknown): type=261 flags=has-payload
>>         vp9_probabilities_updates 0x00a40a2d (unknown): type=260 flags=has-payload
>>       hevc_sequence_parameter_set 0x00a40a90 (unknown): type=270 flags=has-payload
>>        hevc_picture_parameter_set 0x00a40a91 (unknown): type=271 flags=has-payload
>>               hevc_scaling_matrix 0x00a40a93 (unknown): type=273 flags=has-payload
>>            hevc_decode_parameters 0x00a40a94 (unknown): type=274 flags=has-payload
>>                  hevc_decode_mode 0x00a40a95 (menu)   : min=1 max=1 default=1 value=1
>>                                  1: Frame-Based
>>                   hevc_start_code 0x00a40a96 (menu)   : min=1 max=1 default=1 value=1
>>                                  1: Annex B Start Code
>>
> Mine looks like:
>
> # v4l2-ctl --all -d 1
> Driver Info:
> Driver name      : hantro-vpu
> Card type        : nxp,imx8mq-vpu-g2-dec
> Bus info         : platform: hantro-vpu
> Driver version   : 5.18.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
> Media Driver Info:
> Driver name      : hantro-vpu
> Model            : hantro-vpu
> Serial           :
> Bus info         : platform: hantro-vpu
> Media version    : 5.18.0
> Hardware revision: 0x00000000 (0)
> Driver version   : 5.18.0
> Interface Info:
> ID               : 0x0300000c
> Type             : V4L Video
> Entity Info:
> ID               : 0x00000001 (1)
> Name             : nxp,imx8mq-vpu-g2-dec-source
> Function         : V4L2 I/O
> Pad 0x01000002   : 0: Source
>    Link 0x02000008: to remote pad 0x1000004 of entity
> 'nxp,imx8mq-vpu-g2-dec-proc': Data, Enabled, Immutable
> Priority: 2
> Format Video Capture Multiplanar:
> Width/Height      : 48/48
> Pixel Format      : 'VT12' (Y/CbCr 4:2:0 (4x4 Linear))
> Field             : None
> Number of planes  : 1
> Flags             :
> Colorspace        : JPEG
> Transfer Function : Default
> YCbCr/HSV Encoding: Default
> Quantization      : Default
> Plane 0           :
>     Bytes per Line : 48
>     Size Image     : 3600
> Format Video Output Multiplanar:
> Width/Height      : 48/48
> Pixel Format      : 'S265' (HEVC Parsed Slice Data)
> Field             : None
> Number of planes  : 1
> Flags             :
> Colorspace        : JPEG
> Transfer Function : Default
> YCbCr/HSV Encoding: Default
> Quantization      : Default
> Plane 0           :
>     Bytes per Line : 0
>     Size Image     : 4608
>
> User Controls
>
> hantro_hevc_slice_header_skip_b 0x00981a80 (int)    : min=0 max=256
> step=1 default=0 value=0
>
> Codec Controls
>
>                     hevc_profile 0x00990b67 (menu)   : min=0 max=2
> default=0 value=0
> 0: Main
> 1: Main Still Picture
> 2: Main 10
>                       hevc_level 0x00990b68 (menu)   : min=0 max=8
> default=0 value=0
> 0: 1
> 1: 2
> 2: 2.1
> 3: 3
> 4: 3.1
> 5: 4
> 6: 4.1
> 7: 5
> 8: 5.1
>
> Stateless Codec Controls
>
>      vp9_frame_decode_parameters 0x00a40a2c (unknown): type=261 flags=has-payload
>        vp9_probabilities_updates 0x00a40a2d (unknown): type=260 flags=has-payload
>      hevc_sequence_parameter_set 0x00a40a90 (unknown): type=270 flags=has-payload
>       hevc_picture_parameter_set 0x00a40a91 (unknown): type=271 flags=has-payload
>              hevc_scaling_matrix 0x00a40a93 (unknown): type=273 flags=has-payload
>           hevc_decode_parameters 0x00a40a94 (unknown): type=274 flags=has-payload
>                 hevc_decode_mode 0x00a40a95 (menu)   : min=1 max=1
> default=1 value=1
> 1: Frame-Based
>                  hevc_start_code 0x00a40a96 (menu)   : min=1 max=1
> default=1 value=1
> 1: Annex B Start Code

It is the same so that suggest the issue is coming from GStreamer plugin.

>
>>>> Benjamin
>>>>
>>>>> adam
>>>>>> Benjamin
>>>>>>
>>>>>>> adam
>>>>>>>> adam
>>>>>>>>> Regards,
>>>>>>>>> Benjamin
>>>>>>>>>
>>>>>>>>>>> adam
>>>>>>>>>>>> Thanks,
>>>>>>>>>>>> Benjamin
>>>>>>>>>>>>
>>>>>>>>>>>>> Benjamin
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Benjamin Gaignard (12):
>>>>>>>>>>>>>         media: uapi: HEVC: Add missing fields in HEVC controls
>>>>>>>>>>>>>         media: uapi: HEVC: Rename HEVC stateless controls with STATELESS
>>>>>>>>>>>>>           prefix
>>>>>>>>>>>>>         media: uapi: HEVC: Add document uAPI structure
>>>>>>>>>>>>>         media: uapi: HEVC: Define V4L2_CID_STATELESS_HEVC_SLICE_PARAMS
>>>>>>>>>>>>> as a
>>>>>>>>>>>>>           dynamic array
>>>>>>>>>>>>>         media: uapi: Move parsed HEVC pixel format out of staging
>>>>>>>>>>>>>         media: uapi: Add V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS
>>>>>>>>>>>>> control
>>>>>>>>>>>>>         media: uapi: Move the HEVC stateless control type out of staging
>>>>>>>>>>>>>         media: controls: Log HEVC stateless control in .std_log
>>>>>>>>>>>>>         media: uapi: Create a dedicated header for Hantro control
>>>>>>>>>>>>>         media: uapi: HEVC: fix padding in v4l2 control structures
>>>>>>>>>>>>>         media: uapi: Change data_bit_offset definition
>>>>>>>>>>>>>         media: uapi: move HEVC stateless controls out of staging
>>>>>>>>>>>>>
>>>>>>>>>>>>> Hans Verkuil (3):
>>>>>>>>>>>>>         videodev2.h: add V4L2_CTRL_FLAG_DYNAMIC_ARRAY
>>>>>>>>>>>>>         v4l2-ctrls: add support for dynamically allocated arrays.
>>>>>>>>>>>>>         vivid: add dynamic array test control
>>>>>>>>>>>>>
>>>>>>>>>>>>>        .../userspace-api/media/drivers/hantro.rst    |   5 -
>>>>>>>>>>>>>        .../media/v4l/ext-ctrls-codec-stateless.rst   | 833
>>>>>>>>>>>>> ++++++++++++++++++
>>>>>>>>>>>>>        .../media/v4l/ext-ctrls-codec.rst             | 780
>>>>>>>>>>>>> ----------------
>>>>>>>>>>>>>        .../media/v4l/pixfmt-compressed.rst           |   7 +-
>>>>>>>>>>>>>        .../media/v4l/vidioc-g-ext-ctrls.rst          |  20 +
>>>>>>>>>>>>>        .../media/v4l/vidioc-queryctrl.rst            |   8 +
>>>>>>>>>>>>>        .../media/videodev2.h.rst.exceptions          |   5 +
>>>>>>>>>>>>>        .../media/test-drivers/vivid/vivid-ctrls.c    |  15 +
>>>>>>>>>>>>>        drivers/media/v4l2-core/v4l2-ctrls-api.c      | 103 ++-
>>>>>>>>>>>>>        drivers/media/v4l2-core/v4l2-ctrls-core.c     | 198 ++++-
>>>>>>>>>>>>>        drivers/media/v4l2-core/v4l2-ctrls-defs.c     |  37 +-
>>>>>>>>>>>>>        drivers/media/v4l2-core/v4l2-ctrls-priv.h     |   3 +-
>>>>>>>>>>>>>        drivers/media/v4l2-core/v4l2-ctrls-request.c  |  13 +-
>>>>>>>>>>>>>        drivers/staging/media/hantro/hantro_drv.c     |  27 +-
>>>>>>>>>>>>>        drivers/staging/media/hantro/hantro_hevc.c    |   8 +-
>>>>>>>>>>>>>        drivers/staging/media/sunxi/cedrus/cedrus.c   |  24 +-
>>>>>>>>>>>>>        .../staging/media/sunxi/cedrus/cedrus_dec.c   |  10 +-
>>>>>>>>>>>>>        .../staging/media/sunxi/cedrus/cedrus_h265.c  |   2 +-
>>>>>>>>>>>>>        include/media/hevc-ctrls.h                    | 250 ------
>>>>>>>>>>>>>        include/media/v4l2-ctrls.h                    |  48 +-
>>>>>>>>>>>>>        include/uapi/linux/hantro-media.h             |  19 +
>>>>>>>>>>>>>        include/uapi/linux/v4l2-controls.h            | 439 +++++++++
>>>>>>>>>>>>>        include/uapi/linux/videodev2.h                |  13 +
>>>>>>>>>>>>>        23 files changed, 1697 insertions(+), 1170 deletions(-)
>>>>>>>>>>>>>        delete mode 100644 include/media/hevc-ctrls.h
>>>>>>>>>>>>>        create mode 100644 include/uapi/linux/hantro-media.h
>>>>>>>>>>>>>
Adam Ford April 6, 2022, 12:55 p.m. UTC | #11
On Wed, Apr 6, 2022 at 7:50 AM Benjamin Gaignard
<benjamin.gaignard@collabora.com> wrote:
>
>
> Le 06/04/2022 à 14:46, Adam Ford a écrit :
> > On Wed, Apr 6, 2022 at 7:41 AM Benjamin Gaignard
> > <benjamin.gaignard@collabora.com> wrote:
> >>
> >> Le 06/04/2022 à 14:28, Adam Ford a écrit :
> >>> On Wed, Apr 6, 2022 at 1:56 AM Benjamin Gaignard
> >>> <benjamin.gaignard@collabora.com> wrote:
> >>>> Le 05/04/2022 à 23:27, Adam Ford a écrit :
> >>>>> On Mon, Apr 4, 2022 at 10:56 AM Benjamin Gaignard
> >>>>> <benjamin.gaignard@collabora.com> wrote:
> >>>>>> Le 02/04/2022 à 18:59, Adam Ford a écrit :
> >>>>>>> On Sat, Apr 2, 2022 at 11:22 AM Adam Ford <aford173@gmail.com> wrote:
> >>>>>>>> On Fri, Apr 1, 2022 at 8:18 AM Benjamin Gaignard
> >>>>>>>> <benjamin.gaignard@collabora.com> wrote:
> >>>>>>>>> Le 31/03/2022 à 08:53, Benjamin Gaignard a écrit :
> >>>>>>>>>> Le 30/03/2022 à 20:52, Adam Ford a écrit :
> >>>>>>>>>>> On Wed, Mar 30, 2022 at 2:53 AM Benjamin Gaignard
> >>>>>>>>>>> <benjamin.gaignard@collabora.com> wrote:
> >>>>>>>>>>>> Le 28/02/2022 à 15:08, Benjamin Gaignard a écrit :
> >>>>>>>>>>>>> This series aims to make HEVC uapi stable and usable for hardware
> >>>>>>>>>>>>> decoder. HEVC uapi is used by 2 mainlined drivers (Cedrus and Hantro)
> >>>>>>>>>>>>> and 2 out of the tree drivers (rkvdec and RPI).
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> After the remarks done on version 2, I have completely reworked to
> >>>>>>>>>>>>> patches
> >>>>>>>>>>>>> split so changelogs are meaningless. I have also drop "RFC" from the
> >>>>>>>>>>>>> titles.
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> Version 4:
> >>>>>>>>>>>>> - Add num_entry_point_offsets field in  struct
> >>>>>>>>>>>>> v4l2_ctrl_hevc_slice_params
> >>>>>>>>>>>>> - Fix V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS name
> >>>>>>>>>>>>> - Initialize control V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS
> >>>>>>>>>>>>> - Fix space/tab issue in kernel-doc
> >>>>>>>>>>>>> - Add patch to change data_bit_offset definition
> >>>>>>>>>>>>> - Fix hantro-media SPDX license
> >>>>>>>>>>>>> - put controls under stateless section in v4l2-ctrls-defs.c
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> At the end fluster tests results on IMX8MQ is 77/147 for HEVC codec.
> >>>>>>>>>>>> Dear reviewers,
> >>>>>>>>>>>>
> >>>>>>>>>>>> This series is waiting for your feedback,
> >>>>>>>>>>> I tried several times with the suggested repos for both the kernel and
> >>>>>>>>>>> g-streamer without success getting Fluster to pass any tests on the
> >>>>>>>>>>> imx8mq.  I can try again but I likely won't get to it until this
> >>>>>>>>>>> weekend.  If I can get it working, I'll test both the 8mq and 8mm.
> >>>>>>>>>> Thanks a lot for that.
> >>>>>>>>>>
> >>>>>>>>>> Benjamin
> >>>>>>>>> Adam,
> >>>>>>>>>
> >>>>>>>>> You may need to check if h265parse and v4l2slh265dec are available on your board.
> >>>>>>>> I ran gst-inspect to see what showed up with 265 in the name.
> >>>>>>>>
> >>>>>>>> # gst-inspect-1.0 |grep 265
> >>>>>>>> libav:  avdec_h265: libav HEVC (High Efficiency Video Coding) decoder
> >>>>>>>> rtp:  rtph265depay: RTP H265 depayloader
> >>>>>>>> rtp:  rtph265pay: RTP H265 payloader
> >>>>>>>> typefindfunctions: video/x-h265: h265, x265, 265
> >>>>>>>> v4l2codecs:  v4l2slh265dec: V4L2 Stateless H.265 Video Decoder
> >>>>>>>> videoparsersbad:  h265parse: H.265 parser
> >>>>>>>>
> >>>>>>>> It appears I have both h265parse and v4l2slh265dec.
> >>>>>>>>
> >>>>>>>>> fluster check if v4l2slh265dec is working fine with this command line:
> >>>>>>>>>
> >>>>>>>>> gst-launch-1.0 appsrc num-buffers=0 ! h265parse ! v4l2slh265dec ! fakesink
> >>>>>>>>>
> >>>>>>>>> so if one of them is missing it won't work.
> >>>>>>>> gst-launch-1.0 appsrc num-buffers=0 ! h265parse ! v4l2slh265dec ! fakesink
> >>>>>>>> Setting pipeline to PAUSED ...
> >>>>>>>> 0:00:00.098389938   526 0xaaaaf9d86ac0 ERROR     v4l2codecs-decoder
> >>>>>>>> gstv4l2decoder.c:725:gst_v4l2_decoder_get_controls:<v4l2decoder2>
> >>>>>>>> VIDIOC_G_EXT_CTRLS failed: Invalid argument
> >>>>>>>> ERROR: from element
> >>>>>>>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0: Driver did not
> >>>>>>>> report framing and start code method.
> >>>>>>>> Additional debug info:
> >>>>>>>> ../subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech265dec.c(155):
> >>>>>>>> gst_v4l2_codec_h265_dec_open ():
> >>>>>>>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0:
> >>>>>>>> gst_v4l2_decoder_get_controls() failed: Invalid argument
> >>>>>>>> ERROR: pipeline doesn't want to preroll.
> >>>>>>>> ERROR: from element
> >>>>>>>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0: Could not
> >>>>>>>> initialize supporting library.
> >>>>>>>> Additional debug info:
> >>>>>>>> ../subprojects/gst-plugins-base/gst-libs/gst/video/gstvideodecoder.c(2909):
> >>>>>>>> gst_video_decoder_change_state ():
> >>>>>>>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0:
> >>>>>>>> Failed to open decoder
> >>>>>>>> ERROR: pipeline doesn't want to preroll.
> >>>>>>>> Failed to set pipeline to PAUSED.
> >>>>>>>> Setting pipeline to NULL ...
> >>>>>>>> Freeing pipeline ...
> >>>>>>>>
> >>>>>>>> Does this mean I have a wrong version of the kernel and/or incomplete patches?
> >>>>>>> I double checked the branches.
> >>>>>>>
> >>>>>>> Kernel:
> >>>>>>> https://gitlab.collabora.com/benjamin.gaignard/for-upstream.git
> >>>>>>> branch:  origin/HEVC_UAPI_V4
> >>>>>>>
> >>>>>>> Gstreamer:
> >>>>>>> https://gitlab.freedesktop.org/benjamin.gaignard1/gstreamer.git
> >>>>>>> branch:  origin/benjamin.gaignard1/gstreamer-HEVC_aligned_with_kernel_5.15
> >>>>>>>
> >>>>>>>
> >>>>>>> I am still not able to run h.265/HEVC tests.
> >>>>>> Hello Adam,
> >>>>>>
> >>>>>> I have updated the following branches with the versions I have used today:
> >>>>>>
> >>>>>> Kernel:
> >>>>>> https://gitlab.collabora.com/benjamin.gaignard/for-upstream.git
> >>>>>> branch: origin/HEVC_UAPI_V5 only one change in documentation vs version 4 but rebased in v5.18-rc1
> >>>>>>
> >>>>>> Gstreamer:
> >>>>>> https://gitlab.freedesktop.org/benjamin.gaignard1/gstreamer.git
> >>>>>> branch:  origin/benjamin.gaignard1/gstreamer-HEVC_aligned_with_kernel_5.15 updated on the latest GST main branch
> >>>>>>
> >>>>>> I hope this will work fine this time.
> >>>>> I wish I had better news for you:
> >>>>>
> >>>>> dmesg shows the hantro driver is being loaded:
> >>>>>
> >>>>> [   38.612243] hantro-vpu 38300000.video-codec: registered
> >>>>> nxp,imx8mq-vpu-g1-dec as /dev/video0
> >>>>> [   38.612618] hantro-vpu 38310000.video-codec: registered
> >>>>> nxp,imx8mq-vpu-g2-dec as /dev/video1
> >>>>>
> >>>>> # gst-inspect-1.0 |grep 265
> >>>>> libav:  avdec_h265: libav HEVC (High Efficiency Video Coding) decoder
> >>>>> rtp:  rtph265depay: RTP H265 depayloader
> >>>>> rtp:  rtph265pay: RTP H265 payloader
> >>>>> typefindfunctions: video/x-h265: h265, x265, 265
> >>>>> v4l2codecs:  v4l2slh265dec: V4L2 Stateless H.265 Video Decoder
> >>>>> videoparsersbad:  h265parse: H.265 parser
> >>>>>
> >>>>> Fluster reports:
> >>>>> GStreamer-H.265-V4L2SL-Gst1.0: GStreamer H.265 V4L2SL decoder for
> >>>>> GStreamer 1.0... ❌
> >>>> Still the same error about non supported control ?
> >>> # gst-lagst-launch-1.0 appsrc num-buffers=0 ! h265parse !
> >>> v4l2slh265dec ! fakesink
> >>> Setting pipeline to PAUSED ...
> >>> 0:00:01.704385508   420 0xaaaaec0a76c0 ERROR     v4l2codecs-decoder
> >>> gstv4l2decoder.c:725:gst_v4l2_decoder_get_controls:<v4l2decoder2>
> >>> VIDIOC_G_EXT_CTRLS failed: Invalid argument
> >>> ERROR: from element
> >>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0: Driver did not
> >>> report framing and start code method.
> >>> Additional debug info:
> >>> ../subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech265dec.c(155):
> >>> gst_v4l2_codec_h265_dec_open ():
> >>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0:
> >>> gst_v4l2_decoder_get_controls() failed: Invalid argument
> >>> ERROR: pipeline doesn't want to preroll.
> >>> ERROR: from element
> >>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0: Could not
> >>> initialize supporting library.
> >>> Additional debug info:
> >>> ../subprojects/gst-plugins-base/gst-libs/gst/video/gstvideodecoder.c(2909):
> >>> gst_video_decoder_change_state ():
> >>> /GstPipeline:pipeline0/v4l2slh265dec:v4l2slh265dec0:
> >>> Failed to open decoder
> >>> ERROR: pipeline doesn't want to preroll.
> >>> Failed to set pipeline to PAUSED.
> >>> Setting pipeline to NULL ...
> >>> Freeing pipeline ...
> >> What is the result of v4l2-ctl ?
> >> Here I have:
> >> v4l2-ctl --all -d 1
> >> Driver Info:
> >>          Driver name      : hantro-vpu
> >>          Card type        : nxp,imx8mq-vpu-g2-dec
> >>          Bus info         : platform: hantro-vpu
> >>          Driver version   : 5.18.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
> >> Media Driver Info:
> >>          Driver name      : hantro-vpu
> >>          Model            : hantro-vpu
> >>          Serial           :
> >>          Bus info         : platform: hantro-vpu
> >>          Media version    : 5.18.0
> >>          Hardware revision: 0x00000000 (0)
> >>          Driver version   : 5.18.0
> >> Interface Info:
> >>          ID               : 0x0300000c
> >>          Type             : V4L Video
> >> Entity Info:
> >>          ID               : 0x00000001 (1)
> >>          Name             : nxp,imx8mq-vpu-g2-dec-source
> >>          Function         : V4L2 I/O
> >>          Pad 0x01000002   : 0: Source
> >>            Link 0x02000008: to remote pad 0x1000004 of entity 'nxp,imx8mq-vpu-g2-dec-proc': Data, Enabled, Immutable
> >> Priority: 2
> >> Format Video Capture Multiplanar:
> >>          Width/Height      : 48/48
> >>          Pixel Format      : 'VT12' (Y/CbCr 4:2:0 (4x4 Linear))
> >>          Field             : None
> >>          Number of planes  : 1
> >>          Flags             :
> >>          Colorspace        : JPEG
> >>          Transfer Function : Default
> >>          YCbCr/HSV Encoding: Default
> >>          Quantization      : Default
> >>          Plane 0           :
> >>             Bytes per Line : 48
> >>             Size Image     : 3600
> >> Format Video Output Multiplanar:
> >>          Width/Height      : 48/48
> >>          Pixel Format      : 'S265' (HEVC Parsed Slice Data)
> >>          Field             : None
> >>          Number of planes  : 1
> >>          Flags             :
> >>          Colorspace        : JPEG
> >>          Transfer Function : Default
> >>          YCbCr/HSV Encoding: Default
> >>          Quantization      : Default
> >>          Plane 0           :
> >>             Bytes per Line : 0
> >>             Size Image     : 4608
> >>
> >> User Controls
> >>
> >> hantro_hevc_slice_header_skip_b 0x00981a80 (int)    : min=0 max=256 step=1 default=0 value=0
> >>
> >> Codec Controls
> >>
> >>                      hevc_profile 0x00990b67 (menu)   : min=0 max=2 default=0 value=0
> >>                                  0: Main
> >>                                  1: Main Still Picture
> >>                                  2: Main 10
> >>                        hevc_level 0x00990b68 (menu)   : min=0 max=8 default=0 value=0
> >>                                  0: 1
> >>                                  1: 2
> >>                                  2: 2.1
> >>                                  3: 3
> >>                                  4: 3.1
> >>                                  5: 4
> >>                                  6: 4.1
> >>                                  7: 5
> >>                                  8: 5.1
> >>
> >> Stateless Codec Controls
> >>
> >>       vp9_frame_decode_parameters 0x00a40a2c (unknown): type=261 flags=has-payload
> >>         vp9_probabilities_updates 0x00a40a2d (unknown): type=260 flags=has-payload
> >>       hevc_sequence_parameter_set 0x00a40a90 (unknown): type=270 flags=has-payload
> >>        hevc_picture_parameter_set 0x00a40a91 (unknown): type=271 flags=has-payload
> >>               hevc_scaling_matrix 0x00a40a93 (unknown): type=273 flags=has-payload
> >>            hevc_decode_parameters 0x00a40a94 (unknown): type=274 flags=has-payload
> >>                  hevc_decode_mode 0x00a40a95 (menu)   : min=1 max=1 default=1 value=1
> >>                                  1: Frame-Based
> >>                   hevc_start_code 0x00a40a96 (menu)   : min=1 max=1 default=1 value=1
> >>                                  1: Annex B Start Code
> >>
> > Mine looks like:
> >
> > # v4l2-ctl --all -d 1
> > Driver Info:
> > Driver name      : hantro-vpu
> > Card type        : nxp,imx8mq-vpu-g2-dec
> > Bus info         : platform: hantro-vpu
> > Driver version   : 5.18.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
> > Media Driver Info:
> > Driver name      : hantro-vpu
> > Model            : hantro-vpu
> > Serial           :
> > Bus info         : platform: hantro-vpu
> > Media version    : 5.18.0
> > Hardware revision: 0x00000000 (0)
> > Driver version   : 5.18.0
> > Interface Info:
> > ID               : 0x0300000c
> > Type             : V4L Video
> > Entity Info:
> > ID               : 0x00000001 (1)
> > Name             : nxp,imx8mq-vpu-g2-dec-source
> > Function         : V4L2 I/O
> > Pad 0x01000002   : 0: Source
> >    Link 0x02000008: to remote pad 0x1000004 of entity
> > 'nxp,imx8mq-vpu-g2-dec-proc': Data, Enabled, Immutable
> > Priority: 2
> > Format Video Capture Multiplanar:
> > Width/Height      : 48/48
> > Pixel Format      : 'VT12' (Y/CbCr 4:2:0 (4x4 Linear))
> > Field             : None
> > Number of planes  : 1
> > Flags             :
> > Colorspace        : JPEG
> > Transfer Function : Default
> > YCbCr/HSV Encoding: Default
> > Quantization      : Default
> > Plane 0           :
> >     Bytes per Line : 48
> >     Size Image     : 3600
> > Format Video Output Multiplanar:
> > Width/Height      : 48/48
> > Pixel Format      : 'S265' (HEVC Parsed Slice Data)
> > Field             : None
> > Number of planes  : 1
> > Flags             :
> > Colorspace        : JPEG
> > Transfer Function : Default
> > YCbCr/HSV Encoding: Default
> > Quantization      : Default
> > Plane 0           :
> >     Bytes per Line : 0
> >     Size Image     : 4608
> >
> > User Controls
> >
> > hantro_hevc_slice_header_skip_b 0x00981a80 (int)    : min=0 max=256
> > step=1 default=0 value=0
> >
> > Codec Controls
> >
> >                     hevc_profile 0x00990b67 (menu)   : min=0 max=2
> > default=0 value=0
> > 0: Main
> > 1: Main Still Picture
> > 2: Main 10
> >                       hevc_level 0x00990b68 (menu)   : min=0 max=8
> > default=0 value=0
> > 0: 1
> > 1: 2
> > 2: 2.1
> > 3: 3
> > 4: 3.1
> > 5: 4
> > 6: 4.1
> > 7: 5
> > 8: 5.1
> >
> > Stateless Codec Controls
> >
> >      vp9_frame_decode_parameters 0x00a40a2c (unknown): type=261 flags=has-payload
> >        vp9_probabilities_updates 0x00a40a2d (unknown): type=260 flags=has-payload
> >      hevc_sequence_parameter_set 0x00a40a90 (unknown): type=270 flags=has-payload
> >       hevc_picture_parameter_set 0x00a40a91 (unknown): type=271 flags=has-payload
> >              hevc_scaling_matrix 0x00a40a93 (unknown): type=273 flags=has-payload
> >           hevc_decode_parameters 0x00a40a94 (unknown): type=274 flags=has-payload
> >                 hevc_decode_mode 0x00a40a95 (menu)   : min=1 max=1
> > default=1 value=1
> > 1: Frame-Based
> >                  hevc_start_code 0x00a40a96 (menu)   : min=1 max=1
> > default=1 value=1
> > 1: Annex B Start Code
>
> It is the same so that suggest the issue is coming from GStreamer plugin.

Do I need to build Gtreamer in a special way?  I just invoked  meson
then ninja, but I didn't pass any additional parameters other than the
build directory name.

adam
>
> >
> >>>> Benjamin
> >>>>
> >>>>> adam
> >>>>>> Benjamin
> >>>>>>
> >>>>>>> adam
> >>>>>>>> adam
> >>>>>>>>> Regards,
> >>>>>>>>> Benjamin
> >>>>>>>>>
> >>>>>>>>>>> adam
> >>>>>>>>>>>> Thanks,
> >>>>>>>>>>>> Benjamin
> >>>>>>>>>>>>
> >>>>>>>>>>>>> Benjamin
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> Benjamin Gaignard (12):
> >>>>>>>>>>>>>         media: uapi: HEVC: Add missing fields in HEVC controls
> >>>>>>>>>>>>>         media: uapi: HEVC: Rename HEVC stateless controls with STATELESS
> >>>>>>>>>>>>>           prefix
> >>>>>>>>>>>>>         media: uapi: HEVC: Add document uAPI structure
> >>>>>>>>>>>>>         media: uapi: HEVC: Define V4L2_CID_STATELESS_HEVC_SLICE_PARAMS
> >>>>>>>>>>>>> as a
> >>>>>>>>>>>>>           dynamic array
> >>>>>>>>>>>>>         media: uapi: Move parsed HEVC pixel format out of staging
> >>>>>>>>>>>>>         media: uapi: Add V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS
> >>>>>>>>>>>>> control
> >>>>>>>>>>>>>         media: uapi: Move the HEVC stateless control type out of staging
> >>>>>>>>>>>>>         media: controls: Log HEVC stateless control in .std_log
> >>>>>>>>>>>>>         media: uapi: Create a dedicated header for Hantro control
> >>>>>>>>>>>>>         media: uapi: HEVC: fix padding in v4l2 control structures
> >>>>>>>>>>>>>         media: uapi: Change data_bit_offset definition
> >>>>>>>>>>>>>         media: uapi: move HEVC stateless controls out of staging
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> Hans Verkuil (3):
> >>>>>>>>>>>>>         videodev2.h: add V4L2_CTRL_FLAG_DYNAMIC_ARRAY
> >>>>>>>>>>>>>         v4l2-ctrls: add support for dynamically allocated arrays.
> >>>>>>>>>>>>>         vivid: add dynamic array test control
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>        .../userspace-api/media/drivers/hantro.rst    |   5 -
> >>>>>>>>>>>>>        .../media/v4l/ext-ctrls-codec-stateless.rst   | 833
> >>>>>>>>>>>>> ++++++++++++++++++
> >>>>>>>>>>>>>        .../media/v4l/ext-ctrls-codec.rst             | 780
> >>>>>>>>>>>>> ----------------
> >>>>>>>>>>>>>        .../media/v4l/pixfmt-compressed.rst           |   7 +-
> >>>>>>>>>>>>>        .../media/v4l/vidioc-g-ext-ctrls.rst          |  20 +
> >>>>>>>>>>>>>        .../media/v4l/vidioc-queryctrl.rst            |   8 +
> >>>>>>>>>>>>>        .../media/videodev2.h.rst.exceptions          |   5 +
> >>>>>>>>>>>>>        .../media/test-drivers/vivid/vivid-ctrls.c    |  15 +
> >>>>>>>>>>>>>        drivers/media/v4l2-core/v4l2-ctrls-api.c      | 103 ++-
> >>>>>>>>>>>>>        drivers/media/v4l2-core/v4l2-ctrls-core.c     | 198 ++++-
> >>>>>>>>>>>>>        drivers/media/v4l2-core/v4l2-ctrls-defs.c     |  37 +-
> >>>>>>>>>>>>>        drivers/media/v4l2-core/v4l2-ctrls-priv.h     |   3 +-
> >>>>>>>>>>>>>        drivers/media/v4l2-core/v4l2-ctrls-request.c  |  13 +-
> >>>>>>>>>>>>>        drivers/staging/media/hantro/hantro_drv.c     |  27 +-
> >>>>>>>>>>>>>        drivers/staging/media/hantro/hantro_hevc.c    |   8 +-
> >>>>>>>>>>>>>        drivers/staging/media/sunxi/cedrus/cedrus.c   |  24 +-
> >>>>>>>>>>>>>        .../staging/media/sunxi/cedrus/cedrus_dec.c   |  10 +-
> >>>>>>>>>>>>>        .../staging/media/sunxi/cedrus/cedrus_h265.c  |   2 +-
> >>>>>>>>>>>>>        include/media/hevc-ctrls.h                    | 250 ------
> >>>>>>>>>>>>>        include/media/v4l2-ctrls.h                    |  48 +-
> >>>>>>>>>>>>>        include/uapi/linux/hantro-media.h             |  19 +
> >>>>>>>>>>>>>        include/uapi/linux/v4l2-controls.h            | 439 +++++++++
> >>>>>>>>>>>>>        include/uapi/linux/videodev2.h                |  13 +
> >>>>>>>>>>>>>        23 files changed, 1697 insertions(+), 1170 deletions(-)
> >>>>>>>>>>>>>        delete mode 100644 include/media/hevc-ctrls.h
> >>>>>>>>>>>>>        create mode 100644 include/uapi/linux/hantro-media.h
> >>>>>>>>>>>>>
Nicolas Dufresne April 6, 2022, 1:02 p.m. UTC | #12
Le mercredi 06 avril 2022 à 14:50 +0200, Benjamin Gaignard a écrit :
> > default=1 value=1
> > 1: Frame-Based
> >                   hevc_start_code 0x00a40a96 (menu)   : min=1 max=1
> > default=1 value=1
> > 1: Annex B Start Code
> 
> It is the same so that suggest the issue is coming from GStreamer plugin.

Can you report the GStreamer commit hash you have building on ? Also please
validate the creation date of the plugin (libgstv4l2codecs.so) against your
source update date. Reminder that GStreamer is now mono-repo (just in case).

https://gitlab.freedesktop.org/benjamin.gaignard1/gstreamer/-/tree/HEVC_aligned_with_kernel_5.15
Hash: 54b7c1f98084c85d103446cc3f2edce42ad53b0f

Benjamin, can you confirm you have no local changes and this is the hash you are
building from ?

regards,
Nicolas
Benjamin Gaignard April 6, 2022, 1:05 p.m. UTC | #13
Le 06/04/2022 à 15:02, Nicolas Dufresne a écrit :
> Le mercredi 06 avril 2022 à 14:50 +0200, Benjamin Gaignard a écrit :
>>> default=1 value=1
>>> 1: Frame-Based
>>>                    hevc_start_code 0x00a40a96 (menu)   : min=1 max=1
>>> default=1 value=1
>>> 1: Annex B Start Code
>> It is the same so that suggest the issue is coming from GStreamer plugin.
> Can you report the GStreamer commit hash you have building on ? Also please
> validate the creation date of the plugin (libgstv4l2codecs.so) against your
> source update date. Reminder that GStreamer is now mono-repo (just in case).
>
> https://gitlab.freedesktop.org/benjamin.gaignard1/gstreamer/-/tree/HEVC_aligned_with_kernel_5.15
> Hash: 54b7c1f98084c85d103446cc3f2edce42ad53b0f
>
> Benjamin, can you confirm you have no local changes and this is the hash you are
> building from ?

Yes that is the hash I'm using without local changes

Benjamin

>
> regards,
> Nicolas
>
Adam Ford April 6, 2022, 1:34 p.m. UTC | #14
On Wed, Apr 6, 2022 at 8:05 AM Benjamin Gaignard
<benjamin.gaignard@collabora.com> wrote:
>
>
> Le 06/04/2022 à 15:02, Nicolas Dufresne a écrit :
> > Le mercredi 06 avril 2022 à 14:50 +0200, Benjamin Gaignard a écrit :
> >>> default=1 value=1
> >>> 1: Frame-Based
> >>>                    hevc_start_code 0x00a40a96 (menu)   : min=1 max=1
> >>> default=1 value=1
> >>> 1: Annex B Start Code
> >> It is the same so that suggest the issue is coming from GStreamer plugin.
> > Can you report the GStreamer commit hash you have building on ? Also please
> > validate the creation date of the plugin (libgstv4l2codecs.so) against your
> > source update date. Reminder that GStreamer is now mono-repo (just in case).
> >
> > https://gitlab.freedesktop.org/benjamin.gaignard1/gstreamer/-/tree/HEVC_aligned_with_kernel_5.15
> > Hash: 54b7c1f98084c85d103446cc3f2edce42ad53b0f
> >
> > Benjamin, can you confirm you have no local changes and this is the hash you are
> > building from ?
>
> Yes that is the hash I'm using without local changes

I was on (gstreamer-HEVC_aligned_with_kernel_5.15) with a hash of
4b78eaa48c0c924afd57f85c47396b77497e69f8

Benjamin's hash wasn't listed before, but I did a git pull, and now it is.

I've checked out that hash, and I am rebuilding it now. I'll report my
findings when it's done.  It's building on the imx8mq, so it may take
some time.

adam

>
> Benjamin
>
> >
> > regards,
> > Nicolas
> >