mesa.git
18 months agoglx: omit loader_loader() for macOS
Emil Velikov [Tue, 7 Apr 2020 16:45:33 +0000 (17:45 +0100)]
glx: omit loader_loader() for macOS

Earlier commit added the code unconditionally, since the loader code
itself is already built on macOS.
Although it did not consider the #include mayhem that src/glx is.

In particular, none of the __GLXDRI{screen,context,drawable) are
available for macOS... those are pulled by dri_common.[ch].

Ideally we'll untangle that, but for the time being simply #ifdef out
the include/call.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2726
Fixes: b699d070a6d ("glx: set the loader_logger early and for everyone")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4490>

18 months agoclover: expose cl_arm_shared_virtual_memory for devices with SVM support
Karol Herbst [Fri, 24 May 2019 13:47:28 +0000 (15:47 +0200)]
clover: expose cl_arm_shared_virtual_memory for devices with SVM support

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2076>

18 months agoclover: implement cl_arm_shared_virtual_memory
Karol Herbst [Wed, 22 May 2019 12:27:23 +0000 (14:27 +0200)]
clover: implement cl_arm_shared_virtual_memory

v2: use static array to keep name -> func mapping
v3: use unordered_map
v4: handle ARM constants
    reorder dispatch table
    wrap enqueue APIs as the command value differs between khr and arm
v5: move declarations into dispatch.hpp
    handle CL_MEM_USES_SVM_POINTER_ARM in clGetMemObjectInfo
v6: breaking long lines

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2076>

18 months agoclover: implement SVM functions for devices with fine grained system SVM support
Karol Herbst [Wed, 22 May 2019 20:34:09 +0000 (22:34 +0200)]
clover: implement SVM functions for devices with fine grained system SVM support

all of the functionality can be mapped to malloc/free if the device supports
fine grained system SVM.

v2: fix some API bugs found with the OpenCL CTS
v3: remove validate_even_wait_list
    improve implementation of clSetKernelExecInfo
    make clEnqueueSVMFree spec compliant
    rename can_emulate_non_system_svm to has_system_svm and make it a member method
    improve validation in clEnqueueSVMMemFill
    handle CL_MEM_USES_SVM_POINTER in clGetMemObjectInfo
v4: break long lines and other minor cosmetic adjustments

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2076>

18 months agoclover: implement clSetKernelArgSVMPointer
Karol Herbst [Mon, 12 Mar 2018 10:04:53 +0000 (11:04 +0100)]
clover: implement clSetKernelArgSVMPointer

it is pretty much identical to a clSetKernelArg for a scalar field, except
it is only valid for global and constant memory pointers.

Also the type equals void* on the Host, so we can just check the size of it.

v2: prefer using target_size to extend the pointer value
v3: handle more corner cases in combiation to clSetKernelArg

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Pierre Moreau <dev@pmoreau.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2076>

18 months agoclover: implement CL_DEVICE_SVM_CAPABILITIES
Karol Herbst [Mon, 21 May 2018 10:19:42 +0000 (12:19 +0200)]
clover: implement CL_DEVICE_SVM_CAPABILITIES

v2: without supporting userptrs SVM can't be implemented as it's impossible
    to ensure memory consistency with HOST_PTR buffers
v3: fix comment style
v4: fixes typo in comment

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Pierre Moreau <dev@pmoreau.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2076>

18 months agoclover: add stubs for SVM
Karol Herbst [Wed, 22 May 2019 11:46:40 +0000 (13:46 +0200)]
clover: add stubs for SVM

although most of those are 2.0 core functions, there is
cl_arm_shared_virtual_memory to expose those in a 1.2 context. But we
should be able to expose this extension with 1.1 as well as there is no
technicaly reason why this shouldn't work.

v2: move svm functions into existing files
v3: rename func args to match convention

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2076>

18 months agogallium: add PIPE_CAP_SYSTEM_SVM
Karol Herbst [Thu, 13 Dec 2018 23:33:04 +0000 (00:33 +0100)]
gallium: add PIPE_CAP_SYSTEM_SVM

v2: split enum in specific caps to abstract the CL enum
v3: remove BUFFER_SVM caps

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2076>

18 months agoaco: fix 1D textureGrad() on GFX9
Rhys Perry [Tue, 14 Apr 2020 14:15:02 +0000 (15:15 +0100)]
aco: fix 1D textureGrad() on GFX9

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 6f718edcedd ('aco: simplify gathering of MIMG address components')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4550>

18 months agoiris: drop cache coherent cpu mapping for external BO
Lionel Landwerlin [Mon, 13 Apr 2020 15:14:24 +0000 (18:14 +0300)]
iris: drop cache coherent cpu mapping for external BO

We have to assume any external buffer could be used by the display HW.
In the case that buffer is also CPU mapped, we want to assume no cache
coherency as it is only available between GT & CPU, not display.

Many thanks to Michel Dänzer for the hint!

v2: Move cache coherent drop to bufmgr (Chris)

v3: Also make BO external if created with PIPE_BIND_SHARED (Eric)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2552
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4533>

18 months agoaco: fix nir_op_frexp_exp with 16-bit floats and negative exponents
Samuel Pitoiset [Tue, 14 Apr 2020 07:42:48 +0000 (09:42 +0200)]
aco: fix nir_op_frexp_exp with 16-bit floats and negative exponents

v_frexp_exp_i16_f16 returns the two's complement for negative
exponents. For example, with 0.333252 it returns 0.666504 for
the mantissa and 65535 for the exponent (-1 in decimal).

RADV/LLVM and AMDVLK do a v_bfe_i32 and AMDGPU-PRO uses SDWA with
the sign extension bit set. The latter is probably what we want to
do in long term but for now RA doesn't support changing non-SDWA
instructions to SDWA if useful/needed.

Fixes dEQP-VK.glsl.builtin.precision_fp16_storage16b.frexp.compute.*.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4546>

18 months agou_blitter: fix stencil blitting
Dave Airlie [Fri, 10 Apr 2020 03:27:09 +0000 (13:27 +1000)]
u_blitter: fix stencil blitting

Fixes: KHR-GL45.packed_depth_stencil.blit.depth32f_stencil8
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4560>

18 months agodraw: fix user culling pipeline order. (v2)
Dave Airlie [Fri, 27 Mar 2020 01:33:43 +0000 (11:33 +1000)]
draw: fix user culling pipeline order. (v2)

GL spec requires user culling, then clipping then face culling.
llvmpipe was doing clipping then user culling then face culling.

Fix the ordering by adding a new user_cull stage that does the user
culling

Fixes piglit clip_cull-4.shader_test

v2: simplify this a lot (Roland)

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

18 months agodraw/cull: run pipeline for culled points.
Dave Airlie [Thu, 9 Apr 2020 23:19:10 +0000 (09:19 +1000)]
draw/cull: run pipeline for culled points.

This just appears to be missing:
Fixes:
KHR-GL45.cull_distance.functional

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

18 months agollvmpipe/setup: move line stats collection earlier.
Dave Airlie [Fri, 10 Apr 2020 00:15:50 +0000 (10:15 +1000)]
llvmpipe/setup: move line stats collection earlier.

You have to count the stats pre-culling here.

Fixes:
KHR-GL45.pipeline_statistics_query_tests_ARB.functional_primitives_vertices_submitted_and_clipping_input_output_primitives

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

18 months agodraw: fix tessellation stats query
Dave Airlie [Fri, 10 Apr 2020 04:35:24 +0000 (14:35 +1000)]
draw: fix tessellation stats query

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

18 months agollvmpipe: fix no tokens detections.
Dave Airlie [Wed, 8 Apr 2020 05:44:15 +0000 (15:44 +1000)]
llvmpipe: fix no tokens detections.

this only applies to the TGSI path, fixes
KHR-GLES31.core.geometry_shader.api.program_pipeline_vs_gs_capture

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

18 months agogallivm/draw: calloc prim id toavoid undef
Dave Airlie [Wed, 8 Apr 2020 05:43:47 +0000 (15:43 +1000)]
gallivm/draw: calloc prim id toavoid undef

Otherwise masked off channels can access random bad memory

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

18 months agogallivm/nir: lower implicit lod to tex.
Dave Airlie [Tue, 7 Apr 2020 23:04:50 +0000 (09:04 +1000)]
gallivm/nir: lower implicit lod to tex.

Fixes some sampling issues in vertex shaders

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

18 months agogallivm: fix left over shader vote debug
Dave Airlie [Mon, 6 Apr 2020 07:04:57 +0000 (17:04 +1000)]
gallivm: fix left over shader vote debug

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

18 months agollvmpipe/query: fix transform feedback overflow any queries.
Dave Airlie [Fri, 27 Mar 2020 03:29:59 +0000 (13:29 +1000)]
llvmpipe/query: fix transform feedback overflow any queries.

The any queries need to signal if any stream has overflowed,
so we have to track all the streams.

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

18 months agollvmpipe: report tessellation shader statistics.
Dave Airlie [Thu, 26 Mar 2020 05:37:01 +0000 (15:37 +1000)]
llvmpipe: report tessellation shader statistics.

Fixes KHR-GL45.pipeline_statistics_query_tests_ARB.functional_tess_queries

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

18 months agodraw: collect tessellation invocations statistics
Dave Airlie [Thu, 26 Mar 2020 05:36:42 +0000 (15:36 +1000)]
draw: collect tessellation invocations statistics

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

18 months agollvmpipe: fixup context leaks.
Dave Airlie [Tue, 14 Apr 2020 21:17:20 +0000 (07:17 +1000)]
llvmpipe: fixup context leaks.

Make sure we unreference all resources for all shaders on context
destruction.

Fixes: eb5227173f03 (llvmpipe: add support for tessellation shaders)
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4560>

18 months agoswr: Remove Byte Order Mark.
Vinson Lee [Tue, 17 Mar 2020 20:55:07 +0000 (13:55 -0700)]
swr: Remove Byte Order Mark.

before:
$ file src/gallium/drivers/swr/rasterizer/codegen/gen_llvm_types.py
src/gallium/drivers/swr/rasterizer/codegen/gen_llvm_types.py: Python script text executable, UTF-8 Unicode (with BOM) text

after:
$ file src/gallium/drivers/swr/rasterizer/codegen/gen_llvm_types.py
src/gallium/drivers/swr/rasterizer/codegen/gen_llvm_types.py: Python script text executable, ASCII text

This patch also fixes this build error.

  File "src/gallium/drivers/swr/rasterizer/codegen/gen_llvm_types.py", line 1

    # Copyright (C) 2014-2018 Intel Corporation.   All Rights Reserved.

    ^

SyntaxError: invalid character in identifier

Fixes: c6e67f5a9373 ("gallium/swr: add OpenSWR rasterizer")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jan Zielinski <jan.zielinski@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4221>

18 months agoglsl/list: Fix undefined behaviour of foreach_* macros
Danylo Piliaiev [Tue, 10 Mar 2020 12:21:34 +0000 (14:21 +0200)]
glsl/list: Fix undefined behaviour of foreach_* macros

These macros produced a lot of errors with ubsan preventing us from
expanding the ubsan coverage on CIs.

C++ spec has such clause:

 "If the prvalue of type "pointer to cv1 B" points to a B that is
  actually a subobject of an object of type D, the resulting pointer
  points to the enclosing object of type D. Otherwise, the result
  of the cast is undefined."

Ubsan error example:

 ../src/compiler/glsl/builtin_functions.cpp:4945:4: runtime error: downcast of address 0x559b926abb50 which does not point to an object of type 'ir_instruction'
 0x559b926abb50: note: object has invalid vptr
  9b 55 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  58 ba 6a 92 9b 55 00 00  01 00 00 00
               ^~~~~~~~~~~~~~~~~~~~~~~
               invalid vptr
     #0 0x559b914dbe1a in call ../src/compiler/glsl/builtin_functions.cpp:4945

Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4129>

18 months agofreedreno/ir3: don't overwrite wrmask in ir3_SAM
Jonathan Marek [Tue, 14 Apr 2020 18:22:07 +0000 (14:22 -0400)]
freedreno/ir3: don't overwrite wrmask in ir3_SAM

Fixes (with other patches to allow these tests to run):

dEQP-VK.ycbcr.query.size_lod.vertex.*

Suggested-by: Rob Clark <robclark@gmail.com>
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4557>

18 months agofreedreno/ir3: fix emit_tex_info split_dest
Jonathan Marek [Tue, 14 Apr 2020 18:19:14 +0000 (14:19 -0400)]
freedreno/ir3: fix emit_tex_info split_dest

Fixes a "free(): invalid next size (fast)" error in:

dEQP-VK.glsl.texture_functions.query.texturequerylevels.*

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

18 months agogallium/tgsi_to_nir: Set nir_intrinsic_align_mul to 16 and offset to 0
Gert Wollny [Mon, 13 Apr 2020 17:51:42 +0000 (19:51 +0200)]
gallium/tgsi_to_nir: Set nir_intrinsic_align_mul to 16 and offset to 0

Since the alignment is now checked in the validator we must set it.

v2: Use alignement of 4, i.e. dest bit size by eight.
v3: Use alignment 16 (Rhys Perry & Jason Ekstand)
v4: Use nir_intrinsic_set_align to make it clear that align offset is 0
    (Jason)

Fixes: e78a7a182524f091e2d77ba97bfbe057c3975cab
    nir: Assert memory loads are aligned

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4544>

18 months agoir3: Fix txs with bindless
Connor Abbott [Tue, 14 Apr 2020 09:35:50 +0000 (11:35 +0200)]
ir3: Fix txs with bindless

I missed that this had a micro-optimization to assume that there was
only ever one source, which is no longer valid for the bindless model
since we now have a bindless handle source. Remove the optimization to
fix assertion failures with turnip.

Fixes e.g.
dEQP-VK.glsl.texture_functions.query.texturesize.sampler2d_fixed_vertex

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4548>

18 months agogitlab-ci: make explicit tracie is gitlab specific
Andres Gomez [Wed, 8 Apr 2020 20:52:14 +0000 (23:52 +0300)]
gitlab-ci: make explicit tracie is gitlab specific

Tracie main script and traces.yml file talk about repo(sitory) when it
actually means GitLab's project.

Since the script is GitLab's API specific, make it clear.

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4496>

18 months agogitlab-ci: protect usage of shell variables with double quotes
Andres Gomez [Thu, 2 Apr 2020 19:38:34 +0000 (22:38 +0300)]
gitlab-ci: protect usage of shell variables with double quotes

Not really needed right now, but seems dangerous to have paths without
the double quote.

I went ahead and used in the rest of values too.

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4496>

18 months agogitlab-ci: Vulkan tracie runner to return last command exit code
Andres Gomez [Tue, 7 Apr 2020 15:38:12 +0000 (18:38 +0300)]
gitlab-ci: Vulkan tracie runner to return last command exit code

No need to cache the return value if there is only a single trace
execution call.

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4496>

18 months agogitlab-ci: Check the Mesa version used for tracie tests
Alexandros Frantzis [Thu, 9 Apr 2020 15:40:38 +0000 (18:40 +0300)]
gitlab-ci: Check the Mesa version used for tracie tests

Verify that the Mesa version used when running tracie tests is the
one that was built by CI, rather than any installed distro version.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3894>

18 months agoaco: clear moved operands in get_reg_create_vector()
Rhys Perry [Fri, 10 Apr 2020 11:24:28 +0000 (12:24 +0100)]
aco: clear moved operands in get_reg_create_vector()

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4507>

18 months agoaco: improve p_create_vector RA for sub-dword operands
Rhys Perry [Fri, 10 Apr 2020 10:38:20 +0000 (11:38 +0100)]
aco: improve p_create_vector RA for sub-dword operands

These's still improvements needed for sub-dword definitions, but that's
not as simple.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4507>

18 months agoaco: fix p_extract_vector validation
Rhys Perry [Fri, 10 Apr 2020 14:11:03 +0000 (15:11 +0100)]
aco: fix p_extract_vector validation

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4507>

18 months agoaco: improve vector optimization with sub-dword vectors
Rhys Perry [Fri, 10 Apr 2020 12:09:54 +0000 (13:09 +0100)]
aco: improve vector optimization with sub-dword vectors

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4507>

18 months agoradv: use RMW packets for updating the maximum sample distance
Samuel Pitoiset [Mon, 13 Apr 2020 09:50:06 +0000 (11:50 +0200)]
radv: use RMW packets for updating the maximum sample distance

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/4531>

18 months agoradv: add radeon_set_context_reg_rmw() helper
Samuel Pitoiset [Mon, 13 Apr 2020 09:38:33 +0000 (11:38 +0200)]
radv: add radeon_set_context_reg_rmw() helper

For emitting RMW packets in the command stream. This new helper
will be useful for implementing extended dynamic states to only
overwrite the fields that need to be updated instead of storing
more values in the pipeline.

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/4531>

18 months agoscons/windows: Support build with LLVM 10.
pal1000 [Sat, 11 Apr 2020 08:16:41 +0000 (11:16 +0300)]
scons/windows: Support build with LLVM 10.

LLVM engine component contains 2 new libraries, LLVMCFGuard and LLVMTextAPI.
Without them build fails like in this run: https://ci.appveyor.com/project/Alexpux/mingw-packages/builds/32102425/job/wkmb4gimfqkkb3cg

Cc: <mesa-stable@lists.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4521>

18 months agomeson: Link Gallium Nine with ld_args_build_id
Tobias Jakobi [Thu, 9 Apr 2020 09:29:54 +0000 (11:29 +0200)]
meson: Link Gallium Nine with ld_args_build_id

This fixes an assertion in iris_disk_cache_init() when the initialization
goes through drm_create_adapter(), which lives in d3dadapter9.so.
In this case build_id_find_nhdr_for_addr() fails and returns NULL, since
the shared library does not include a build ID.

The issue can be reproduced with an iris capable GPU and Xnine, while
removing the shader cache prior to launching the application.

Fix this by doing the same as in 29ea92e6a1e8f5cb3295011d907ea211d6f8f644.

Fixes: 4756864cdc5f "iris: Start wiring up on-disk shader cache"
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4499>

18 months agosvga: fix build on FreeBSD
Greg V [Wed, 26 Feb 2020 20:14:00 +0000 (23:14 +0300)]
svga: fix build on FreeBSD

MADV_HUGEPAGE only exists on Linux

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3966>

18 months agofreedreno/a5xx+: Skip compiling the old gmem blit programs.
Eric Anholt [Mon, 13 Apr 2020 21:03:54 +0000 (14:03 -0700)]
freedreno/a5xx+: Skip compiling the old gmem blit programs.

Saves a bunch of noise for me to sort through in IR3_SHADER_DEBUG=vs,fs
shader-db/run <single shader_test>.  I found that we were crashing on
destroy of NULL programs in fd_prog_fini, so I replicated the gpu_id < 300
early exit from fd_prog_init() down to _fini as well.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4538>

18 months agopan/bit: Add BI_CONVERT tests
Alyssa Rosenzweig [Mon, 13 Apr 2020 22:19:41 +0000 (18:19 -0400)]
pan/bit: Add BI_CONVERT tests

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

18 months agopan/bit: Add BI_CONVERT interpretation
Alyssa Rosenzweig [Mon, 13 Apr 2020 20:38:40 +0000 (16:38 -0400)]
pan/bit: Add BI_CONVERT interpretation

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

18 months agopan/bi: ADD packing for CONVERT
Alyssa Rosenzweig [Mon, 13 Apr 2020 21:32:58 +0000 (17:32 -0400)]
pan/bi: ADD packing for CONVERT

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

18 months agopan/bi: Rewrite conversion packing
Alyssa Rosenzweig [Mon, 13 Apr 2020 19:56:06 +0000 (15:56 -0400)]
pan/bi: Rewrite conversion packing

To support roundmodes and other goodies.

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

18 months agopan/bi: Fix incorrect swizzle packing assert
Alyssa Rosenzweig [Mon, 13 Apr 2020 22:12:12 +0000 (18:12 -0400)]
pan/bi: Fix incorrect swizzle packing assert

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

18 months agopan/bi: Set BI_ROUNDMODE for BI_CONVERT
Alyssa Rosenzweig [Mon, 13 Apr 2020 19:55:45 +0000 (15:55 -0400)]
pan/bi: Set BI_ROUNDMODE for BI_CONVERT

It's rarely used in GL but converts do have roundmodes.

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

18 months agopan/midgard: Fix f2u naming confusion
Alyssa Rosenzweig [Mon, 13 Apr 2020 19:27:42 +0000 (15:27 -0400)]
pan/midgard: Fix f2u naming confusion

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

18 months agomeson: Specify the maximum required libdrm in dri.pc
Matt Turner [Mon, 13 Apr 2020 16:20:18 +0000 (09:20 -0700)]
meson: Specify the maximum required libdrm in dri.pc

When dealing with a regression in libdrm-2.4.101, I masked the package
in Gentoo. In doing so, we discovered that Mesa's dri.pc specifies a
version requirement in dri.pc for >= the version of libdrm Mesa was
built against, thus preventing packages from being rebuilt with the
older version of libdrm installed.

Let's reduce this version requirement to the latest libdrm required by
Mesa instead, since libdrm is backward compatible.

Fixes: a3a16d4aa7e ("meson: use dep_libdrm version for pkg-config")
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4534>

18 months agofreedreno/ir3/ra: cleanup some leftovers
Rob Clark [Thu, 9 Apr 2020 23:41:47 +0000 (16:41 -0700)]
freedreno/ir3/ra: cleanup some leftovers

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

18 months agofreedreno/ir3: rename depth->dce
Rob Clark [Sat, 4 Apr 2020 17:29:53 +0000 (10:29 -0700)]
freedreno/ir3: rename depth->dce

Since DCE is the only remaining function of this pass, after the pre-RA
scheduler rewrite.

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

18 months agofreedreno/ir3: better cleanup when removing unused instructions
Rob Clark [Sat, 4 Apr 2020 16:53:32 +0000 (09:53 -0700)]
freedreno/ir3: better cleanup when removing unused instructions

Do a better job of pruning when removing unused instructions, including
cleaning up dangling false-deps.

This introduces a new ssa src pointer iterator, which makes it easy to
clear links without having to think about whether it is a normal ssa
src or a false-dep.

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

18 months agofreedreno/ir3/ra: handle array case for SFU select_reg opt
Rob Clark [Sat, 4 Apr 2020 00:42:05 +0000 (17:42 -0700)]
freedreno/ir3/ra: handle array case for SFU select_reg opt

The src of the SFU instruction could also be array/reg (non-SSA).
Handle this case too.

The postsched cp pass makes this scenario more likely.

Fixes: cc82521de4e ("freedreno/ir3: round-robin RA")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4440>

18 months agofreedreno/ir3: add mov/cov stats
Rob Clark [Mon, 16 Mar 2020 13:41:41 +0000 (06:41 -0700)]
freedreno/ir3: add mov/cov stats

While not always avoidable, cov instructions are a useful thing to look
at to see if we could fold into src.

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

18 months agofreedreno/ir3/postsched: avoid moving tex ahead of kill
Rob Clark [Fri, 3 Apr 2020 16:04:10 +0000 (09:04 -0700)]
freedreno/ir3/postsched: avoid moving tex ahead of kill

Add extra dependencies of tex/mem instructions on previous kill
instructions to avoid moving them ahead of kills.

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

18 months agofreedreno/ir3/postsched: remove some leftovers
Rob Clark [Wed, 18 Mar 2020 17:01:03 +0000 (10:01 -0700)]
freedreno/ir3/postsched: remove some leftovers

These aren't used in postsched.

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

18 months agofreedreno/ir3/sched: awareness of partial liveness
Rob Clark [Tue, 24 Mar 2020 16:10:06 +0000 (09:10 -0700)]
freedreno/ir3/sched: awareness of partial liveness

Realize that certain instructions make a vecN live, and account for
this, in hopes of scheduling the remaining components of the vecN
sooner.

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

18 months agofreedreno/ir3: new pre-RA scheduler
Rob Clark [Fri, 22 Nov 2019 19:14:25 +0000 (11:14 -0800)]
freedreno/ir3: new pre-RA scheduler

This replaces the depth-first search scheduler with a more traditional
ready-list scheduler.  It primarily tries to reduce register pressure
(number of live values), with the exception of trying to schedule kills
as early as possible.  (Earlier iterations of this scheduler had a
tendency to push kills later, and in particular moving texture fetches
which may not be necessary ahead of kills.)

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

18 months agofreedreno/ir3: fix location of inserted mov's
Rob Clark [Mon, 6 Apr 2020 15:28:35 +0000 (08:28 -0700)]
freedreno/ir3: fix location of inserted mov's

If the group pass must insert a mov to resolve conflicts, avoid the mov
appearing *after* the meta:collect whose src it is.

The current pre-RA scheduler doesn't really care about the initial
instruction order, but the new one will in some cases.

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

18 months agofreedreno/ir3: simplify grouping pass
Rob Clark [Mon, 6 Apr 2020 15:20:13 +0000 (08:20 -0700)]
freedreno/ir3: simplify grouping pass

Since bdf6b7018cedf95b554e21953d5a1935d3067ce7 the logic only needs to
handle grouping collect srcs, So remove the now unnecessary indirection.

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

18 months agofreedreno/ir3: make falsedep use's optional
Rob Clark [Sun, 5 Apr 2020 18:28:42 +0000 (11:28 -0700)]
freedreno/ir3: make falsedep use's optional

Add option when collecting uses to control whether they include
falsedeps or not.

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

18 months agofreedreno/ir3: spiff out disasm a bit
Rob Clark [Tue, 24 Mar 2020 20:26:03 +0000 (13:26 -0700)]
freedreno/ir3: spiff out disasm a bit

for verbose mode, print also the instruction "cycle" (which takes into
account (rptN) and (nopN)) in addition to instruction offset.

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

18 months agofreedreno/computerator: support bindless sampler instructions
Jonathan Marek [Sat, 11 Apr 2020 22:28:41 +0000 (18:28 -0400)]
freedreno/computerator: support bindless sampler instructions

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

18 months agofreedreno/computerator: support nop prefix
Jonathan Marek [Sat, 11 Apr 2020 22:28:09 +0000 (18:28 -0400)]
freedreno/computerator: support nop prefix

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

18 months agofreedreno/ir3: CSE the up/downconversion of SEL's cond's size.
Eric Anholt [Fri, 10 Apr 2020 23:10:14 +0000 (16:10 -0700)]
freedreno/ir3: CSE the up/downconversion of SEL's cond's size.

Not many programs hit this, but if you were, say, selecting between vec4s,
you'd convert the cond 4 times.

instructions in affected programs: 2957 -> 2717 (-8.12%)
nops in affected programs: 989 -> 899 (-9.10%)
non-nops in affected programs: 1968 -> 1818 (-7.62%)
dwords in affected programs: 3232 -> 2752 (-14.85%)
last-baryf in affected programs: 102 -> 90 (-11.76%)
full in affected programs: 5 -> 4 (-20.00%)
sstall in affected programs: 329 -> 329 (0.00%)
(ss) in affected programs: 86 -> 105 (22.09%)
(sy) in affected programs: 14 -> 12 (-14.29%)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4516>

18 months agofreedreno/ir3: Stop doing b2n on the SEL condition.
Eric Anholt [Fri, 10 Apr 2020 22:03:34 +0000 (15:03 -0700)]
freedreno/ir3: Stop doing b2n on the SEL condition.

SEL_B32 (and presumably B16) checks for 0 or nonzero in the condition
(tested by just stuffing a uniform's value into it), so there's no need to
do ir3_b2n() on it, or any preceding ir3_n2b().

instructions in affected programs: 664444 -> 659927 (-0.68%)
nops in affected programs: 267898 -> 266312 (-0.59%)
non-nops in affected programs: 420260 -> 417329 (-0.70%)
dwords in affected programs: 144032 -> 137568 (-4.49%)
last-baryf in affected programs: 10801 -> 10321 (-4.44%)
full in affected programs: 2003 -> 2002 (-0.05%)
sstall in affected programs: 76670 -> 77405 (0.96%)
(ss) in affected programs: 4515 -> 4525 (0.22%)
(sy) in affected programs: 612 -> 604 (-1.31%)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4516>

18 months agotnl: Code formatting in t_rebase.c
Ian Romanick [Wed, 8 Apr 2020 18:15:32 +0000 (11:15 -0700)]
tnl: Code formatting in t_rebase.c

Many little changes.  Almost everything is indentation or removal of
trailing whitespace.  Some places move a loop variable declaration to
the loop.  Some comments either re-wrapped or converted to single
line.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4512>

18 months agotnl: Code formatting in t_draw.c
Ian Romanick [Wed, 8 Apr 2020 04:18:54 +0000 (21:18 -0700)]
tnl: Code formatting in t_draw.c

So many little changes.  Almost everything is indentation or removal of
trailing whitespace.  There's a couple places where an "else" is moved
to the previous line with the "}".  Some places move a loop variable
declaration to the loop.  One change of assert to unreachable.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4512>

18 months agotnl: Silence unused parameter warnings in _tnl_split_inplace
Ian Romanick [Fri, 10 Apr 2020 17:31:14 +0000 (10:31 -0700)]
tnl: Silence unused parameter warnings in _tnl_split_inplace

Unused since db0eb3a437f ("vbo: Fix up in-place splitting for non-contiguous/indexed primitives.") which landed in 2010.

src/mesa/tnl/t_split_inplace.c: In function ‘_tnl_split_inplace’:
src/mesa/tnl/t_split_inplace.c:270:27: warning: unused parameter ‘min_index’ [-Wunused-parameter]
  270 |                    GLuint min_index,
      |                    ~~~~~~~^~~~~~~~~
src/mesa/tnl/t_split_inplace.c:271:27: warning: unused parameter ‘max_index’ [-Wunused-parameter]
  271 |                    GLuint max_index,
      |                    ~~~~~~~^~~~~~~~~

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4512>

18 months agotnl: Silence unused parameter warnings in dump_draw_info
Ian Romanick [Fri, 10 Apr 2020 17:17:25 +0000 (10:17 -0700)]
tnl: Silence unused parameter warnings in dump_draw_info

src/mesa/tnl/t_split_copy.c: In function ‘dump_draw_info’:
src/mesa/tnl/t_split_copy.c:149:35: warning: unused parameter ‘ctx’ [-Wunused-parameter]
  149 | dump_draw_info(struct gl_context *ctx,
      |                ~~~~~~~~~~~~~~~~~~~^~~
src/mesa/tnl/t_split_copy.c:154:23: warning: unused parameter ‘min_index’ [-Wunused-parameter]
  154 |                GLuint min_index,
      |                ~~~~~~~^~~~~~~~~
src/mesa/tnl/t_split_copy.c:155:23: warning: unused parameter ‘max_index’ [-Wunused-parameter]
  155 |                GLuint max_index)
      |                ~~~~~~~^~~~~~~~~

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4512>

18 months agotnl: Silence unused parameter warnings in _tnl_draw_prims
Ian Romanick [Wed, 8 Apr 2020 04:10:45 +0000 (21:10 -0700)]
tnl: Silence unused parameter warnings in _tnl_draw_prims

A tangled mess of a couple parameters that nobody wanted.

src/mesa/tnl/t_draw.c: In function ‘_tnl_draw_prims’:
src/mesa/tnl/t_draw.c:440:42: warning: unused parameter ‘tfb_vertcount’ [-Wunused-parameter]
  440 |     struct gl_transform_feedback_object *tfb_vertcount,
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
src/mesa/tnl/t_draw.c:441:35: warning: unused parameter ‘stream’ [-Wunused-parameter]
  441 |                          unsigned stream)
      |                          ~~~~~~~~~^~~~~~

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4512>

18 months agotnl: Silence unused parameter 'attrib' warning in convert_half_to_float
Ian Romanick [Wed, 8 Apr 2020 03:42:30 +0000 (20:42 -0700)]
tnl: Silence unused parameter 'attrib' warning in convert_half_to_float

Also clean up some trivial code / whitespace style issues.

src/mesa/tnl/t_draw.c: In function ‘convert_half_to_float’:
src/mesa/tnl/t_draw.c:121:57: warning: unused parameter ‘attrib’ [-Wunused-parameter]
  121 |                       const struct gl_array_attributes *attrib,
      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4512>

18 months agotnl: Don't dereference NULL obj pointer in t_rebase_prims
Ian Romanick [Wed, 8 Apr 2020 18:12:19 +0000 (11:12 -0700)]
tnl: Don't dereference NULL obj pointer in t_rebase_prims

Structurally the code is now similar to the handling of other
gl_buffer_object::obj pointers elsewhere in TNL.  The fixes tag is a
little bit misleading.  I think the change in that commit just exposes a
previously existing bug.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2746
Fixes: f3cce7087a5 ("mesa: don't ever bind NullBufferObj for glBindBuffer targets")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4512>

18 months agotnl: Don't dereference NULL obj pointer in replay_init
Ian Romanick [Wed, 8 Apr 2020 18:03:45 +0000 (11:03 -0700)]
tnl: Don't dereference NULL obj pointer in replay_init

Structurally the code is now similar to the handling of other
gl_buffer_object::obj pointers elsewhere in TNL.  The fixes tag is a
little bit misleading.  I think the change in that commit just exposes a
previously existing bug.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2746
Fixes: f3cce7087a5 ("mesa: don't ever bind NullBufferObj for glBindBuffer targets")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4512>

18 months agotnl: Don't dereference NULL obj pointer in bind_indices
Ian Romanick [Wed, 8 Apr 2020 03:19:41 +0000 (20:19 -0700)]
tnl: Don't dereference NULL obj pointer in bind_indices

Structurally the code is now similar to bind_inputs.  The fixes tag is a
little bit misleading.  I think the change in that commit just exposes a
previously existing bug.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2746
Fixes: f3cce7087a5 ("mesa: don't ever bind NullBufferObj for glBindBuffer targets")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4512>

18 months agoaco: fix p_extract_vector optimization in presence of unequally sized vector operands
Daniel Schürmann [Fri, 10 Apr 2020 10:52:13 +0000 (11:52 +0100)]
aco: fix p_extract_vector optimization in presence of unequally sized vector operands

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4506>

18 months agopan/bi: Lower fsqrt
Alyssa Rosenzweig [Fri, 10 Apr 2020 23:41:15 +0000 (19:41 -0400)]
pan/bi: Lower fsqrt

For G72+ anyway. G71 will want something a bit more fine grained. I hope
this has enough precision for GL (the blob apparently does some exponent
fixup).

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

18 months agopanfrost: Drop dependency on nonexistant write_value
Alyssa Rosenzweig [Fri, 10 Apr 2020 21:10:24 +0000 (17:10 -0400)]
panfrost: Drop dependency on nonexistant write_value

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

18 months agoglsl: stop processing function parameters if error happened
Tapani Pälli [Fri, 27 Mar 2020 07:04:31 +0000 (09:04 +0200)]
glsl: stop processing function parameters if error happened

Fixes: d1fa69ed61d ("glsl: do not attempt assignment if operand type not parsed correctly")
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2696
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4341>

18 months agoaco: fix nir_op_pack_32_2x16_split if one operand is a constant
Samuel Pitoiset [Sat, 4 Apr 2020 08:07:51 +0000 (10:07 +0200)]
aco: fix nir_op_pack_32_2x16_split if one operand is a constant

Because 16-bit constants are represented with the s1 RegClass, we
have to extract the low half.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4509>

18 months agoaco: implement 16-bit nir_op_f2i64/nir_op_f2u64
Samuel Pitoiset [Fri, 10 Apr 2020 13:21:52 +0000 (15:21 +0200)]
aco: implement 16-bit nir_op_f2i64/nir_op_f2u64

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4509>

18 months agoaco: fix f2i64/f2u64 with sgprs if the exponent computation overflow
Samuel Pitoiset [Mon, 13 Apr 2020 07:57:33 +0000 (09:57 +0200)]
aco: fix f2i64/f2u64 with sgprs if the exponent computation overflow

This fixes f16->{i64,u64} conversions for +0/-0.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4509>

18 months agogitlab-ci: Use all_paths in .test-manual rules
Michel Dänzer [Sat, 11 Apr 2020 13:32:02 +0000 (15:32 +0200)]
gitlab-ci: Use all_paths in .test-manual rules

Without this, the .test-manual jobs could end up as 'when: manual' when
the jobs they depend on were 'when: never', which was flagged as
invalid YAML, preventing the pipeline from being created.

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

18 months agonvc0: add NV_viewport_swizzle support for GM200+
Ilia Mirkin [Mon, 6 Apr 2020 06:52:26 +0000 (02:52 -0400)]
nvc0: add NV_viewport_swizzle support for GM200+

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4519>

18 months agost/mesa: add NV_viewport_swizzle support
Ilia Mirkin [Mon, 6 Apr 2020 05:57:54 +0000 (01:57 -0400)]
st/mesa: add NV_viewport_swizzle support

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4519>

18 months agomesa: add GL_NV_viewport_swizzle support
Ilia Mirkin [Mon, 6 Apr 2020 05:56:48 +0000 (01:56 -0400)]
mesa: add GL_NV_viewport_swizzle support

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4519>

18 months agogallium: add viewport swizzling state and cap
Ilia Mirkin [Mon, 6 Apr 2020 03:43:08 +0000 (23:43 -0400)]
gallium: add viewport swizzling state and cap

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4519>

18 months agoglsl: remove redudant assignment
Tapani Pälli [Thu, 9 Apr 2020 07:47:54 +0000 (10:47 +0300)]
glsl: remove redudant assignment

CID: 1461087
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4500>

18 months agomesa: remove redudant assignment
Tapani Pälli [Thu, 9 Apr 2020 07:41:45 +0000 (10:41 +0300)]
mesa: remove redudant assignment

CID: 1461397
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4500>

18 months agomesa: remove redudant check
Tapani Pälli [Thu, 9 Apr 2020 07:40:42 +0000 (10:40 +0300)]
mesa: remove redudant check

CID: 1461410
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4500>

18 months agolima: set offset when export resource
Qiang Yu [Tue, 31 Mar 2020 05:51:59 +0000 (13:51 +0800)]
lima: set offset when export resource

We missed set reource offset.

Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4517>

18 months agoi965: share buffer managers across screens
Lionel Landwerlin [Fri, 6 Mar 2020 15:06:25 +0000 (17:06 +0200)]
i965: share buffer managers across screens

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1373
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4086>

18 months agoi965: store DRM fd on intel_screen
Lionel Landwerlin [Fri, 6 Mar 2020 14:56:25 +0000 (16:56 +0200)]
i965: store DRM fd on intel_screen

v2: Fix storing of drm fd (Ajax)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1373
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4086>

18 months agoiris: make resources take a ref on the screen object
Lionel Landwerlin [Fri, 6 Mar 2020 13:58:37 +0000 (15:58 +0200)]
iris: make resources take a ref on the screen object

Because St creates resources from a screen and attach them onto
another we need to ensure the resources associated to a screen &
bufmgr stay around until we don't need them anymore.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1373
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4086>

18 months agoiris: share buffer managers accross screens
Lionel Landwerlin [Fri, 6 Mar 2020 11:34:23 +0000 (13:34 +0200)]
iris: share buffer managers accross screens

St happilly uses pipe_resources created with one screen with other
screens. Unfortunately our resources have a single identifier that
related to a given screen and its associated DRM file descriptor.

To workaround this, let's share the buffer manager between screens for
a given DRM device. That way handles are always valid.

v2: Don't forget to close the fd that bufmgr now owns
    Take a copy of the fd to ensure it stays alive even if the dri
    layer closes it

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1373
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4086>

18 months agoiris: properly free resources on BO allocation failure
Lionel Landwerlin [Fri, 6 Mar 2020 13:57:40 +0000 (15:57 +0200)]
iris: properly free resources on BO allocation failure

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4086>

18 months agofreedreno/log: better decoding for multiple chunks per batch
Rob Clark [Fri, 10 Apr 2020 15:27:54 +0000 (08:27 -0700)]
freedreno/log: better decoding for multiple chunks per batch

For larger render targets or smaller GMEM size, we could end up needing
multiple chunks of tracepoints per batch.  But we still want to decode
the traces as single batch.  So we need a bit of a state across
process_chunk() calls to accumulate timestamp information.

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