mbox series

[libdrm,v2,00/25] Update Tegra support

Message ID 20220217191625.2534521-1-thierry.reding@gmail.com (mailing list archive)
Headers show
Series Update Tegra support | expand

Message

Thierry Reding Feb. 17, 2022, 7:16 p.m. UTC
From: Thierry Reding <treding@nvidia.com>

Hi all,

this is the userspace part of the kernel patches that were recently
merged into drm-next:

  https://patchwork.freedesktop.org/series/92378/

The goal is to provide a userspace implementation of the UAPI exposed by
the kernel and show its usage in some test programs that can also be
used for basic sanity testing. More complete userspace implementations
are available here:

  * https://github.com/cyndis/vaapi-tegra-driver
  * https://github.com/grate-driver/xf86-video-opentegra
  * https://github.com/grate-driver/grate

Changes in v2:
- implement vic_clear() as a helper using ->fill() (Michał Mirosław)
- rebase and fix a couple of Meson errors/warnings

Thierry

Thierry Reding (25):
  tegra: Indent according to .editorconfig
  tegra: Remove unused IOCTL implementations
  tegra: Extract common buffer object allocation code
  tegra: Fix mmap() of GEM buffer objects
  tegra: Add flink helpers
  tegra: Add PRIME support helpers
  tegra: Make API more consistent
  tegra: Install tegra-openclose test
  tegra: Update for new UABI
  tegra: Include private.h in list of source files
  tegra: Add channel APIs
  tegra: Add job and push buffer APIs
  tegra: Add syncpoint APIs
  tests: tegra: Add helper library for tests
  tests: tegra: Add gr2d-fill test
  tests: tegra: Add syncpt-wait test
  tests: tegra: Add syncpoint timeout test
  tests: tegra: Add VIC support
  tests: tegra: Add VIC 3.0 support
  tests: tegra: Add VIC 4.0 support
  tests: tegra: Add VIC 4.1 support
  tests: tegra: Add VIC 4.2 support
  tests: tegra: Add VIC clear test
  tests: tegra: Add VIC blit test
  tests: tegra: Add VIC flip test

 include/drm/tegra_drm.h      | 429 +++++++++++++++++++++++--
 tegra/channel.c              | 195 ++++++++++++
 tegra/job.c                  | 187 +++++++++++
 tegra/meson.build            |   7 +-
 tegra/private.h              |  85 ++++-
 tegra/pushbuf.c              | 184 +++++++++++
 tegra/syncpt.c               | 101 ++++++
 tegra/tegra-symbols.txt      |  27 +-
 tegra/tegra.c                | 386 +++++++++++-----------
 tegra/tegra.h                |  95 +++++-
 tests/tegra/.gitignore       |   3 +-
 tests/tegra/drm-test-tegra.c | 147 +++++++++
 tests/tegra/drm-test-tegra.h |  55 ++++
 tests/tegra/drm-test.c       | 248 +++++++++++++++
 tests/tegra/drm-test.h       |  72 +++++
 tests/tegra/gr2d-fill.c      | 146 +++++++++
 tests/tegra/host1x.h         |  34 ++
 tests/tegra/meson.build      |  88 +++++-
 tests/tegra/openclose.c      |  52 +--
 tests/tegra/syncpt-timeout.c | 163 ++++++++++
 tests/tegra/syncpt-wait.c    | 151 +++++++++
 tests/tegra/vic-blit.c       | 333 +++++++++++++++++++
 tests/tegra/vic-clear.c      | 173 ++++++++++
 tests/tegra/vic-flip.c       | 333 +++++++++++++++++++
 tests/tegra/vic.c            | 184 +++++++++++
 tests/tegra/vic.h            | 181 +++++++++++
 tests/tegra/vic30.c          | 458 +++++++++++++++++++++++++++
 tests/tegra/vic30.h          | 439 ++++++++++++++++++++++++++
 tests/tegra/vic40.c          | 370 ++++++++++++++++++++++
 tests/tegra/vic40.h          | 285 +++++++++++++++++
 tests/tegra/vic41.c          | 374 ++++++++++++++++++++++
 tests/tegra/vic41.h          | 372 ++++++++++++++++++++++
 tests/tegra/vic42.c          | 374 ++++++++++++++++++++++
 tests/tegra/vic42.h          | 597 +++++++++++++++++++++++++++++++++++
 34 files changed, 7068 insertions(+), 260 deletions(-)
 create mode 100644 tegra/channel.c
 create mode 100644 tegra/job.c
 create mode 100644 tegra/pushbuf.c
 create mode 100644 tegra/syncpt.c
 create mode 100644 tests/tegra/drm-test-tegra.c
 create mode 100644 tests/tegra/drm-test-tegra.h
 create mode 100644 tests/tegra/drm-test.c
 create mode 100644 tests/tegra/drm-test.h
 create mode 100644 tests/tegra/gr2d-fill.c
 create mode 100644 tests/tegra/host1x.h
 create mode 100644 tests/tegra/syncpt-timeout.c
 create mode 100644 tests/tegra/syncpt-wait.c
 create mode 100644 tests/tegra/vic-blit.c
 create mode 100644 tests/tegra/vic-clear.c
 create mode 100644 tests/tegra/vic-flip.c
 create mode 100644 tests/tegra/vic.c
 create mode 100644 tests/tegra/vic.h
 create mode 100644 tests/tegra/vic30.c
 create mode 100644 tests/tegra/vic30.h
 create mode 100644 tests/tegra/vic40.c
 create mode 100644 tests/tegra/vic40.h
 create mode 100644 tests/tegra/vic41.c
 create mode 100644 tests/tegra/vic41.h
 create mode 100644 tests/tegra/vic42.c
 create mode 100644 tests/tegra/vic42.h

Comments

Dmitry Osipenko Feb. 17, 2022, 8:02 p.m. UTC | #1
17.02.2022 22:16, Thierry Reding пишет:
> From: Thierry Reding <treding@nvidia.com>
> 
> Hi all,
> 
> this is the userspace part of the kernel patches that were recently
> merged into drm-next:
> 
>   https://patchwork.freedesktop.org/series/92378/
> 
> The goal is to provide a userspace implementation of the UAPI exposed by
> the kernel and show its usage in some test programs that can also be
> used for basic sanity testing. More complete userspace implementations
> are available here:
> 
>   * https://github.com/cyndis/vaapi-tegra-driver
>   * https://github.com/grate-driver/xf86-video-opentegra
>   * https://github.com/grate-driver/grate
> 
> Changes in v2:
> - implement vic_clear() as a helper using ->fill() (Michał Mirosław)
> - rebase and fix a couple of Meson errors/warnings
> 
> Thierry
> 
> Thierry Reding (25):
>   tegra: Indent according to .editorconfig
>   tegra: Remove unused IOCTL implementations
>   tegra: Extract common buffer object allocation code
>   tegra: Fix mmap() of GEM buffer objects
>   tegra: Add flink helpers
>   tegra: Add PRIME support helpers
>   tegra: Make API more consistent
>   tegra: Install tegra-openclose test
>   tegra: Update for new UABI
>   tegra: Include private.h in list of source files
>   tegra: Add channel APIs
>   tegra: Add job and push buffer APIs
>   tegra: Add syncpoint APIs
>   tests: tegra: Add helper library for tests
>   tests: tegra: Add gr2d-fill test
>   tests: tegra: Add syncpt-wait test
>   tests: tegra: Add syncpoint timeout test
>   tests: tegra: Add VIC support
>   tests: tegra: Add VIC 3.0 support
>   tests: tegra: Add VIC 4.0 support
>   tests: tegra: Add VIC 4.1 support
>   tests: tegra: Add VIC 4.2 support
>   tests: tegra: Add VIC clear test
>   tests: tegra: Add VIC blit test
>   tests: tegra: Add VIC flip test
> 
>  include/drm/tegra_drm.h      | 429 +++++++++++++++++++++++--
>  tegra/channel.c              | 195 ++++++++++++
>  tegra/job.c                  | 187 +++++++++++
>  tegra/meson.build            |   7 +-
>  tegra/private.h              |  85 ++++-
>  tegra/pushbuf.c              | 184 +++++++++++
>  tegra/syncpt.c               | 101 ++++++
>  tegra/tegra-symbols.txt      |  27 +-
>  tegra/tegra.c                | 386 +++++++++++-----------
>  tegra/tegra.h                |  95 +++++-
>  tests/tegra/.gitignore       |   3 +-
>  tests/tegra/drm-test-tegra.c | 147 +++++++++
>  tests/tegra/drm-test-tegra.h |  55 ++++
>  tests/tegra/drm-test.c       | 248 +++++++++++++++
>  tests/tegra/drm-test.h       |  72 +++++
>  tests/tegra/gr2d-fill.c      | 146 +++++++++
>  tests/tegra/host1x.h         |  34 ++
>  tests/tegra/meson.build      |  88 +++++-
>  tests/tegra/openclose.c      |  52 +--
>  tests/tegra/syncpt-timeout.c | 163 ++++++++++
>  tests/tegra/syncpt-wait.c    | 151 +++++++++
>  tests/tegra/vic-blit.c       | 333 +++++++++++++++++++
>  tests/tegra/vic-clear.c      | 173 ++++++++++
>  tests/tegra/vic-flip.c       | 333 +++++++++++++++++++
>  tests/tegra/vic.c            | 184 +++++++++++
>  tests/tegra/vic.h            | 181 +++++++++++
>  tests/tegra/vic30.c          | 458 +++++++++++++++++++++++++++
>  tests/tegra/vic30.h          | 439 ++++++++++++++++++++++++++
>  tests/tegra/vic40.c          | 370 ++++++++++++++++++++++
>  tests/tegra/vic40.h          | 285 +++++++++++++++++
>  tests/tegra/vic41.c          | 374 ++++++++++++++++++++++
>  tests/tegra/vic41.h          | 372 ++++++++++++++++++++++
>  tests/tegra/vic42.c          | 374 ++++++++++++++++++++++
>  tests/tegra/vic42.h          | 597 +++++++++++++++++++++++++++++++++++
>  34 files changed, 7068 insertions(+), 260 deletions(-)


Why do we need these tests in libdrm? Why not IGT?
Thierry Reding Feb. 17, 2022, 9:37 p.m. UTC | #2
On Thu, Feb 17, 2022 at 11:02:53PM +0300, Dmitry Osipenko wrote:
> 17.02.2022 22:16, Thierry Reding пишет:
> > From: Thierry Reding <treding@nvidia.com>
> > 
> > Hi all,
> > 
> > this is the userspace part of the kernel patches that were recently
> > merged into drm-next:
> > 
> >   https://patchwork.freedesktop.org/series/92378/
> > 
> > The goal is to provide a userspace implementation of the UAPI exposed by
> > the kernel and show its usage in some test programs that can also be
> > used for basic sanity testing. More complete userspace implementations
> > are available here:
> > 
> >   * https://github.com/cyndis/vaapi-tegra-driver
> >   * https://github.com/grate-driver/xf86-video-opentegra
> >   * https://github.com/grate-driver/grate
> > 
> > Changes in v2:
> > - implement vic_clear() as a helper using ->fill() (Michał Mirosław)
> > - rebase and fix a couple of Meson errors/warnings
> > 
> > Thierry
> > 
> > Thierry Reding (25):
> >   tegra: Indent according to .editorconfig
> >   tegra: Remove unused IOCTL implementations
> >   tegra: Extract common buffer object allocation code
> >   tegra: Fix mmap() of GEM buffer objects
> >   tegra: Add flink helpers
> >   tegra: Add PRIME support helpers
> >   tegra: Make API more consistent
> >   tegra: Install tegra-openclose test
> >   tegra: Update for new UABI
> >   tegra: Include private.h in list of source files
> >   tegra: Add channel APIs
> >   tegra: Add job and push buffer APIs
> >   tegra: Add syncpoint APIs
> >   tests: tegra: Add helper library for tests
> >   tests: tegra: Add gr2d-fill test
> >   tests: tegra: Add syncpt-wait test
> >   tests: tegra: Add syncpoint timeout test
> >   tests: tegra: Add VIC support
> >   tests: tegra: Add VIC 3.0 support
> >   tests: tegra: Add VIC 4.0 support
> >   tests: tegra: Add VIC 4.1 support
> >   tests: tegra: Add VIC 4.2 support
> >   tests: tegra: Add VIC clear test
> >   tests: tegra: Add VIC blit test
> >   tests: tegra: Add VIC flip test
> > 
> >  include/drm/tegra_drm.h      | 429 +++++++++++++++++++++++--
> >  tegra/channel.c              | 195 ++++++++++++
> >  tegra/job.c                  | 187 +++++++++++
> >  tegra/meson.build            |   7 +-
> >  tegra/private.h              |  85 ++++-
> >  tegra/pushbuf.c              | 184 +++++++++++
> >  tegra/syncpt.c               | 101 ++++++
> >  tegra/tegra-symbols.txt      |  27 +-
> >  tegra/tegra.c                | 386 +++++++++++-----------
> >  tegra/tegra.h                |  95 +++++-
> >  tests/tegra/.gitignore       |   3 +-
> >  tests/tegra/drm-test-tegra.c | 147 +++++++++
> >  tests/tegra/drm-test-tegra.h |  55 ++++
> >  tests/tegra/drm-test.c       | 248 +++++++++++++++
> >  tests/tegra/drm-test.h       |  72 +++++
> >  tests/tegra/gr2d-fill.c      | 146 +++++++++
> >  tests/tegra/host1x.h         |  34 ++
> >  tests/tegra/meson.build      |  88 +++++-
> >  tests/tegra/openclose.c      |  52 +--
> >  tests/tegra/syncpt-timeout.c | 163 ++++++++++
> >  tests/tegra/syncpt-wait.c    | 151 +++++++++
> >  tests/tegra/vic-blit.c       | 333 +++++++++++++++++++
> >  tests/tegra/vic-clear.c      | 173 ++++++++++
> >  tests/tegra/vic-flip.c       | 333 +++++++++++++++++++
> >  tests/tegra/vic.c            | 184 +++++++++++
> >  tests/tegra/vic.h            | 181 +++++++++++
> >  tests/tegra/vic30.c          | 458 +++++++++++++++++++++++++++
> >  tests/tegra/vic30.h          | 439 ++++++++++++++++++++++++++
> >  tests/tegra/vic40.c          | 370 ++++++++++++++++++++++
> >  tests/tegra/vic40.h          | 285 +++++++++++++++++
> >  tests/tegra/vic41.c          | 374 ++++++++++++++++++++++
> >  tests/tegra/vic41.h          | 372 ++++++++++++++++++++++
> >  tests/tegra/vic42.c          | 374 ++++++++++++++++++++++
> >  tests/tegra/vic42.h          | 597 +++++++++++++++++++++++++++++++++++
> >  34 files changed, 7068 insertions(+), 260 deletions(-)
> 
> 
> Why do we need these tests in libdrm? Why not IGT?

Oops, sorry. I had meant to reply to your question in the previous
version. The idea was to have this minimal set of tests in libdrm as a
way to demonstrate how to use the various APIs. At the same time, this
is meant to serve as an easy way to validate that everything works from
the comparatively simple libdrm package.

But yes, adding more tests on top of this to IGT is something that I've
been pondering and I certainly wouldn't object if anyone else was going
to attempt to do so. I don't think IGT and libdrm need to be mutually
exclusive, though.

Thierry
Mikko Perttunen Feb. 18, 2022, 9:31 a.m. UTC | #3
On 2/17/22 21:16, Thierry Reding wrote:
> ...

Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>

Left one cosmetic comment in the VIC4.0 patch, but overall looks OK. I 
think it would be fine to have some basic tests in libdrm as well.

Cheers,
Mikko
Dmitry Osipenko Feb. 18, 2022, 2:16 p.m. UTC | #4
18.02.2022 00:37, Thierry Reding пишет:
> On Thu, Feb 17, 2022 at 11:02:53PM +0300, Dmitry Osipenko wrote:
>> 17.02.2022 22:16, Thierry Reding пишет:
>>> From: Thierry Reding <treding@nvidia.com>
>>>
>>> Hi all,
>>>
>>> this is the userspace part of the kernel patches that were recently
>>> merged into drm-next:
>>>
>>>   https://patchwork.freedesktop.org/series/92378/
>>>
>>> The goal is to provide a userspace implementation of the UAPI exposed by
>>> the kernel and show its usage in some test programs that can also be
>>> used for basic sanity testing. More complete userspace implementations
>>> are available here:
>>>
>>>   * https://github.com/cyndis/vaapi-tegra-driver
>>>   * https://github.com/grate-driver/xf86-video-opentegra
>>>   * https://github.com/grate-driver/grate
>>>
>>> Changes in v2:
>>> - implement vic_clear() as a helper using ->fill() (Michał Mirosław)
>>> - rebase and fix a couple of Meson errors/warnings
>>>
>>> Thierry
>>>
>>> Thierry Reding (25):
>>>   tegra: Indent according to .editorconfig
>>>   tegra: Remove unused IOCTL implementations
>>>   tegra: Extract common buffer object allocation code
>>>   tegra: Fix mmap() of GEM buffer objects
>>>   tegra: Add flink helpers
>>>   tegra: Add PRIME support helpers
>>>   tegra: Make API more consistent
>>>   tegra: Install tegra-openclose test
>>>   tegra: Update for new UABI
>>>   tegra: Include private.h in list of source files
>>>   tegra: Add channel APIs
>>>   tegra: Add job and push buffer APIs
>>>   tegra: Add syncpoint APIs
>>>   tests: tegra: Add helper library for tests
>>>   tests: tegra: Add gr2d-fill test
>>>   tests: tegra: Add syncpt-wait test
>>>   tests: tegra: Add syncpoint timeout test
>>>   tests: tegra: Add VIC support
>>>   tests: tegra: Add VIC 3.0 support
>>>   tests: tegra: Add VIC 4.0 support
>>>   tests: tegra: Add VIC 4.1 support
>>>   tests: tegra: Add VIC 4.2 support
>>>   tests: tegra: Add VIC clear test
>>>   tests: tegra: Add VIC blit test
>>>   tests: tegra: Add VIC flip test
>>>
>>>  include/drm/tegra_drm.h      | 429 +++++++++++++++++++++++--
>>>  tegra/channel.c              | 195 ++++++++++++
>>>  tegra/job.c                  | 187 +++++++++++
>>>  tegra/meson.build            |   7 +-
>>>  tegra/private.h              |  85 ++++-
>>>  tegra/pushbuf.c              | 184 +++++++++++
>>>  tegra/syncpt.c               | 101 ++++++
>>>  tegra/tegra-symbols.txt      |  27 +-
>>>  tegra/tegra.c                | 386 +++++++++++-----------
>>>  tegra/tegra.h                |  95 +++++-
>>>  tests/tegra/.gitignore       |   3 +-
>>>  tests/tegra/drm-test-tegra.c | 147 +++++++++
>>>  tests/tegra/drm-test-tegra.h |  55 ++++
>>>  tests/tegra/drm-test.c       | 248 +++++++++++++++
>>>  tests/tegra/drm-test.h       |  72 +++++
>>>  tests/tegra/gr2d-fill.c      | 146 +++++++++
>>>  tests/tegra/host1x.h         |  34 ++
>>>  tests/tegra/meson.build      |  88 +++++-
>>>  tests/tegra/openclose.c      |  52 +--
>>>  tests/tegra/syncpt-timeout.c | 163 ++++++++++
>>>  tests/tegra/syncpt-wait.c    | 151 +++++++++
>>>  tests/tegra/vic-blit.c       | 333 +++++++++++++++++++
>>>  tests/tegra/vic-clear.c      | 173 ++++++++++
>>>  tests/tegra/vic-flip.c       | 333 +++++++++++++++++++
>>>  tests/tegra/vic.c            | 184 +++++++++++
>>>  tests/tegra/vic.h            | 181 +++++++++++
>>>  tests/tegra/vic30.c          | 458 +++++++++++++++++++++++++++
>>>  tests/tegra/vic30.h          | 439 ++++++++++++++++++++++++++
>>>  tests/tegra/vic40.c          | 370 ++++++++++++++++++++++
>>>  tests/tegra/vic40.h          | 285 +++++++++++++++++
>>>  tests/tegra/vic41.c          | 374 ++++++++++++++++++++++
>>>  tests/tegra/vic41.h          | 372 ++++++++++++++++++++++
>>>  tests/tegra/vic42.c          | 374 ++++++++++++++++++++++
>>>  tests/tegra/vic42.h          | 597 +++++++++++++++++++++++++++++++++++
>>>  34 files changed, 7068 insertions(+), 260 deletions(-)
>>
>>
>> Why do we need these tests in libdrm? Why not IGT?
> 
> Oops, sorry. I had meant to reply to your question in the previous
> version. The idea was to have this minimal set of tests in libdrm as a
> way to demonstrate how to use the various APIs. At the same time, this
> is meant to serve as an easy way to validate that everything works from
> the comparatively simple libdrm package.

Who will be validating libdrm on Tegra?

> But yes, adding more tests on top of this to IGT is something that I've
> been pondering and I certainly wouldn't object if anyone else was going
> to attempt to do so. I don't think IGT and libdrm need to be mutually
> exclusive, though.

I know that IGT tests are regularly run by the KernelCI at least on TK1.
Dmitry Osipenko Feb. 18, 2022, 7:49 p.m. UTC | #5
18.02.2022 17:16, Dmitry Osipenko пишет:
> 18.02.2022 00:37, Thierry Reding пишет:
>> On Thu, Feb 17, 2022 at 11:02:53PM +0300, Dmitry Osipenko wrote:
>>> 17.02.2022 22:16, Thierry Reding пишет:
>>>> From: Thierry Reding <treding@nvidia.com>
>>>>
>>>> Hi all,
>>>>
>>>> this is the userspace part of the kernel patches that were recently
>>>> merged into drm-next:
>>>>
>>>>   https://patchwork.freedesktop.org/series/92378/
>>>>
>>>> The goal is to provide a userspace implementation of the UAPI exposed by
>>>> the kernel and show its usage in some test programs that can also be
>>>> used for basic sanity testing. More complete userspace implementations
>>>> are available here:
>>>>
>>>>   * https://github.com/cyndis/vaapi-tegra-driver
>>>>   * https://github.com/grate-driver/xf86-video-opentegra
>>>>   * https://github.com/grate-driver/grate
>>>>
>>>> Changes in v2:
>>>> - implement vic_clear() as a helper using ->fill() (Michał Mirosław)
>>>> - rebase and fix a couple of Meson errors/warnings
>>>>
>>>> Thierry
>>>>
>>>> Thierry Reding (25):
>>>>   tegra: Indent according to .editorconfig
>>>>   tegra: Remove unused IOCTL implementations
>>>>   tegra: Extract common buffer object allocation code
>>>>   tegra: Fix mmap() of GEM buffer objects
>>>>   tegra: Add flink helpers
>>>>   tegra: Add PRIME support helpers
>>>>   tegra: Make API more consistent
>>>>   tegra: Install tegra-openclose test
>>>>   tegra: Update for new UABI
>>>>   tegra: Include private.h in list of source files
>>>>   tegra: Add channel APIs
>>>>   tegra: Add job and push buffer APIs
>>>>   tegra: Add syncpoint APIs
>>>>   tests: tegra: Add helper library for tests
>>>>   tests: tegra: Add gr2d-fill test
>>>>   tests: tegra: Add syncpt-wait test
>>>>   tests: tegra: Add syncpoint timeout test
>>>>   tests: tegra: Add VIC support
>>>>   tests: tegra: Add VIC 3.0 support
>>>>   tests: tegra: Add VIC 4.0 support
>>>>   tests: tegra: Add VIC 4.1 support
>>>>   tests: tegra: Add VIC 4.2 support
>>>>   tests: tegra: Add VIC clear test
>>>>   tests: tegra: Add VIC blit test
>>>>   tests: tegra: Add VIC flip test
>>>>
>>>>  include/drm/tegra_drm.h      | 429 +++++++++++++++++++++++--
>>>>  tegra/channel.c              | 195 ++++++++++++
>>>>  tegra/job.c                  | 187 +++++++++++
>>>>  tegra/meson.build            |   7 +-
>>>>  tegra/private.h              |  85 ++++-
>>>>  tegra/pushbuf.c              | 184 +++++++++++
>>>>  tegra/syncpt.c               | 101 ++++++
>>>>  tegra/tegra-symbols.txt      |  27 +-
>>>>  tegra/tegra.c                | 386 +++++++++++-----------
>>>>  tegra/tegra.h                |  95 +++++-
>>>>  tests/tegra/.gitignore       |   3 +-
>>>>  tests/tegra/drm-test-tegra.c | 147 +++++++++
>>>>  tests/tegra/drm-test-tegra.h |  55 ++++
>>>>  tests/tegra/drm-test.c       | 248 +++++++++++++++
>>>>  tests/tegra/drm-test.h       |  72 +++++
>>>>  tests/tegra/gr2d-fill.c      | 146 +++++++++
>>>>  tests/tegra/host1x.h         |  34 ++
>>>>  tests/tegra/meson.build      |  88 +++++-
>>>>  tests/tegra/openclose.c      |  52 +--
>>>>  tests/tegra/syncpt-timeout.c | 163 ++++++++++
>>>>  tests/tegra/syncpt-wait.c    | 151 +++++++++
>>>>  tests/tegra/vic-blit.c       | 333 +++++++++++++++++++
>>>>  tests/tegra/vic-clear.c      | 173 ++++++++++
>>>>  tests/tegra/vic-flip.c       | 333 +++++++++++++++++++
>>>>  tests/tegra/vic.c            | 184 +++++++++++
>>>>  tests/tegra/vic.h            | 181 +++++++++++
>>>>  tests/tegra/vic30.c          | 458 +++++++++++++++++++++++++++
>>>>  tests/tegra/vic30.h          | 439 ++++++++++++++++++++++++++
>>>>  tests/tegra/vic40.c          | 370 ++++++++++++++++++++++
>>>>  tests/tegra/vic40.h          | 285 +++++++++++++++++
>>>>  tests/tegra/vic41.c          | 374 ++++++++++++++++++++++
>>>>  tests/tegra/vic41.h          | 372 ++++++++++++++++++++++
>>>>  tests/tegra/vic42.c          | 374 ++++++++++++++++++++++
>>>>  tests/tegra/vic42.h          | 597 +++++++++++++++++++++++++++++++++++
>>>>  34 files changed, 7068 insertions(+), 260 deletions(-)
>>>
>>>
>>> Why do we need these tests in libdrm? Why not IGT?
>>
>> Oops, sorry. I had meant to reply to your question in the previous
>> version. The idea was to have this minimal set of tests in libdrm as a
>> way to demonstrate how to use the various APIs. At the same time, this
>> is meant to serve as an easy way to validate that everything works from
>> the comparatively simple libdrm package.
> 
> Who will be validating libdrm on Tegra?
> 
>> But yes, adding more tests on top of this to IGT is something that I've
>> been pondering and I certainly wouldn't object if anyone else was going
>> to attempt to do so. I don't think IGT and libdrm need to be mutually
>> exclusive, though.
> 
> I know that IGT tests are regularly run by the KernelCI at least on TK1.

Finishing my thought.. It's good to have a demo within libdrm, but in my
opinion it's not very practical to put effort into libdrm from the
perspective of testing. Much more practical should be to put effort into
IGT, which already has a use on Tegra.
Dmitry Osipenko Feb. 21, 2022, 8:29 p.m. UTC | #6
18.02.2022 12:31, Mikko Perttunen пишет:
> On 2/17/22 21:16, Thierry Reding wrote:
>> ...
> 
> Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
> 
> Left one cosmetic comment in the VIC4.0 patch, but overall looks OK. I
> think it would be fine to have some basic tests in libdrm as well.

There is a question about who is going to use this libdrm API. Are you
going to use it in the VAAPI driver?

Grate drivers can't use this API because:

1. More features are needed
2. There is no stable API
3. It's super painful to keep all drivers and libdrm in sync from a
packaging perspective.

It's much more practical nowadays to use DRM directly, without
SoC-specific libdrm API, i.e. to bundle that SoC-specific API within the
drivers.
Mikko Perttunen Feb. 22, 2022, 8:41 a.m. UTC | #7
On 2/21/22 22:29, Dmitry Osipenko wrote:
> 18.02.2022 12:31, Mikko Perttunen пишет:
>> On 2/17/22 21:16, Thierry Reding wrote:
>>> ...
>>
>> Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
>>
>> Left one cosmetic comment in the VIC4.0 patch, but overall looks OK. I
>> think it would be fine to have some basic tests in libdrm as well.
> 
> There is a question about who is going to use this libdrm API. Are you
> going to use it in the VAAPI driver?
> 
> Grate drivers can't use this API because:
> 
> 1. More features are needed
> 2. There is no stable API
> 3. It's super painful to keep all drivers and libdrm in sync from a
> packaging perspective.
> 
> It's much more practical nowadays to use DRM directly, without
> SoC-specific libdrm API, i.e. to bundle that SoC-specific API within the
> drivers.

I'm not planning to use this in the VAAPI driver -- I don't personally 
have any use case for the libdrm API.

Mikko
Thierry Reding Feb. 23, 2022, 3:01 p.m. UTC | #8
On Tue, Feb 22, 2022 at 10:41:05AM +0200, Mikko Perttunen wrote:
> On 2/21/22 22:29, Dmitry Osipenko wrote:
> > 18.02.2022 12:31, Mikko Perttunen пишет:
> > > On 2/17/22 21:16, Thierry Reding wrote:
> > > > ...
> > > 
> > > Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
> > > 
> > > Left one cosmetic comment in the VIC4.0 patch, but overall looks OK. I
> > > think it would be fine to have some basic tests in libdrm as well.
> > 
> > There is a question about who is going to use this libdrm API. Are you
> > going to use it in the VAAPI driver?
> > 
> > Grate drivers can't use this API because:
> > 
> > 1. More features are needed
> > 2. There is no stable API
> > 3. It's super painful to keep all drivers and libdrm in sync from a
> > packaging perspective.
> > 
> > It's much more practical nowadays to use DRM directly, without
> > SoC-specific libdrm API, i.e. to bundle that SoC-specific API within the
> > drivers.
> 
> I'm not planning to use this in the VAAPI driver -- I don't personally have
> any use case for the libdrm API.

As I mentioned, the intention here was to provide a reference
implementation along with a simple API that could be used to achieve
results in an easy way, without having to do all the buffer tracking for
relocations etc. manually. If other projects find this to be useful,
that's great (I was thinking of using this to add a few tests to IGT).
If they want to use their own constructs, that's absolutely fine, too.

Thierry