Commit Graph

11 Commits

Author SHA1 Message Date
Gurchetan Singh
8e02355e55 gfxstream: guest: Gralloc --> GfxStreamGralloc
By popular demand..

Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
2024-09-19 20:06:03 +00:00
Gurchetan Singh
fcf73c0ed4 gfxstream: GrallocMinigbm uses platform_virtgpu
This removes the open-coding of virtgpu_drm access
and uses the platform_virtgpu layer.

Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
2024-09-19 20:06:03 +00:00
Gurchetan Singh
688f305cea gfxstream: guest: remove renderControl dependency from Gralloc
Easy to avoid this dependency, just by special-casing
createColorBuffer

Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
2024-09-19 20:06:03 +00:00
Gurchetan Singh
2d967209ad gfxstream: guest: introduce Gralloc::getGrallocType()
This API tells the user whether the chosen
implementation is goldfish gralloc, cros_gralloc
(minigbm), or emulated gralloc.

Use with caution.

Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
2024-09-19 20:06:03 +00:00
Gurchetan Singh
8dbe8e0b1e gfxstream: end2end: nuke RutabagaLayer, use kumquat for testing
This change nukes the RutabagaLayer and makes the
end2end testing layer use Kumquat.

The benefit is not having two different testing
frameworks.  Compared to the RutabagaLayer, Kumquat
is more complex, but potentially has more features
in the long run.  Some advanatages:

  - virtgpu_kumquat_ffi is portable enough that
    non-gfxstream libraries (minigbm, others) can
    depend on it.  This would enable more accurate
    gralloc testing long-term.

  - multiple different context types can connect to
    Kumquat at the same time, rather than just one with
    the RutabagaLayer.

  - If anyone is bored, it should be pretty easy add
    v4l2 apis via an virtio-media like interface.

  - The kumquat server can actually call
    stream_renderer_teardown(..) when performing
    snapshot tests.

  - Kumquat relies on EventFd + VkExternalSync:
    this can eliminate the need to export the
    libplatform sync API outside VK, EGL over the
    long-term.

A point of complexity was Gralloc.  We have an external
Gralloc instance, but HostConnection also maintains a
thread-local Gralloc instances.  The thread-local gralloc
instances can potentially step on the kumquat connection
of the pipe or ASG stream.  The solution was for
GrallocEmulated to maintain it's own virtgpu_kumquat
instance.

The proper long-term solution is move gralloc out of
HostConnection entirely.

A prior version of this change relied on:

   - vkInitializeKumquat,
   - rcCreateDeviceKumquat
   - eglInitializeKumquat

since I read somewhere GoogleTest is necessarily
multi-threaded. That turned out to be fake news, so nuke
those functions as well.

Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
2024-09-19 20:06:02 +00:00
Jason Macnak
f240f5677a Add YUV AHB import and sample end2end tests
... which triggers the device lost failures when aosp/3163776
is reverted.

Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
2024-09-19 20:06:02 +00:00
Jason Macnak
70c695550a Explicitly specify target/bind/bpp in resource creation
... instead of trying to guess it so that BLOB AHBs can be
distinguished from pipe buffers used for guest<->host communication
in VirtioGpuPipeStream.

Adds a test which allocates a BLOB AHB.

Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
2024-09-19 20:06:00 +00:00
Jason Macnak
d0a61f5813 Rename VirtGpuBlob -> VirtGpuResource
... as this is more generic and "VirglBlob" is not actually a blob.

find . -type f -name "*.cpp" -print0 | \
    xargs -0 sed -i '' -e 's/VirtGpuBlob/VirtGpuResource/g'
find . -type f -name "*.h" -print0 | \
    xargs -0 sed -i '' -e 's/VirtGpuBlob/VirtGpuResource/g'
find . -type f -name "*.cpp" -print0 | \
    xargs -0 sed -i '' -e 's/createVirglBlob/createResource/g'
find . -type f -name "*.h" -print0 | \
    xargs -0 sed -i '' -e 's/createVirglBlob/createResource/g'

Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
2024-09-19 20:06:00 +00:00
Jason Macnak
d0a4d3f3bc Add composition support to the end2end test framework
... so that we can start to test GL->VK->Host-Compositor flows.

Adds a fake render control lib that basically just exposes some of
the render control functions with scoped host connection inside of
a `RenderControlDevice`.

Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
2024-09-19 20:06:00 +00:00
Jason Macnak
c2d57b76be Ensure glProgramBinary initializes uniform and attrib info
Adds Scoped* helper classes to hopefully make writing tests easier.

Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
2024-09-19 20:06:00 +00:00
Jason Macnak
092dbc32ab Make RutabagaLayer shared between "guest impls"
... so that "guest gralloc", "guest egl", "guest vulkan", etc are
all using the same underlying emulation layer (RutabagaLayer).

This moves Gralloc and ANativeWindow into platform as these should
be hidden from GfxstreamEnd2EndTests.

Note: we still want to static-ify a lot of the guest libraries.

      meson setup \
          -Ddefault_library=static \
          -Dgfxstream-build=both \
          build
      meson compile -C build

Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
2024-09-19 20:06:00 +00:00