mesa.git
4 years agonir: Improve the comment on num_inputs and friends
Jason Ekstrand [Mon, 31 Aug 2020 18:06:04 +0000 (13:06 -0500)]
nir: Improve the comment on num_inputs and friends

This doesn't fix the problem that no one knows what any of these mean
half the time but it at least makes them better documented to hopefully
make people's expectations more accurate.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6524>

4 years agonir: Rename num_shared to shared_size
Jason Ekstrand [Mon, 31 Aug 2020 18:04:50 +0000 (13:04 -0500)]
nir: Rename num_shared to shared_size

This one is always a size in bytes.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6524>

4 years agospirv: Delete some dead workgroup variable handling code
Jason Ekstrand [Mon, 31 Aug 2020 18:01:21 +0000 (13:01 -0500)]
spirv: Delete some dead workgroup variable handling code

This is dead since 5ed4e31c08dc0.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6524>

4 years agospirv: add some tests for volatile/available/visible
Rhys Perry [Mon, 27 Jul 2020 13:43:40 +0000 (14:43 +0100)]
spirv: add some tests for volatile/available/visible

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6090>

4 years agospirv: Support big-endian strings
Jason Ekstrand [Fri, 28 Aug 2020 17:36:20 +0000 (12:36 -0500)]
spirv: Support big-endian strings

This should be all that's required for the SPIR-V parser to work in
big-endian systems.  SPIR-V requires that everything be in host
byte-order except for strings which are always little-endian.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6090>

4 years agospirv: implement SpvMemoryAccessVolatileMask
Rhys Perry [Fri, 24 Jul 2020 16:56:49 +0000 (17:56 +0100)]
spirv: implement SpvMemoryAccessVolatileMask

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6090>

4 years agospirv: implement Volatile image operand
Rhys Perry [Mon, 29 Jun 2020 13:56:38 +0000 (14:56 +0100)]
spirv: implement Volatile image operand

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6090>

4 years agospirv: implement Volatile memory semantic
Rhys Perry [Wed, 6 May 2020 16:02:51 +0000 (17:02 +0100)]
spirv: implement Volatile memory semantic

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6090>

4 years agospirv: implement MakePointerAvailable/MakePointerVisible for OpCopyMemory
Rhys Perry [Wed, 6 May 2020 14:04:14 +0000 (15:04 +0100)]
spirv: implement MakePointerAvailable/MakePointerVisible for OpCopyMemory

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6090>

4 years agospirv: add vtn_emit_make_{visible,available}_barrier helpers
Rhys Perry [Tue, 18 Aug 2020 13:45:46 +0000 (14:45 +0100)]
spirv: add vtn_emit_make_{visible,available}_barrier helpers

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6090>

4 years agospirv: make OpLoad/OpStore visibility/availablity barriers acquire/release
Rhys Perry [Mon, 27 Jul 2020 13:51:57 +0000 (14:51 +0100)]
spirv: make OpLoad/OpStore visibility/availablity barriers acquire/release

I think these are needed to order the visibility/availability operation
with the access.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6090>

4 years agospirv: fix Uniform and Output MemoryAccessMakePointer{Visible,Available}
Rhys Perry [Mon, 27 Jul 2020 13:48:12 +0000 (14:48 +0100)]
spirv: fix Uniform and Output MemoryAccessMakePointer{Visible,Available}

The Uniform storage class can be used for SSBOs. This should also fix make
available/visible for the Output storage class.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6090>

4 years agospirv: Add a vtn_get_mem_operands() helper
Boris Brezillon [Mon, 17 Aug 2020 17:38:47 +0000 (19:38 +0200)]
spirv: Add a vtn_get_mem_operands() helper

Add a vtn_get_mem_operands() helper to extract memory operand attached
to load/store operations.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6090>

4 years agointel/isl: Drop unnecessary check on 16bpp depth format
Sagar Ghuge [Thu, 27 Aug 2020 05:24:19 +0000 (22:24 -0700)]
intel/isl: Drop unnecessary check on 16bpp depth format

Drop unnecessary check which allows enabling of lossless write through
compression (HiZ + CCS) for D16_UNORM format on Gen12+.

We had misleading HSD information previously which used to claim that
compression can not be supported for 16bpp format. Although BSpec does
not have any restriction for D16_UNORM format.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6485>

4 years agoanv: implement shareable timeline semaphores
Lionel Landwerlin [Wed, 28 Aug 2019 10:22:30 +0000 (13:22 +0300)]
anv: implement shareable timeline semaphores

This implements timeline semaphores using a new type of dma-fence
stored into drm-syncobjs. We use a thread to implement delayed
submissions.

v2: Drop cloning of temporary semaphores and just transfer their ownership (Jason)
    Drain queue when dealing with binary semaphore
    Ensure we don't submit to the thread as long as we don't need to

v3: Use __u64 not uintptr_t for kernel pointers
    Fix commented code for INTEL_DEBUG=bat
    Set DRM_I915_GEM_EXECBUFFER_EXT_TIMELINE_FENCES in timeline fence execbuf extension
    Add new anv_queue_set_lost()
    Drop multi queue stuff meant for the fake multi queue patch
    Rework temporary syncobj handling
    Don't use syncobj when not available (DeviceWaitIdle/CreateDevice)
    Use ANV_MULTIALLOC
    And a few more tweaks...

v4: Drop drained condition helper (Lionel)
    Fix missing EXEC_OBJECT_WRITE on BOs we want to wait on (Jason)

v5: Add missing device->lost_reported in _anv_device_report_lost (Lionel)
    Fix missing free on submit->simple_bo (Lionel)
    Don't drop setting the device in lost state on QueueSubmit error (Jason)
    Store submit->fence_bos as an array of uintptr_t (Jason)

v6: condition device->has_thread_submit to i915 & core DRM support (Jason)

v7: Fix submit->in_fence leakage on error (Jason)
    Keep dummy semaphore with no thread submission (Jason)

v8: Move ownership of submit->out_fence to submit (Jason)

v9: Don't forget to read the VkFence's syncobj binary payload (Lionel)

v10: Take the mutex lock on anv_gem_close() (Jason/Lionel)

v11: Fix void* -> u64 cast on 32bit (Lionel)

v12: Rebase after BO backed timeline semaphore (Lionel)

v13: Fix missing snippets lost after rebase (Lionel)

v14: Drop update_binary usage (Lionel)

v15: Use ANV_MULTIALLOC (Lionel)

v16: Fix some realloc issues (Ivan)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (v8)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2901>

4 years agoanv: add new gem/drm helpers
Lionel Landwerlin [Tue, 6 Aug 2019 12:56:40 +0000 (15:56 +0300)]
anv: add new gem/drm helpers

Needed for dealing with the new DRM timeline syncobj ioctls.

v2: Make use of the anv_gem_get_drm_cap() parameter... (Jason)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2901>

4 years agoinclude/drm-uapi: bump headers
Lionel Landwerlin [Thu, 21 Feb 2019 12:21:44 +0000 (12:21 +0000)]
include/drm-uapi: bump headers

From drm-next at the following commit :

   commit 3393649977f9a8847c659e282ea290d4b703295c
   Merge: cbc2e82932ae ced026e959be
   Author: Dave Airlie <airlied@redhat.com>
   Date:   Fri Aug 28 13:51:30 2020 +1000

       Merge tag 'drm-intel-next-2020-08-24-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-next

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2901>

4 years agofreedreno/ir3: rework setup_{input,output} to make struct varyings work
Jonathan Marek [Thu, 13 Aug 2020 01:59:33 +0000 (21:59 -0400)]
freedreno/ir3: rework setup_{input,output} to make struct varyings work

Rework setup_{input,output} to be called during emit_intrinsic, in a way
which allows struct/array/matrix type varyings to work.

This allows turnip to pass dEQP-VK.glsl.linkage.varying.struct.*

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6181>

4 years agofreedreno/ir3: improve handling of aliased inputs
Jonathan Marek [Thu, 13 Aug 2020 01:57:15 +0000 (21:57 -0400)]
freedreno/ir3: improve handling of aliased inputs

This allows overlapping inputs, which is required for the next patch which
makes it so setup_input may be called multiple times for each input.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6181>

4 years agofreedreno/ir3: remove indirect input load
Jonathan Marek [Wed, 5 Aug 2020 02:19:03 +0000 (22:19 -0400)]
freedreno/ir3: remove indirect input load

nir_intrinsic_load_input should only be used with VS and FS, indirect input
shouldn't be possible for those.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6181>

4 years agoradv: Allow triggering thread traces by file.
Bas Nieuwenhuizen [Tue, 1 Sep 2020 12:59:55 +0000 (14:59 +0200)]
radv: Allow triggering thread traces by file.

Makes it actually feasible to trace games and not just demos/apitraces.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6537>

4 years agoradv: Centralize enabling thread trace.
Bas Nieuwenhuizen [Tue, 1 Sep 2020 12:49:35 +0000 (14:49 +0200)]
radv: Centralize enabling thread trace.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6537>

4 years agoamd/registers: switch to new generated register definitions
Marek Olšák [Fri, 21 Aug 2020 12:09:58 +0000 (08:09 -0400)]
amd/registers: switch to new generated register definitions

Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6423>

4 years agoamd/registers: add non-gfx10 register files generated from kernel headers
Marek Olšák [Fri, 21 Aug 2020 12:08:25 +0000 (08:08 -0400)]
amd/registers: add non-gfx10 register files generated from kernel headers

This was split from the next commit to reduce the massive deltas.

Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6423>

4 years agoamd/registers: add a script that generates json from kernel headers
Marek Olšák [Thu, 20 Aug 2020 09:07:35 +0000 (05:07 -0400)]
amd/registers: add a script that generates json from kernel headers

Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6423>

4 years agoamd/registers: sort registers by offset in json
Marek Olšák [Thu, 20 Aug 2020 08:03:13 +0000 (04:03 -0400)]
amd/registers: sort registers by offset in json

Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6423>

4 years agoamd/registers: expose the canonicalize.py program as a function
Marek Olšák [Thu, 20 Aug 2020 08:02:10 +0000 (04:02 -0400)]
amd/registers: expose the canonicalize.py program as a function

Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6423>

4 years agovulkan/wsi/x11: wait for acquirable images in FIFO mode
Roman Gilg [Mon, 31 Aug 2020 09:35:16 +0000 (11:35 +0200)]
vulkan/wsi/x11: wait for acquirable images in FIFO mode

In FIFO presentation mode we block either on our present-queue or on Present
events after an image was transmitted.

In case we receive completion events without idle events at some point we
exhaust our acquire-queue and can not block anymore on present-queue.

Ensure that the consumer has at least one image to acquire before blocking
again on present-queue. Otherwise wait for one from the X server.

CC: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3344
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6513>

4 years agovulkan/wsi/x11: add sent image counter
Roman Gilg [Mon, 31 Aug 2020 09:33:27 +0000 (11:33 +0200)]
vulkan/wsi/x11: add sent image counter

Add a counter to count how many images from our swapchain are currently "sent"
to the X server via Present extension. An image is sent when it has been
presented but we have not yet received an idle event for it.

CC: mesa-stable
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6513>

4 years agoaco: Add README which explains about what ACO is and how it works.
Timur Kristóf [Thu, 12 Mar 2020 15:07:40 +0000 (16:07 +0100)]
aco: Add README which explains about what ACO is and how it works.

This is based on an early summary written by Daniel, but updated to
reflect the current state of ACO and reworded to better fit the format.
Also added is a table which details what SW stages correspond to what
HW stages on each HW generation.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tony Wasserka <tony.wasserka@gmx.de>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4164>

4 years agoaco: Fixup markdown formatting of the README-ISA.
Timur Kristóf [Thu, 12 Mar 2020 13:25:52 +0000 (14:25 +0100)]
aco: Fixup markdown formatting of the README-ISA.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tony Wasserka <tony.wasserka@gmx.de>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4164>

4 years agoaco: Move README to README-ISA
Timur Kristóf [Mon, 31 Aug 2020 15:12:55 +0000 (17:12 +0200)]
aco: Move README to README-ISA

The old "readme" is not really a readme but rather just
a bunch of notes with our findings about the GCN/RDNA ISA.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tony Wasserka <tony.wasserka@gmx.de>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4164>

4 years agonir/algebraic: mark some optimizations with fsat(NaN) as inexact
Samuel Pitoiset [Mon, 31 Aug 2020 14:08:55 +0000 (16:08 +0200)]
nir/algebraic: mark some optimizations with fsat(NaN) as inexact

If a is Nan, fsat(NaN) is expected to be 0 and some optimizations
should be marked as inexact.

Fixes a GPU hang with Death Stranding and RADV/ACO (RADV/LLVM
isn't affected because it lowers fsat).

No fossils-db change.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3368
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6519>

4 years agoci: Restrict "success" job to pipelines for MRs
Michel Dänzer [Fri, 28 Aug 2020 15:08:57 +0000 (17:08 +0200)]
ci: Restrict "success" job to pipelines for MRs

Expected benefits:

* No more spurious non-MR pipelines with just this job.
* No more warnings from GitLab such as on
  https://gitlab.freedesktop.org/mesa/mesa/-/pipelines/195778

Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6492>

4 years agodocs: Stop claiming to implement OpenVG
Adam Jackson [Fri, 28 Aug 2020 21:17:15 +0000 (17:17 -0400)]
docs: Stop claiming to implement OpenVG

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6500>

4 years agoci: Don't exclude "success" job from mesa/mesa pipelines for MRs
Michel Dänzer [Mon, 31 Aug 2020 16:49:42 +0000 (18:49 +0200)]
ci: Don't exclude "success" job from mesa/mesa pipelines for MRs

Since the last GitLab update, pre-merge pipelines for MRs run in the
mesa/mesa namespace, so this job didn't get created anymore, causing
trouble.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6522>

4 years agoci: Create test-docs job in mesa/mesa pipelines for MRs
Michel Dänzer [Mon, 31 Aug 2020 16:46:37 +0000 (18:46 +0200)]
ci: Create test-docs job in mesa/mesa pipelines for MRs

Since the last GitLab update, pre-merge pipelines for MRs run in the
mesa/mesa namespace, so this job didn't get created anymore, causing
trouble.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6522>

4 years agogallivm: fix build on LLVM 12 due to LLVMAddConstantPropagationPass removal
Marek Olšák [Tue, 1 Sep 2020 01:59:39 +0000 (21:59 -0400)]
gallivm: fix build on LLVM 12 due to LLVMAddConstantPropagationPass removal

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3465
Cc: 20.1 20.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6531>

4 years agoradv: dump GPU info into the hang report
Samuel Pitoiset [Wed, 26 Aug 2020 16:29:13 +0000 (18:29 +0200)]
radv: dump GPU info into the hang report

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6471>

4 years agoradv: improve reporting faulty pipelines when a GPU hang is detected
Samuel Pitoiset [Wed, 26 Aug 2020 15:34:28 +0000 (17:34 +0200)]
radv: improve reporting faulty pipelines when a GPU hang is detected

Because the driver now waits for idle after every draw/dispatch
calls, we shouldn't report gfx pipelines when the GPU hang happens
after a dispatch (or the opposite).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6471>

4 years agoradv: force RADV_DEBUG=syncshaders when RADV_TRACE_FILE is used
Samuel Pitoiset [Wed, 26 Aug 2020 15:28:46 +0000 (17:28 +0200)]
radv: force RADV_DEBUG=syncshaders when RADV_TRACE_FILE is used

It's a requirement to be able to identify the first bad draw or
dispatch call.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6471>

4 years agovulkan: Fix memory leaks.
Vinson Lee [Mon, 31 Aug 2020 00:39:43 +0000 (17:39 -0700)]
vulkan: Fix memory leaks.

Fix warnings reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable info going out of scope leaks the storage it
points to.

Fixes: 9bc5b2d169d3 ("vulkan: add initial device selection layer. (v6.1)")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6509>

4 years agoradv/winsys: Fix memory leak.
Vinson Lee [Mon, 31 Aug 2020 00:52:32 +0000 (17:52 -0700)]
radv/winsys: Fix memory leak.

Fix warning reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable handles going out of scope leaks the storage it
points to.

Fixes 485ea7d711fc ("radv/winsys: pass the buffer list via the CS ioctl for less CPU overhead")

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6510>

4 years agonir/vtn: Convert constant samplers to variables with data
Jesse Natalie [Fri, 1 May 2020 17:47:58 +0000 (10:47 -0700)]
nir/vtn: Convert constant samplers to variables with data

Reviewd-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5242>

4 years agonir/vtn: Add intrinsics for CL image format/order queries
Jesse Natalie [Mon, 11 May 2020 16:09:47 +0000 (09:09 -0700)]
nir/vtn: Add intrinsics for CL image format/order queries

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5242>

4 years agonir/vtn: ImageSizeLod op can be applied to images
Jesse Natalie [Mon, 11 May 2020 16:08:15 +0000 (09:08 -0700)]
nir/vtn: ImageSizeLod op can be applied to images

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5242>

4 years agonir/vtn: Handle integer sampling coordinates
Jesse Natalie [Thu, 7 May 2020 00:20:26 +0000 (17:20 -0700)]
nir/vtn: Handle integer sampling coordinates

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5242>

4 years agonir/vtn: Use return type rather than image type for tex ops
Jesse Natalie [Tue, 14 Apr 2020 00:35:04 +0000 (17:35 -0700)]
nir/vtn: Use return type rather than image type for tex ops

Since OpenCL images don't have types, we can't use the image type here.
Rather than special-casing and only using SPIR-V return type for CL images,
we can just always use the return type to fill out the tex info.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5242>

4 years agonir/vtn: Add support for kernel images to SPIRV-to-NIR.
Jesse Natalie [Mon, 13 Apr 2020 15:05:13 +0000 (08:05 -0700)]
nir/vtn: Add support for kernel images to SPIRV-to-NIR.

There's a few quirks: kernel images are untyped, whether they're
sampled is unknown, and they're passed as inputs to the kernel even though
SPIR-V declares their address space as UniformConstant.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5242>

4 years agonir/vtn: Add type constant to image intrinsics
Jesse Natalie [Mon, 13 Apr 2020 14:50:37 +0000 (07:50 -0700)]
nir/vtn: Add type constant to image intrinsics

Since OpenCL supports untyped images, backends might need type info
to be able to support the load/store ops.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5242>

4 years agoclover/nir/spirv: Use uniform rather than shader_in for kernel inputs
Jesse Natalie [Fri, 28 Aug 2020 19:52:20 +0000 (12:52 -0700)]
clover/nir/spirv: Use uniform rather than shader_in for kernel inputs

The semantics of inputs for CL are a closer match to the semantics of uniforms for graphics.
Rather than cross-stage data, it's data that every thread sees uniformly.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6497>

4 years agopan/mdg: Fix perspective combination
Alyssa Rosenzweig [Mon, 31 Aug 2020 18:20:59 +0000 (14:20 -0400)]
pan/mdg: Fix perspective combination

It's not enough to multiply by a .w reciprocal, we have to be taking the
reciprocal of the thing we're actually multiplying against.

Fixes incorrect rendering in Manhattan.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6525>

4 years agopan/mdg: Fix discard encoding
Alyssa Rosenzweig [Mon, 31 Aug 2020 18:04:55 +0000 (14:04 -0400)]
pan/mdg: Fix discard encoding

Let's match the blob.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6525>

4 years agoanv: fix robust buffer access
Lionel Landwerlin [Sat, 29 Aug 2020 16:23:19 +0000 (19:23 +0300)]
anv: fix robust buffer access

In 957bbc6ad907ec we merged all the per stages allocations of push
constants into a single one. Unfortunately one field remained per
stage.

This fixes the issue by including all the per stage values of the
masked registers for robust buffer access into the push constant data.

v2: Drop unneeded loop (Jason)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 957bbc6ad907ec ("anv: simplify push constant emissions")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6505>

4 years agonir: Switch the indexing of block->live_in/out arrays.
Eric Anholt [Thu, 23 Jul 2020 19:29:02 +0000 (12:29 -0700)]
nir: Switch the indexing of block->live_in/out arrays.

In nir-to-tgsi, I want to free temps storing SSA values when they go dead,
and NIR liveness has most of the information I need.  Hoever, when I reach
the end of a block, I need to free whatever temps were in liveout which
are dead at that point.  If liveout is indexed by live_index, then I don't
know the maximum live_index for iterating the live_out bitset, and I also
don't have a way to map that index back to the def->index that my temps
are stored under.

We can use the more typical def->index for these bitsets, which resolves
both of those problems.  The only cost is that ssa_undefs don't get merged
into a single bit in the bitfield, but there are generally 1-4 of them in
a shader and we don't track liveness for those anyway so splitting them
apart is fine.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6408>

4 years agonir: Invalidate live SSA def information when making new SSA defs.
Eric Anholt [Wed, 26 Aug 2020 20:09:09 +0000 (13:09 -0700)]
nir: Invalidate live SSA def information when making new SSA defs.

Noted by @jekstrand in review of the SSA live index changes.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6408>

4 years agoci: Switch to using gold as the linker.
Eric Anholt [Thu, 13 Aug 2020 21:21:50 +0000 (14:21 -0700)]
ci: Switch to using gold as the linker.

Debian defaults to bfd, which is comically slow.  We can't use lld because
the old version we have in the debian stable we use has various bugs.

This required bumping libwayland, which had multiply-defined symbols
issues in the previous release.

Closes: #3236
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6324>

4 years agopipe-loader: Use real galliumvl if radeonsi is being linked.
Eric Anholt [Thu, 13 Aug 2020 23:13:08 +0000 (16:13 -0700)]
pipe-loader: Use real galliumvl if radeonsi is being linked.

When switching to lld, I saw errors from multiply defined vl symbols due to
radeonsi always linking libgalliumvl.

Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6324>

4 years agoturnip: Make sure we include the build id.
Eric Anholt [Thu, 13 Aug 2020 22:15:26 +0000 (15:15 -0700)]
turnip: Make sure we include the build id.

The ir3 disk cache is initialized when we use the ir3 compiler, even if we
don't use it ourselves, and it requires a build id.  With lld, it seems we
don't end up getting one included by default.

Fixes: f97acb4bb4b1 ("freedreno/ir3: disk-cache support")
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6324>

4 years agoci: Make a missing device name correctly bail out of deqp-runner.sh.
Eric Anholt [Thu, 13 Aug 2020 22:10:18 +0000 (15:10 -0700)]
ci: Make a missing device name correctly bail out of deqp-runner.sh.

If your driver is totally broken and can't even report its name, let's
stop here instead of doing a CTS run full of failure to start tests and
reporting them all missing at the end.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6324>

4 years agonir: add shared/global atomics to nir_get_io_offset_src()
Italo Nicola [Thu, 20 Aug 2020 12:28:13 +0000 (12:28 +0000)]
nir: add shared/global atomics to nir_get_io_offset_src()

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6521>

4 years agonir: Look up the shader when printing a single instruction.
Eric Anholt [Fri, 28 Aug 2020 19:27:04 +0000 (12:27 -0700)]
nir: Look up the shader when printing a single instruction.

If you've inserted the instruction into a block, then we can get to the
shader.  This improves our instruction output, giving you i/o semantics
and variable names in intrinsics.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6496>

4 years agonir: Fix printing of individual instructions with io semantics.
Eric Anholt [Thu, 27 Aug 2020 18:33:31 +0000 (11:33 -0700)]
nir: Fix printing of individual instructions with io semantics.

The state->shader is missing when used outside of nir_print_shader, just
drop these details in that case.  We can fix nir_print_instr() to look up
the shader, but let's also make sure that an instr detached from a shader
(such as one you're constructing but haven't yet inserted) still works.

Fixes: 2b1ef5df4eac ("nir: print IO semantics (v2)")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6496>

4 years agopanfrost: enable DrawTransformFeedback*
Ilia Mirkin [Sun, 9 Aug 2020 04:13:14 +0000 (00:13 -0400)]
panfrost: enable DrawTransformFeedback*

This is needed for ARB_transform_feedback2, which I plan on requiring
for ES3. Also update docs/features.txt

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6247>

4 years agointel/nir: Lower things with > 4 components in lower_mem_access_bit_sizes
Jason Ekstrand [Thu, 27 Aug 2020 22:55:04 +0000 (17:55 -0500)]
intel/nir: Lower things with > 4 components in lower_mem_access_bit_sizes

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6502>

4 years agointel/fs: Add support for vec8 and vec16 ops
Jason Ekstrand [Thu, 27 Aug 2020 22:42:43 +0000 (17:42 -0500)]
intel/fs: Add support for vec8 and vec16 ops

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6502>

4 years agoanv: VK_INTEL_performance_query interaction with VK_EXT_private_data
Lionel Landwerlin [Mon, 10 Aug 2020 07:27:57 +0000 (10:27 +0300)]
anv: VK_INTEL_performance_query interaction with VK_EXT_private_data

All objects are expected to have the base internal object for private
data storage.

This also fixes a memory leak of a gen_perf_registers structure.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 51c6bc13ce3a70 ("anv,vulkan: Implement VK_EXT_private_data")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6255>

4 years agovulkan: Don't pointlessly depend on libxcb-dri2
Adam Jackson [Tue, 25 Aug 2020 19:57:58 +0000 (15:57 -0400)]
vulkan: Don't pointlessly depend on libxcb-dri2

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6499>

4 years agozink: add note about buffer<->image copy functions not handling multisample
Mike Blumenkrantz [Sun, 14 Jun 2020 05:46:20 +0000 (01:46 -0400)]
zink: add note about buffer<->image copy functions not handling multisample

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6266>

4 years agozink: use u_transfer_helper to split/merge interleaved depth/stencil formats
Mike Blumenkrantz [Mon, 1 Jun 2020 14:53:19 +0000 (10:53 -0400)]
zink: use u_transfer_helper to split/merge interleaved depth/stencil formats

EXT_packed_depth_stencil adds GL_UNSIGNED_INT_24_8_EXT which is an interleaved format,
but vulkan spec states that reading/writing the corresponding format provides only the
D24 component, which requires that we perform separate operations for each component
using separate buffers

fixes mesa/mesa#3031

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6266>

4 years agobroadcom/qpu_instr: wait is not a read or write vpm instruction
Alejandro Piñeiro [Wed, 26 Aug 2020 23:07:20 +0000 (01:07 +0200)]
broadcom/qpu_instr: wait is not a read or write vpm instruction

For several schedule restrictions, we are checking if the instruction
is using the vpm. So far it was implemented as being a read or a write
of the vpm. But VPM wait (vpmwt) is not a read or a write (it is a
wait until all pending writes finishes). This is relevant to implement
peripheral accesses restrictions, as for some cases where vpm
read|writes are allowed, vpmwt is not.

Fixes:
  dEQP-VK.binding_model.descriptorset_random.sets8.constant.ubolimitlow.sbolimitlow.sampledimglow.outimgtexlow.noiub.nouab.vert.noia.0

On the sim, as it was raising an assert for wrong peripheral access.

v2: simplify v3d_qpu_waits_vpm (Iago)

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6498>

4 years agodocs/features: Add missing Panfrost extensions
Alyssa Rosenzweig [Mon, 31 Aug 2020 11:44:56 +0000 (07:44 -0400)]
docs/features: Add missing Panfrost extensions

+  GL_ARB_internalformat_query
+  GL_ARB_texture_stencil8
+  GL_ARB_stencil_texturing
+  GL_ARB_compute_shader
+  GL_ARB_shader_storage_buffer_object

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6516>

4 years agopanfrost: Set PIPE_CAP_MAX_TEXTURE_GATHER_COMPONENTS
Alyssa Rosenzweig [Fri, 28 Aug 2020 13:53:30 +0000 (09:53 -0400)]
panfrost: Set PIPE_CAP_MAX_TEXTURE_GATHER_COMPONENTS

Exposes ARB_texture_gather when PAN_MESA_DEBUG=deqp is set. Also update
docs/features.txt.

Fixes:

   dEQP-GLES31.functional.texture.gather.offset.implementation_offset.*

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6516>

4 years agopan/mdg: Implement texture gathers
Alyssa Rosenzweig [Fri, 28 Aug 2020 13:48:38 +0000 (09:48 -0400)]
pan/mdg: Implement texture gathers

As previously shown, it is a mode on top of textureLod. The main gotcha
is the results are swizzled; we reuse the Broadcom lowering for that.

Also, there's a pretty significant erratum affecting gathers of cubemaps
which can be dealt with... eventually.

Fixes:

   dEQP-GLES31.functional.texture.gather.basic.2d.*
   dEQP-GLES31.functional.texture.gather.basic.2d_array.*

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6516>

4 years agopan/mdg: Add disassembly for shadow gathers
Alyssa Rosenzweig [Fri, 28 Aug 2020 12:53:44 +0000 (08:53 -0400)]
pan/mdg: Add disassembly for shadow gathers

By applying `textureGather` to a `sampler2DShadow`, the blob produces
(under the old disassembly):

   tex_22.vtx.2d.shadow.cont.last r29, texture0, fsampler0.zwyx, r29,

The op 0x22 is 10|0010 in binary, the old shadow parameter is 1, and old
gather parameter is 0, so we get 0110|0010 in binary, or an op of
textureLod with a mod of 0110 = 6.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6516>

4 years agopan/mdg: Refactor texture op/mode handling
Alyssa Rosenzweig [Fri, 28 Aug 2020 12:35:19 +0000 (08:35 -0400)]
pan/mdg: Refactor texture op/mode handling

We reduce the op to 4-bits, such that the derivative mode becomes its
own adjacent parameter. This cleans up handling of texture gathers, but
does not affect functionality.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6516>

4 years agopan/mdg: Implement nir_intrinsic_load_sample_mask_in
Alyssa Rosenzweig [Thu, 27 Aug 2020 23:55:53 +0000 (19:55 -0400)]
pan/mdg: Implement nir_intrinsic_load_sample_mask_in

Also goes down the magical ld_color_buffer_32u_old path, but with a
different magic number.

Maybe should just be the ld_magic instruction.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6516>

4 years agopan/mdg: Bounds check swizzle writing globals
Alyssa Rosenzweig [Thu, 27 Aug 2020 19:13:19 +0000 (15:13 -0400)]
pan/mdg: Bounds check swizzle writing globals

Fixes scheduler hang in:

dEQP-GLES31.functional.shaders.opaque_type_indexing.ubo.const_literal_compute

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6516>

4 years agopan/mdg: Scalarize 64-bit
Alyssa Rosenzweig [Thu, 27 Aug 2020 18:55:11 +0000 (14:55 -0400)]
pan/mdg: Scalarize 64-bit

We don't properly support 64-bit vec2 yet for various reasons, and as-is
vectorize will try to create vec4 which we choke on. Since any workloads
relying on 64-bit vector performance are already DOA at this point,
let's just do the conformant thing.

Fixes:

   dEQP-GLES31.functional.shaders.builtin_functions.integer.umulextended.uvec2_highp_compute

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6516>

4 years agopan/mdg: Implement i/umul_high
Alyssa Rosenzweig [Thu, 27 Aug 2020 18:35:23 +0000 (14:35 -0400)]
pan/mdg: Implement i/umul_high

As imul with a .hi modifier, which implies a 64-bit computation.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6516>

4 years agopanfrost: Emit texture/sampler points for compute
Alyssa Rosenzweig [Thu, 27 Aug 2020 22:59:14 +0000 (18:59 -0400)]
panfrost: Emit texture/sampler points for compute

Fixes page faults on dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.const_literal.compute.sampler2d

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6516>

4 years agoutil/u_thread: include pthread_np.h if found
Jonathan Gray [Wed, 24 Jun 2020 13:27:52 +0000 (23:27 +1000)]
util/u_thread: include pthread_np.h if found

Required for pthread_set_name_np() on OpenBSD as there is no
pthread_setaffinity_np() to define PTHREAD_SETAFFINITY_IN_NP_HEADER.

Fixes: dcf9d91a80e ("util: Handle differences in pthread_setname_np")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5630>

4 years agoutil: futex fixes for OpenBSD
Jonathan Gray [Thu, 20 Feb 2020 02:18:01 +0000 (13:18 +1100)]
util: futex fixes for OpenBSD

Fix absolute to relative timeout computation.

Add sanity checks to futex_wait()
- handle the NULL timeout pointer case
- avoid negative cases.

From Matthieu Herrb and Scott Cheloha.

Fixes: c91997b6c43 ("util/futex: use futex syscall on OpenBSD")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Acked-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5630>

4 years agomeson: conditionally include -ldl in gbm pkg-config file
Jonathan Gray [Fri, 6 Dec 2019 06:25:58 +0000 (17:25 +1100)]
meson: conditionally include -ldl in gbm pkg-config file

Follow libGL and only include -ldl in gbm pkg-config file if libdl was
actually found.  Many systems have these functions in libc and don't
have libdl.

Fixes: 816bf7d1644 ("meson: build gbm")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5630>

4 years agomeson: don't build with USE_ELF_TLS on OpenBSD
Jonathan Gray [Fri, 6 Dec 2019 04:23:36 +0000 (15:23 +1100)]
meson: don't build with USE_ELF_TLS on OpenBSD

OpenBSD does not have TLS

Fixes: a47c525f328 ("meson: build glx")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5630>

4 years agomeson: don't advertise TLS support if glx wasn't build with it
Eric Engestrom [Thu, 21 Nov 2019 22:14:50 +0000 (22:14 +0000)]
meson: don't advertise TLS support if glx wasn't build with it

Fixes: a47c525f328 ("meson: build glx")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5630>

4 years agomeson: build with _ISOC11_SOURCE on OpenBSD
Jonathan Gray [Fri, 6 Dec 2019 03:30:14 +0000 (14:30 +1100)]
meson: build with _ISOC11_SOURCE on OpenBSD

Mesa builds with -std=c99 but uses timespec_get() a c11 function.
Build with _ISOC11_SOURCE for c11 visibility when -std is specified.
On linux c11 visibility comes from defining _GNU_SOURCE.

Fixes: e3a8013de8c ("util/u_queue: add util_queue_fence_wait_timeout")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5630>

4 years agoutil/anon_file: add OpenBSD shm_mkstemp() path
Jonathan Gray [Thu, 1 Nov 2018 02:16:13 +0000 (13:16 +1100)]
util/anon_file: add OpenBSD shm_mkstemp() path

memfd_create() is a linux syscall replace the use of it with
shm_mkstemp() on OpenBSD.

unconditionally include stdlib.h for mkstemp()/mkostemp()

Fixes: c0376a12341 ("util: add anon_file.h for all memfd/temp file usage")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5630>

4 years agoutil: unbreak endian detection on OpenBSD
Jonathan Gray [Wed, 28 Mar 2018 03:06:14 +0000 (14:06 +1100)]
util: unbreak endian detection on OpenBSD

Since cbee1bfb34274668a05995b9d4c78ddec9e5ea4c endian.h is unconditionally
used if available.

glibc has byte order defines with two leading underscores.  OpenBSD
has private defines with a single leading underscore in machine/endian.h
and public defines in endian.h with no underscore.

The code under the endian.h block did not check if symbols were
defined before equating them so '#if __BYTE_ORDER == __LITTLE_ENDIAN'
would turn into '#if 0 == 0' which is always true.

Fixes: cbee1bfb342 ("meson/configure: detect endian.h instead of trying to guess when it's available")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5630>

4 years agoradv: dump shader stats with VK_KHR_pipeline_executable_properties
Samuel Pitoiset [Thu, 20 Aug 2020 14:03:36 +0000 (16:03 +0200)]
radv: dump shader stats with VK_KHR_pipeline_executable_properties

Instead of duplicating shader statistics in two different parts
in the driver. This also now reports the LDS size in bytes instead
of blocks with VK_AMD_shader_info.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6406>

4 years agovallium: disable VK_KHR_shader_float16_int8.
Dave Airlie [Wed, 26 Aug 2020 03:15:09 +0000 (13:15 +1000)]
vallium: disable VK_KHR_shader_float16_int8.

This is actually a TODO.

Fixes:
dEQP-VK.info.device_mandatory_features

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6381>

4 years agogallivm/nir: add some f16 support
Dave Airlie [Mon, 24 Aug 2020 03:52:46 +0000 (13:52 +1000)]
gallivm/nir: add some f16 support

GLSL lowers packhalf2x16 itself, but for SPIRV we don't have that
option.

For packing when NIR lowers it uses f2f16
and for unpack it needs the casting and f2f32

Fixes:
dEQP-VK.glsl.builtin.function.pack_unpack.packhalf2x16*
dEQP-VK.glsl.builtin.function.pack_unpack.unpackhalf2x16*

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6381>

4 years agogallivm/nir: allow 64-bit arit ops
Dave Airlie [Fri, 19 Jun 2020 07:12:19 +0000 (17:12 +1000)]
gallivm/nir: allow 64-bit arit ops

Fixes:
dEQP-VK.glsl.builtin.precision_double.round.*
dEQP-VK.glsl.builtin.precision_double.roundeven.*
dEQP-VK.glsl.builtin.precision_double.trunc.*

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6381>

4 years agollvmpipe/fs: multisample depth/stencil bad ir generated
Dave Airlie [Fri, 19 Jun 2020 06:57:16 +0000 (16:57 +1000)]
llvmpipe/fs: multisample depth/stencil bad ir generated

Need to update the z value after updating the pos at pixel
center, and later reupdate it again, so we can avoid some
LLVM IR values not being dominant issues.

Fixes:
dEQP-VK.renderpass.suballocation.multisample.s8_uint.samples_4

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6381>

4 years agollvmpipe: add array/3d clearing support
Dave Airlie [Fri, 19 Jun 2020 06:56:36 +0000 (16:56 +1000)]
llvmpipe: add array/3d clearing support

Fixes:
dEQP-VK.pipeline.multisample.sampled_image.64x64_4.*.samples_4

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6381>

4 years agollvmpipe: blend has effects even if no colorbuffers.
Dave Airlie [Fri, 19 Jun 2020 06:57:41 +0000 (16:57 +1000)]
llvmpipe: blend has effects even if no colorbuffers.

ARB_framebuffer_no_attachments + multisampling means blend
can have an effect even outside of colorbufs

Fixes:
dEQP-VK.pipeline.multisample.alpha_to_coverage_no_color_attachment.samples_4.alpha_opaque

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6381>

4 years agogallivm: use common code to select texel type
Dave Airlie [Mon, 31 Aug 2020 00:22:35 +0000 (10:22 +1000)]
gallivm: use common code to select texel type

This was suggested by Roland, and fixes stencil images.

Fixes:
dEQP-VK.renderpass.dedicated_allocation.formats.d24_unorm_s8_uint.*
dEQP-VK.renderpass.dedicated_allocation.formats.d32_sfloat_s8_uint.*

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6381>

4 years agogallivm/nir: add subpass sampler type support
Dave Airlie [Fri, 19 Jun 2020 06:50:55 +0000 (16:50 +1000)]
gallivm/nir: add subpass sampler type support

Fixes:
dEQP-VK.renderpass.dedicated_allocation.attachment_allocation.input_output.*
dEQP-VK.renderpass.dedicated_allocation.formats*input*

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6381>

4 years agogallivm/nir: lower frexp/ldexp
Dave Airlie [Thu, 20 Aug 2020 06:06:56 +0000 (16:06 +1000)]
gallivm/nir: lower frexp/ldexp

Fixes:
dEQP-VK.glsl.builtin.precision.frexp*
dEQP-VK.glsl.builtin.precision.ldexp*

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6381>

4 years agogallivm/nir: fix const compact
Dave Airlie [Fri, 19 Jun 2020 07:11:12 +0000 (17:11 +1000)]
gallivm/nir: fix const compact

Since adding support for compacts this crashes with indirects
don't get the const address unless it's a const.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6381>