[Mesa-dev] [PATCH 00/28] vulkan/wsi: Rework WSI to look a lot more like a layer

Jason Ekstrand jason at jlekstrand.net
Sat Nov 18 23:51:03 UTC 2017


On Sat, Nov 18, 2017 at 9:02 AM, Grazvydas Ignotas <notasas at gmail.com>
wrote:

> On Sat, Nov 18, 2017 at 3:06 AM, Jason Ekstrand <jason at jlekstrand.net>
> wrote:
> > On Fri, Nov 17, 2017 at 2:18 PM, Grazvydas Ignotas <notasas at gmail.com>
> > wrote:
> >>
> >> I've tested this branch (rx470 + hd530) and it's only partially working:
> >> - display on amd, radv: always fails with "offscreen:
> >> wsi/wsi_common.c:172: select_memory_type: Assertion `!"No memory type
> >> found"' failed."
> >> - display on amd, anv: misrenders. For SaschaWillems, only
> >> multisampling, subpasses and triangle renders, other demos show black
> >> window with only text (fps counter and help) visible
> >> - display on intel, radv: same "No memory type found"'
> >> - display on intel, anv: seems to be ok
> >
> >
> > Thanks for testing!  I've got a HSW+radeon box at home.  I'll see if I
> can
> > get it fixed early next week.  I did find a couple bugs by inspection
> when I
> > was working on getting modifiers working today.  I've re-pushed if you
> feel
> > like trying again.  Otherwise, I'll see if I can repro on my box.
>
> Seems to be the same as before. Assertion `!"No memory type found"'
> starts hitting at "vulkan/wsi: Do image creation in common code".
>

I force-pushed the branch again with an added commit: "radv: Move wsi
initialization later in physical_device_init" that fixes the memory type
issue with radv.  I've tested both radv + radeon and anv + radeon on my HSW
+ Rx550 and they both work now.  I'm having a bit of trouble actually
getting my system to start up on the Intel card so I'll have to leave
testing radv on Intel for another day.

--Jason


> Gražvydas
>
> >
> > --Jason
> >
> >>
> >> Gražvydas
> >>
> >> On Fri, Nov 17, 2017 at 4:44 AM, Jason Ekstrand <jason at jlekstrand.net>
> >> wrote:
> >> > I just force-pushed my branch with some changes as per Dave to more
> >> > explicitly enable implicit sync when allocating memory objects.
> >> >
> >> > On Thu, Nov 16, 2017 at 1:28 PM, Jason Ekstrand <jason at jlekstrand.net
> >
> >> > wrote:
> >> >>
> >> >> This patch series is the combined brain-child of Dave and myself.
> The
> >> >> objective is to rewrite Vulkan WSI to look as much like a layer as
> >> >> possible
> >> >> and to reduce the driver <-> WSI interface.  We try very hard to have
> >> >> as
> >> >> many of the WSI details as possible in common code and to use
> standard
> >> >> Vulkan interfaces for everything.  Among other things, this means
> that
> >> >> prime support is now implemented in an entirely driver-agnostic way
> and
> >> >> the
> >> >> driver doesn't even know it's happening.  As a side-effect anv now
> has
> >> >> prime support.
> >> >>
> >> >> Eventually, someone could pull what's left out into a proper layer
> and
> >> >> we
> >> >> could drop WSI support from our drivers entirely.  There are a fiew
> >> >> pieces
> >> >> of work that would be required to do this:
> >> >>
> >> >>  1) Write all of the annoying layer bits.  There are some short-cuts
> >> >> that
> >> >>     we can take because we're not in a layer and those will have to
> go.
> >> >>
> >> >>  2) Define a VK_MESA_legacy_swapchain_image extension to replace the
> >> >> hack
> >> >>     introduced in patch 8.
> >> >>
> >> >>  3) It looks like modifiers support will land before the official
> >> >> Vulkan
> >> >>     extensions get finished.  It will have to be ported to the
> official
> >> >>     extensions.
> >> >>
> >> >>  4) Figure out what to do about the fence in AcquireNextImage. In a
> >> >> future
> >> >>     world of explicit synchronization, we can just import the
> sync_file
> >> >>     from X or the Wayland compositor, but with implicit sync like we
> >> >> have
> >> >>     today, it's a bit harder.  Right now, the helper in wsi_common
> does
> >> >>     nothing with it and trusts the caller to handle it.
> >> >>
> >> >>     The two drivers handle this differently today.  In anv, we do a
> >> >> dummy
> >> >>     QueueSubmit to trigger the fence while radv triggers it a bit
> more
> >> >>     manually.  In both cases, we trigger the fence immediately and
> >> >> trust
> >> >> in
> >> >>     the GEM's implicit synchronization to sort things out for us.  We
> >> >> can't
> >> >>     use the anv method as directly with radv because no queue is
> passed
> >> >> in
> >> >>     so we don't know what queue to use in the dummy QueueSubmit.  (In
> >> >> ANV,
> >> >>     we only have the one queue so that isn't a problem.)
> >> >>
> >> >>
> >> >> Dave, I tried to pull patches from your series where practical but,
> >> >> because
> >> >> we did things in a different order, it frequently wasn't.  If you
> want
> >> >> to
> >> >> claim credit for any of these patches, just say so and I'll
> >> >> --reset-author
> >> >> on them.
> >> >>
> >> >> The series can be found on freedesktop.org here:
> >> >>
> >> >>
> >> >> https://cgit.freedesktop.org/~jekstrand/mesa/log/?h=wip/vulk
> an-wsi-prime
> >> >>
> >> >>
> >> >> Cc: Dave Airlie <airlied at redhat.com>
> >> >> Cc: Daniel Stone <daniels at collabora.com>
> >> >> Cc: Chad Versace <chadversary at chromium.org>
> >> >> Cc: James Jones <jajones at nvidia.com>
> >> >>
> >> >> Daniel Stone (1):
> >> >>   vulkan/wsi: Add a wsi_image structure
> >> >>
> >> >> Dave Airlie (4):
> >> >>   vulkan/wsi: use function ptr definitions from the spec.
> >> >>   radv/wsi: drop allocate memory special case
> >> >>   radv/wsi: Move the guts of QueuePresent to wsi common
> >> >>   vulkan/wsi: move swapchain create/destroy to common code
> >> >>
> >> >> Jason Ekstrand (23):
> >> >>   vulkan/wsi/x11: Handle the geometry check earlier in
> create_swapchain
> >> >>   vulkan/wsi: Add a wsi_device_init function
> >> >>   vulkan/wsi: Add wsi_swapchain_init/finish functions
> >> >>   vulkan/wsi: Implement prime in a completely generic way
> >> >>   anv/image: Add a return value to bind_memory_plane
> >> >>   vulkan/wsi: Add a mock image creation extension
> >> >>   anv/image: Implement the wsi "extension"
> >> >>   radv/image: Implement the wsi "extension"
> >> >>   vulkan/wsi: Do image creation in common code
> >> >>   vulkan/wsi: Add a WSI_FROM_HANDLE macro
> >> >>   vulkan/wsi: Refactor result handling in queue_present
> >> >>   vulkan/wsi: Only wait on semaphores on the first swapchain
> >> >>   vulkan/wsi: Set a proper pWaitDstStageMask on the dummy submit
> >> >>   anv/wsi: Use the common QueuePresent code
> >> >>   anv/wsi: Enable prime support
> >> >>   vulkan/wsi: Move get_images into common code
> >> >>   vulkan/wsi: Move prime blitting into queue_present
> >> >>   vulkan/wsi: Add a helper for AcquireNextImage
> >> >>   vulkan/wsi: Move wsi_swapchain to wsi_common_private.h
> >> >>   vulkan/wsi: Drop the can_handle_different_gpu parameter from
> >> >>     get_support
> >> >>   vulkan/wsi: Add wrappers for all of the surface queries
> >> >>   vulkan/wsi: Drop some unneeded cruft from the API
> >> >>   vulkan/wsi: Initialize individual WSI interfaces in wsi_device_init
> >> >>
> >> >>  src/amd/vulkan/radv_device.c        |  18 +-
> >> >>  src/amd/vulkan/radv_image.c         |  15 +-
> >> >>  src/amd/vulkan/radv_private.h       |  10 -
> >> >>  src/amd/vulkan/radv_wsi.c           | 472 +++-------------------
> >> >>  src/intel/vulkan/anv_image.c        |  71 +++-
> >> >>  src/intel/vulkan/anv_private.h      |   2 +
> >> >>  src/intel/vulkan/anv_wsi.c          | 347 +++-------------
> >> >>  src/vulkan/Makefile.sources         |   2 +
> >> >>  src/vulkan/wsi/meson.build          |   2 +
> >> >>  src/vulkan/wsi/wsi_common.c         | 763
> >> >> ++++++++++++++++++++++++++++++++++++
> >> >>  src/vulkan/wsi/wsi_common.h         | 223 ++++++-----
> >> >>  src/vulkan/wsi/wsi_common_private.h | 157 ++++++++
> >> >>  src/vulkan/wsi/wsi_common_wayland.c |  90 ++---
> >> >>  src/vulkan/wsi/wsi_common_x11.c     | 150 ++-----
> >> >>  14 files changed, 1310 insertions(+), 1012 deletions(-)
> >> >>  create mode 100644 src/vulkan/wsi/wsi_common.c
> >> >>  create mode 100644 src/vulkan/wsi/wsi_common_private.h
> >> >>
> >> >> --
> >> >> 2.5.0.400.gff86faf
> >> >>
> >> >
> >> >
> >> > _______________________________________________
> >> > mesa-dev mailing list
> >> > mesa-dev at lists.freedesktop.org
> >> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> >> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171118/e405801f/attachment-0001.html>


More information about the mesa-dev mailing list