1. 26 Oct, 2018 1 commit
    • Rob Clark's avatar
      freedreno: import libdrm_freedreno + redesign submit · f3cc0d27
      Rob Clark authored
      In the pursuit of lowering driver overhead, it became clear that some
      amount of redesign of how libdrm_freedreno constructs the submit ioctl
      would be needed.  In particular, as the gallium driver is starting to
      make heavier use of CP_SET_DRAW_STATE state groups/objects, the over-
      head of tracking cmd buffers and relocs becomes too much.  And for
      "streaming" state, which isn't ever reused (like uniform uploads) the
      overhead of allocating/freeing ringbuffer[1] objects is too high.
      
      This redesign makes two main changes:
      
       1) Introduces a fd_submit object for tracking bos and cmds table
          for the submit ioctl, making ringbuffer objects more light-
          weight.  This was previously done in the ringbuffer.  But we
          have many ringbuffer instances involved in a submit (gmem +
          draw + potentially 1000's of state-group rbs), and only need
          a single bos and cmds table.  (Reloc table is still per-rb)
      
          The submit is also a convenient place for a slab allocator for
          ringbuffer objects.  Other options would have required locking
          because, while we can guarantee allocations will only happen on
          a single thread, free's could happen either on the application
          thread or the flush_queue thread.  With the slab allocator in
          the submit object, any frees that happen on the flush_queue
          thread happen after we know that the application thread is done
          with the submit.
      
       2) Introduce a new "softpin" msm_ringbuffer_sp implementation that
          does not use relocs and only has cmds table entries for IB1 (ie.
          the cmdstream buffers that kernel needs to CP_INDIRECT_BUFFER
          to from the RB).  To do this properly will require some updates
          on the kernel side, so whether you get the softpin or legacy
          submit/ringbuffer implementation at runtime depends on your
          kernel version.
      
      To make all these changes in libdrm would basically require adding a
      libdrm_freedreno2, so this is a good point to just pull the libdrm code
      into mesa.  Plus it allows for using mesa's hashtable, slab allocator,
      etc.  And it lets us have asserts enabled for debug mesa buids but
      omitted for release builds.  And it makes life easier if further API
      changes become necessary.
      
      At this point I haven't tried to pull in the kgsl backend.  Although
      I left the level of vfunc indirection which would make it possible
      to have other backends.  (And this was convenient to keep to allow
      for the "softpin" ringbuffer to coexist.)
      
      NOTE: if bisecting a build error takes you here, try a clean build.
      There are a bunch of ways things can go wrong if you still have
      libdrm_freedreno cflags.
      
      [1] "ringbuffer" is probably a bad name, the only level of cmdstream
          buffer that is actually a ring is RB managed by kernel.  User-
          space cmdstream is all IB1/IB2 and state-groups.
      Reviewed-by: default avatarKristian H. Kristensen <hoegsberg@chromium.org>
      Reviewed-by: Eric Engestrom's avatarEric Engestrom <eric.engestrom@intel.com>
      Signed-off-by: Rob Clark's avatarRob Clark <robdclark@gmail.com>
      f3cc0d27
  2. 23 Oct, 2018 1 commit
  3. 22 Oct, 2018 1 commit
  4. 19 Oct, 2018 1 commit
  5. 17 Oct, 2018 1 commit
  6. 10 Oct, 2018 1 commit
    • Dylan Baker's avatar
      meson: Don't allow building EGL on Windows or MacOS · b8521704
      Dylan Baker authored
      Currently mesa only supports EGL on Unix like systems, cygwin, and
      haiku. Meson should actually enforce this. This fixes the default build
      on MacOS.
      
      v2: - invert the condition, mark darwin and windows as not supported
            instead of trying to mark what is supported.
      v3: - add missing )
      v3: - Update comment to reflect condition change in v2
      
      CC: 18.2 <mesa-stable@lists.freedesktop.org>
      Reviewed-by: Eric Engestrom's avatarEric Engestrom <eric.engestrom@intel.com>
      b8521704
  7. 03 Oct, 2018 1 commit
  8. 25 Sep, 2018 2 commits
  9. 24 Sep, 2018 1 commit
  10. 21 Sep, 2018 1 commit
  11. 20 Sep, 2018 1 commit
  12. 17 Sep, 2018 1 commit
    • Dylan Baker's avatar
      move pthread_setaffinity_np check to the build system · 3acc18fc
      Dylan Baker authored
      Rather than trying to encode all of the rules in a header, lets just put
      them in the build system where they belong. This fixes the build on
      FreeBSD, which does have pthraed_setaffinity_np, but it's in a
      pthread_np.h, not behind _GNU_SOURCE. FreeBSD also implements cpu_set
      slightly differently, so additional changes would be required to get it
      working right there anyway.
      
      v2: - fix #define in autotools
      
      Fixes: 9f1bbbdb
             ("util: try to fix the Android and MacOS build")
      Cc: Emil Velikov <emil.velikov@collabora.com>
      Reviewed-by: default avatarMarek Olšák <marek.olsak@amd.com>
      Reviewed-by: Eric Engestrom's avatarEric Engestrom <eric.engestrom@intel.com>
      3acc18fc
  13. 06 Sep, 2018 2 commits
  14. 05 Sep, 2018 1 commit
    • Dylan Baker's avatar
      meson: Print a message about why a libdrm version was selected · d25a27ec
      Dylan Baker authored
      We require a single version of libdrm for all of our libdrm
      dependencies (core and driver), but the way this is structured can make
      the error message less than helpful, as one driver might be the one
      setting the libdrm requirement, while another might be the one that
      generates the version failure.
      
      This adds a simple message to the output announcing which libdrm module
      set the version, which might be more helpful.
      
      v2: - Use message suggested by Eric Engstrom
      
      Fixes: c445b1d5
             ("meson: Use the same version for all libdrm checks")
      Reviewed-by: Eric Engestrom's avatarEric Engestrom <eric.engestrom@intel.com>
      d25a27ec
  15. 27 Aug, 2018 2 commits
  16. 20 Aug, 2018 1 commit
  17. 16 Aug, 2018 3 commits
  18. 10 Aug, 2018 1 commit
  19. 08 Aug, 2018 1 commit
  20. 07 Aug, 2018 2 commits
  21. 03 Aug, 2018 2 commits
  22. 02 Aug, 2018 1 commit
  23. 20 Jul, 2018 1 commit
  24. 13 Jul, 2018 1 commit
  25. 05 Jul, 2018 1 commit
  26. 22 Jun, 2018 4 commits
  27. 21 Jun, 2018 1 commit
  28. 20 Jun, 2018 2 commits
    • Keith Packard's avatar
      vulkan: EXT_acquire_xlib_display requires libXrandr headers to build · 3f960c13
      Keith Packard authored
      When VK_USE_PLATFORM_XLIB_XRANDR_EXT is defined, vulkan.h includes
      X11/extensions/Xrandr.h for the RROutput typedef which is used in
      the vkGetRandROutputDisplayEXT interface.
      
      Make sure we have the required header by checking during the build,
      and also set CFLAGS to point at the right directory.
      
      We don't need to link against the library as we don't use any
      functions from there, so don't add the _LIBS value in the autotools
      build.
      Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
      Fixes: dbac8e25 "radv: Add EXT_acquire_xlib_display to radv driver [v2]"
      Reviewed-by: Eric Engestrom's avatarEric Engestrom <eric.engestrom@intel.com>
      3f960c13
    • Gert Wollny's avatar
      configure.ac: Add CFLAG -Wno-missing-field-initializers (v5) · 81e5bf3c
      Gert Wollny authored
      This warning is misleading: When a struct is partially initialized without
      assigning to the structure members by name, then the remaining fields
      will be zeroed out, and this warning will be issued (if enabled). If, on the
      other hand, the partial initialization is done by assigning to named members,
      the remaining structure elements may hold random data, but the warning is not
      issued. Since in Mesa the first approach to initialize structure elements is
      used very often, and it is usually assumed that the remaining elements are
      zeroed out, heeding this warning would be counter-productive.
      
      v2: - add -Wno-missing-field-initializers to meson-build
          - fix empty line error
          (both Eric Engestrom)
      
      v3: * check for -Wmissing-field-initializers warning and then disable it
            because gcc and clang always accept -Wno-* (Dylan Baker)
          * Also disable this warning for C++
      
      v4: * meson.build add -Wno-missing-field-initializers to
            c_args instead of no_override_init_args (Eric Engstrom)
      
      v5: * configure.ac: Correct copy/paste error with CFLAGS/CXXFLAGS
      
      Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1)
      Reviewed-by: Emil Velikov <emil.velikov@collabora.com> (v2)
      Reviewed-by: Eric Engestrom's avatarEric Engestrom <eric.engestrom@intel.com>
      Signed-off-by: Gert Wollny's avatarGert Wollny <gert.wollny@collabora.com>
      81e5bf3c
  29. 19 Jun, 2018 1 commit
    • Keith Packard's avatar
      vulkan: Add EXT_acquire_xlib_display [v5] · 7ab1fffc
      Keith Packard authored
      This extension adds the ability to borrow an X RandR output for
      temporary use directly by a Vulkan application. For DRM, we use the
      Linux resource leasing mechanism.
      
      v2:
      	Clean up xlib_lease detection
      
      	* Use separate temporary '_xlib_lease' variable to hold the
      	  option value to avoid changin the type of a variable.
      
      	* Use boolean expressions instead of additional if statements
      	  to compute resulting with_xlib_lease value.
      
      	* Simplify addition of VK_USE_PLATFORM_XLIB_XRANDR_KHR to
                vulkan_wsi_args
      Suggested-by: Eric Engestrom's avatarEric Engestrom <eric.engestrom@imgtec.com>
      
      	Move mode list from wsi_display to wsi_display_connector
      
      	Fix scope for wsi_display_mode and wsi_display_connector allocs
      Suggested-by: Jason Ekstrand's avatarJason Ekstrand <jason@jlekstrand.net>
      
      v3:
      	Adopt Jason Ekstrand's coding conventions
      
      	Declare variables at first use, eliminate extra whitespace
      	between types and names. Wrap lines to 80 columns.
      
      	Explicitly forbid multiple DRM leases. Making the code support
      	this looks tricky and will require additional thought.
      
      	Use xcb_randr_output_t throughout the internals of the
      	implementation. Convert at the public API
      	(wsi_get_randr_output_display).
      
      	Clean up check for usable active_crtc (possible when only the
      	desired output is connected to the crtc).
      Suggested-by: Jason Ekstrand's avatarJason Ekstrand <jason.ekstrand@intel.com>
      
      v4:
      	Move output resource fetching closer to use in
      	wsi_display_get_output. This simplifies the error returns in
      	earlier parts of the code a bit.
      
      	Return VK_ERROR_INITIALIZATION_FAILED from
      	wsi_acquire_xlib_display. Jason says this is the right error
      	message.
      Suggested-by: Jason Ekstrand's avatarJason Ekstrand <jason.ekstrand@intel.com>
      
      v5:
      	randr doesn't pass vscan over the wire, so we set vscan to 0
      	for randr-acquired modes, and test wsi modes for vscan <= 1
      	when comparing against randr modes.
      Suggested-by: Jason Ekstrand's avatarJason Ekstrand <jason.ekstrand@intel.com>
      Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
      Reviewed-by: Jason Ekstrand's avatarJason Ekstrand <jason@jlekstrand.net>
      7ab1fffc