platform/upstream/mesa.git
2 years agoanv: decode init batch with INTEL_DEBUG=bat
Lionel Landwerlin [Tue, 2 Aug 2022 09:26:27 +0000 (12:26 +0300)]
anv: decode init batch with INTEL_DEBUG=bat

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mykhailo Skorokhodov <mykhailo.skorokhodov@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17852>

2 years agovirgl: do not share virgl_screen between different drm_files
Feng Jiang [Fri, 27 May 2022 08:24:11 +0000 (16:24 +0800)]
virgl: do not share virgl_screen between different drm_files

Now, only one instance of virgl_screen exists for a device
(/dev/dri/cardX), and it is shared by different frontends (eg GLX,
GBM, etc.). There is a problem with this, as follows:

  /* Init GLX */
  ...
  glXCreateContext(...);
  ...

  /* GBM */
  gbm_fd = open("/dev/dri/card0", O_RDWR);
  dev = gbm_create_device(gbm_fd);
  bo = gbm_bo_create(dev, ...);
  plane_handle = gbm_bo_get_handle_for_plane(bo, ...);
  drmPrimeHandleToFD(gbm_fd, handle.u32, flags, &plane_fd);

The above drmPrimeHandleToFD() call will fail with ENOENT.
The reason is that GBM and GLX share the same virgl_screen (file
descriptor), and it is not gbm_fd that is used to create gbm_bo,
but other fd (opened during GLX initialization). Since the scope
of prime handle is limited to drm_file, the above plane_handle is
invalid under gbm_fd.

By canceling the sharing of virgl_screen between different drm_files,
GBM can use the correct fd to create resources, thereby avoiding the
problem of invalid prime handle.

Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16738>

2 years agointel/compiler: use NIR_PASS more
Marcin Ślusarz [Mon, 18 Jul 2022 16:35:34 +0000 (18:35 +0200)]
intel/compiler: use NIR_PASS more

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

2 years agointel/compiler: insert URB fence before task/mesh termination
Marcin Ślusarz [Wed, 18 May 2022 15:05:53 +0000 (17:05 +0200)]
intel/compiler: insert URB fence before task/mesh termination

Bspec 53421 says:
"A URB fence memory is typically performed prior the thread
exit message, so that the next thread dispatch that reads
that URB memory will see it."

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

2 years agointel/compiler: there are 4 types of fences on gfx >= 12.5
Marcin Ślusarz [Mon, 16 May 2022 10:26:51 +0000 (12:26 +0200)]
intel/compiler: there are 4 types of fences on gfx >= 12.5

Found by code inspection.

There's an assert later checking that we haven't overflown
this array, so this change probably doesn't matter for any
workload.

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

2 years agointel/compiler: emit URB fences for TASK/MESH
Marcin Ślusarz [Mon, 16 May 2022 10:10:00 +0000 (12:10 +0200)]
intel/compiler: emit URB fences for TASK/MESH

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

2 years agointel/compiler: Delete unused Gfx8+ code in brw_find_live_channel()
Kenneth Graunke [Mon, 6 Jun 2022 21:05:54 +0000 (14:05 -0700)]
intel/compiler: Delete unused Gfx8+ code in brw_find_live_channel()

We now handle this in fs_visitor::lower_find_live_channel().

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

2 years agointel/compiler: Lower FIND_[LAST_]LIVE_CHANNEL in IR on Gfx8+
Kenneth Graunke [Mon, 6 Jun 2022 09:35:09 +0000 (02:35 -0700)]
intel/compiler: Lower FIND_[LAST_]LIVE_CHANNEL in IR on Gfx8+

This allows the software scoreboarding pass, scheduler, and so on
to handle the individual instructions and handle them, rather than
trusting in the generator to do scoreboarding correctly when expanding
the virtual instruction to multiple actual instructions.

By using SHADER_OPCODE_READ_SR_REG, we also correctly handle the
software scoreboarding workaround when reading DMask/VMask.

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

2 years agointel/dev: drop warning for unhandled hwconfig keys
Mark Janes [Mon, 1 Aug 2022 22:46:24 +0000 (15:46 -0700)]
intel/dev: drop warning for unhandled hwconfig keys

The hwconfig api may change unexpectedly prior to public release of
new platforms.  Also, public documentation of the hwconfig api
sometimes lags the release.

For these reasons, warnings about unhandled hwconfig keys are noisy,
likely to occur, and unhelpful to most users.  This commit drops those
warnings, in favor of a separate internal process for tracking
hwconfig api changes.

Suggested-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17846>

2 years agor600/sfn: Handle R600 class sin/cos
Gert Wollny [Mon, 1 Aug 2022 18:38:34 +0000 (20:38 +0200)]
r600/sfn: Handle R600 class sin/cos

Fixes: 33765aa92aa5c150873fc210e9d6c1fe22cf8646
  r600/sfn: Enable NIR for pre EG hardware

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17840>

2 years agovirgl: Set res->maybe_busy to true when creating resources
Jiang Feng [Mon, 18 Jul 2022 06:53:26 +0000 (14:53 +0800)]
virgl: Set res->maybe_busy to true when creating resources

Currently, res->maybe_busy is false by default. If wait immediately
after the resource is created, virgl_drm_resource_wait() will return
directly without checking the actual state of the kernel, which will
cause synchronization problems, such as:

On Guest:
  pipe_buffer_create [mesa]
    virgl_drm_winsys_resource_create
      virtio_gpu_resource_create_ioctl [kernel]
        virtio_gpu_fence_alloc
        virtio_gpu_object_create
          virtio_gpu_cmd_resource_create_3d
            VIRTIO_GPU_CMD_RESOURCE_CREATE_3D
          virtio_gpu_object_attach
            virtio_gpu_cmd_resource_attach_backing
              VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING
  resource_wait [mesa]
    virgl_drm_resource_wait /* return directly without fence waiting */
  pipe_buffer_map [mesa]
    virgl_drm_resource_map
      virtio_gpu_map_ioctl [kernel]
      os_mmap
  memcpy /* <== here */

On Host (with QEMU):
  VIRTIO_GPU_CMD_RESOURCE_CREATE_3D
    virgl_cmd_create_resource_3d [qemu]
      virgl_renderer_resource_create [virglrenderer]
  VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING
    virgl_resource_attach_backing [qemu]
      virtio_gpu_create_mapping_iov
      virgl_renderer_resource_attach_iov [virglrenderer]
        virgl_resource_attach_iov
          vrend_pipe_resource_attach_iov
            vrend_write_to_iovec /* <== here */
      virtio_gpu_cleanup_mapping_iov [qemu]

In the example above, there is a race condition between memcpy and
vrend_write_to_iovec.

Signed-off-by: Jiang Feng <jiangfeng@kylinos.cn>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17592>

2 years agoci/lava: Remove MINIO_RESULTS_UPLOAD if requested
Guilherme Gallo [Tue, 19 Jul 2022 03:22:15 +0000 (00:22 -0300)]
ci/lava: Remove MINIO_RESULTS_UPLOAD if requested

When we don't want to communicate with minio, e.g. running
lava_job_submitter script locally, MINIO_RESULTS_UPLOAD should be unset.
But this variable is already set by generate-env script, so we need to
remove it from the /set-job-env-vars.sh to avoid declaring it in
unexpected scenarios.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17645>

2 years agolibsync: Fix compiler warning
Rob Clark [Sat, 23 Jul 2022 19:52:11 +0000 (12:52 -0700)]
libsync: Fix compiler warning

../src/util/libsync.h:134:33: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        struct sync_merge_data data = {0};
                                       ^

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17816>

2 years agoutil: Fix c++ enum casting pickiness
Rob Clark [Sun, 17 Jul 2022 18:17:47 +0000 (11:17 -0700)]
util: Fix c++ enum casting pickiness

Fix problems when included from c++

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17816>

2 years agointel/dev: Fill in system memory info when using INTEL_DEVID_OVERRIDE
Jordan Justen [Thu, 28 Jul 2022 23:15:31 +0000 (16:15 -0700)]
intel/dev: Fill in system memory info when using INTEL_DEVID_OVERRIDE

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17828>

2 years agoci/lava: Only parse result within testcase section
Guilherme Gallo [Mon, 25 Jul 2022 20:56:51 +0000 (17:56 -0300)]
ci/lava: Only parse result within testcase section

This commit fixes an issue related to leftover between jobs in the same
device under test in LAVA.

There is a possibility of having the resulting output being dumped just
after the boot, such as this job:
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/25674303#L155

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17752>

2 years agonir/from_ssa: Ignore undef sources
Jason Ekstrand [Wed, 1 Jun 2022 16:02:42 +0000 (11:02 -0500)]
nir/from_ssa: Ignore undef sources

Is a phi source is an undef, there's no point in copying it or really
caring about it at all.  We would just end up inserting a mov from an
undef to a register.  Instead, treat phi sources which point to an undef
as if the phi source doesn't exist.

This also prevents them from being included in phi webs which should
reduce the overall interference seen in the shader.  Currently, if two
phis share an undef, their phi webs are consdiered to interfere.  By
ignoring undefs we can get rid of this false interference and reduce the
size of phi webs.  Reducing the number of things being copied by the
parallel copy instructions should also free up the paralle copy
algorithm and reduce the over-all churn of movs.

Shader-db results on Haswell:

    total instructions in shared programs: 8156608 -> 8155406 (-0.01%)
    instructions in affected programs: 164838 -> 163636 (-0.73%)

Shader-db results on Skylake:

    total instructions in shared programs: 18227370 -> 18227359 (<.01%)
    instructions in affected programs: 519 -> 508 (-2.12%)
    helped: 6
    HURT: 0

Shader-db results on Tigerlake:

    total instructions in shared programs: 21167987 -> 21168025 (<.01%)
    instructions in affected programs: 23701 -> 23739 (0.16%)
    helped: 21
    HURT: 27

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16817>

2 years agolima: Lower undefs to zero and run DCE after from_ssa
Jason Ekstrand [Wed, 1 Jun 2022 19:43:18 +0000 (14:43 -0500)]
lima: Lower undefs to zero and run DCE after from_ssa

Undefs can happen even in real GLSL shaders so it's best to handle them.
Lowering to zero is a perfectly valid implementation.  Also, run DCE
because some of the undefs may be dead after from_ssa and there's no
point in processing those in the back-end.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16817>

2 years agolavapipe: enable VK_FORMAT_R5G5B5A1_UNORM_PACK16
Dave Airlie [Mon, 1 Aug 2022 02:01:48 +0000 (12:01 +1000)]
lavapipe: enable VK_FORMAT_R5G5B5A1_UNORM_PACK16

Doesn't cause any cts regressions here.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17826>

2 years agogallium/dri2: Enable {GLX_ARB,EGL_KHR}_context_flush_control
Adam Jackson [Tue, 26 Jul 2022 17:22:57 +0000 (13:22 -0400)]
gallium/dri2: Enable {GLX_ARB,EGL_KHR}_context_flush_control

This was disabled ages ago because it provoked bugs between us and
xserver about context creation attributes, hopefully those servers are
out of circulation by now, let's find out.

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

2 years agor600/sfn: remove leftover debug output
Gert Wollny [Mon, 1 Aug 2022 17:55:29 +0000 (19:55 +0200)]
r600/sfn: remove leftover debug output

Fixes: 3c7368de56c32fb399306e888bc7a61ff721f3b6
   r600/sfn: Handle slot differences between pre-EG and EG

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17839>

2 years agopan/bi: Rename CLPER_V6.i32 to CLPER_OLD.i32
Alyssa Rosenzweig [Tue, 26 Jul 2022 14:53:02 +0000 (10:53 -0400)]
pan/bi: Rename CLPER_V6.i32 to CLPER_OLD.i32

To reflect that it is the CLPER of choice on Mali-G31 which is a v7 target.

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

2 years agopan/bi: Assert that we use the correct CLPER
Alyssa Rosenzweig [Tue, 26 Jul 2022 14:40:05 +0000 (10:40 -0400)]
pan/bi: Assert that we use the correct CLPER

Add an assert at pack time that would have caught the bug fixed in 75353622046
("pan/bi: Fix clper_xor on Mali-G31").

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

2 years agoagx: Port minifloat tests to GTest
Alyssa Rosenzweig [Sun, 31 Jul 2022 17:16:52 +0000 (13:16 -0400)]
agx: Port minifloat tests to GTest

These tests predate using GTest in the compiler. Now that we do, we'd like to
have the tests together so they run regularly.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17824>

2 years agonir: Use nir_foreach_phi_src consistently.
Emma Anholt [Mon, 1 Aug 2022 16:24:44 +0000 (09:24 -0700)]
nir: Use nir_foreach_phi_src consistently.

I copy-and-pasted one of these and people noted that we had a better tool,
so make sure nobody else copy and pastes it.

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

2 years agoglsl: Remove opt_conditional_discard().
Emma Anholt [Wed, 20 Jul 2022 21:14:55 +0000 (14:14 -0700)]
glsl: Remove opt_conditional_discard().

The nir_opt_conditional_discard pass is called anyway and covers
discard/demote/terminate.

iris shader-db:

total instructions in shared programs: 8933422 -> 8933426 (<.01%)
instructions in affected programs: 48 -> 52 (8.33%)
helped: 0
HURT: 4

which is a synmark shader going from 12 to 13 instrs.

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

2 years agonir: Add an opt pass for phis after if choosing between true/false.
Emma Anholt [Wed, 27 Jul 2022 19:38:38 +0000 (12:38 -0700)]
nir: Add an opt pass for phis after if choosing between true/false.

This pattern almost always gets peephole-selected out anyway, but I
noticed it once I removed glsl opt_conditional_discard.

iris shader-db:
total instructions in shared programs: 8933934 -> 8933158 (<.01%)
instructions in affected programs: 75575 -> 74799 (-1.03%)
helped: 179
HURT: 15

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

2 years agov3d/ci: enable ARB_texture_cube_map piglit tests
Juan A. Suarez Romero [Mon, 1 Aug 2022 12:19:32 +0000 (14:19 +0200)]
v3d/ci: enable ARB_texture_cube_map piglit tests

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17836>

2 years agov3d/vc4/ci: Fix typo in skipped list
Juan A. Suarez Romero [Mon, 1 Aug 2022 11:17:21 +0000 (13:17 +0200)]
v3d/vc4/ci: Fix typo in skipped list

The skipped piglit tests should be those about arb_gpu_shader5, not
arb_gpu_shader_gpu5.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17836>

2 years agov3dv/ci: Update expected list
Juan A. Suarez Romero [Mon, 1 Aug 2022 11:09:30 +0000 (13:09 +0200)]
v3dv/ci: Update expected list

Add some tests in the skip list that takes too much time to be executed.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17836>

2 years agozink: more accurately set ImageQuery cap
Erik Faye-Lund [Mon, 25 Jul 2022 12:57:05 +0000 (14:57 +0200)]
zink: more accurately set ImageQuery cap

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17734>

2 years agozink: more accurately set {Sampled,Image}Buffer caps
Erik Faye-Lund [Mon, 25 Jul 2022 13:29:32 +0000 (15:29 +0200)]
zink: more accurately set {Sampled,Image}Buffer caps

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17734>

2 years agozink: more accurately set {Sampled,Image}1D caps
Erik Faye-Lund [Mon, 25 Jul 2022 12:46:47 +0000 (14:46 +0200)]
zink: more accurately set {Sampled,Image}1D caps

We don't really need to set this for every shader that uses textures,
only the ones that use 1D textures.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17734>

2 years agozink: set dynamic indexing caps
Erik Faye-Lund [Fri, 4 Feb 2022 12:25:26 +0000 (13:25 +0100)]
zink: set dynamic indexing caps

If we're not using uniform indexing, we need to emit caps to enable
dynamic indexing.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17734>

2 years agozink: clean up extension emitting
Erik Faye-Lund [Fri, 4 Feb 2022 12:13:50 +0000 (13:13 +0100)]
zink: clean up extension emitting

do not emit SPV_KHR_storage_buffer_storage_class if we have vulkan 1.1

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17734>

2 years agointel/nullhw: Use correct macro to fix build regression
Sviatoslav Peleshko [Thu, 28 Jul 2022 12:20:10 +0000 (15:20 +0300)]
intel/nullhw: Use correct macro to fix build regression

Fixes: b510ee0d ("Use vk_foreach_struct_const where needed")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6950

Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17789>

2 years agovc4/v3d: restore calling debug_get_option_vc4/v3d_debug
Alejandro Piñeiro [Fri, 29 Jul 2022 23:55:46 +0000 (01:55 +0200)]
vc4/v3d: restore calling debug_get_option_vc4/v3d_debug

As it is needed to have V3D_DEBUG defined. For the v3d case, I did it
restoring v3d_process_debug_variable, as it is at v3d_debug.c that
DEBUG_GET_ONCE_FLAGS_OPTION is called.

Fixes: 106b33405e8 ("vc4/v3d: stop adding NORAST when SHADERDB debug option is used")

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17812>

2 years agoci/MinGW: LLD is not really used anywhere
pal1000 [Wed, 27 Jul 2022 14:11:03 +0000 (17:11 +0300)]
ci/MinGW: LLD is not really used anywhere

Fixes: bbfd6dfe ("ci: Prepare the container for building all mesa components with mingw under linux")

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17766>

2 years agoci/MSVC: LLD is not really used anywhere
pal1000 [Wed, 27 Jul 2022 12:51:37 +0000 (15:51 +0300)]
ci/MSVC: LLD is not really used anywhere

Fixes: 0f46a319 ("CI: Windows: Build LLVM and llvmpipe")

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17766>

2 years agor600/sfn: Enable NIR for pre RG hardware
Gert Wollny [Thu, 28 Jul 2022 11:02:22 +0000 (13:02 +0200)]
r600/sfn: Enable NIR for pre RG hardware

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17822>

2 years agor600/sfn: Advertise support for fmulz
Gert Wollny [Sun, 31 Jul 2022 15:03:40 +0000 (17:03 +0200)]
r600/sfn: Advertise support for fmulz

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17822>

2 years agor600/sfn: Disable FP64 for pre-CEDAR
Gert Wollny [Mon, 1 Aug 2022 07:24:18 +0000 (09:24 +0200)]
r600/sfn: Disable FP64 for pre-CEDAR

There is no point in trying to get the softfp to work here,
since these cards don't support tesselation shaders, they will
never get OpenGL 4.0.

v2: Fix formatting (Filip)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17822>

2 years agor600/sfn: Handle pre-EG buffer fetch
Gert Wollny [Sun, 31 Jul 2022 14:06:47 +0000 (16:06 +0200)]
r600/sfn: Handle pre-EG buffer fetch

v2: Fix formatting (Filip)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17822>

2 years agor600/sfn: Set trans flag for flt_to_int on pre-EG
Gert Wollny [Sun, 31 Jul 2022 13:30:29 +0000 (15:30 +0200)]
r600/sfn: Set trans flag for flt_to_int on pre-EG

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17822>

2 years agor600/sfn: Handle non-compressed MS texel fetch
Gert Wollny [Sun, 31 Jul 2022 13:30:07 +0000 (15:30 +0200)]
r600/sfn: Handle non-compressed MS texel fetch

v2: Fix formatting (Filip)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17822>

2 years agor600/sfn: Handle primitive input handling for pre-EG
Gert Wollny [Fri, 29 Jul 2022 17:13:51 +0000 (19:13 +0200)]
r600/sfn: Handle primitive input handling for pre-EG

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17822>

2 years agor600/sfn: Handle pre-EG GS input fetch
Gert Wollny [Mon, 1 Aug 2022 06:55:09 +0000 (08:55 +0200)]
r600/sfn: Handle pre-EG GS input fetch

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17822>

2 years agor600/sfn: Handle buffer size query on pre-EG
Gert Wollny [Fri, 29 Jul 2022 16:59:50 +0000 (18:59 +0200)]
r600/sfn: Handle buffer size query on pre-EG

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17822>

2 years agor600/sfn: Handle chipclass with kcache allocation
Gert Wollny [Thu, 28 Jul 2022 23:08:23 +0000 (01:08 +0200)]
r600/sfn: Handle chipclass with kcache allocation

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17822>

2 years agor600/sfn: Handle slot differences between pre-EG and EG
Gert Wollny [Thu, 28 Jul 2022 15:29:58 +0000 (17:29 +0200)]
r600/sfn: Handle slot differences between pre-EG and EG

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17822>

2 years agor600/sfn: Prepare StreamOut instruction for pre EG opcodes
Gert Wollny [Mon, 1 Aug 2022 06:52:09 +0000 (08:52 +0200)]
r600/sfn: Prepare StreamOut instruction for pre EG opcodes

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17822>

2 years agor600/sfn: Support pre-EG style FS input
Gert Wollny [Mon, 1 Aug 2022 06:50:26 +0000 (08:50 +0200)]
r600/sfn: Support pre-EG style FS input

v2: Fix formatting

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17822>

2 years agor600/sfn: Factor out fragement shader class for EG
Gert Wollny [Wed, 27 Jul 2022 14:17:12 +0000 (16:17 +0200)]
r600/sfn: Factor out fragement shader class for EG

Pre-EG hardware handles the FS inputs differently, so we
need to prepare a different code path.

v2: Make m_interolators_used private (Filip)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17822>

2 years agovirgl: honor host caps in shader cash sha evaluation
Gert Wollny [Thu, 28 Jul 2022 20:50:23 +0000 (22:50 +0200)]
virgl: honor host caps in shader cash sha evaluation

This is needed because when we switch between GLES and GL on the host,
we have to lower atomics to ssbo, and with that the shaders  can't be
pulled from the cache anymore. Likewise when we move the disk image with
a shader cache to a different host, other features might change that
will need lowering. To avoid using stale shaders in this case, merge the
caps into into the shader cache sha.

Fixes: d6db4d2e08100b12fe6ac539f419768b3b412643
    virgl: Add simple disk cache

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17798>

2 years agomeson: add various generated header dependencies as order-only deps
Eli Schwartz [Sun, 22 May 2022 22:47:00 +0000 (18:47 -0400)]
meson: add various generated header dependencies as order-only deps

https://mesonbuild.com/FAQ.html#how-do-i-tell-meson-that-my-sources-use-generated-headers

A few locations had underspecified deps on the header files, and this
caused builds to fail given sufficient parallelism.

Fixes #6531

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

2 years agoauxiliary: Remove pipe_tsd
Yonggang Luo [Tue, 21 Jun 2022 09:27:07 +0000 (17:27 +0800)]
auxiliary: Remove pipe_tsd

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17213>

2 years agoglx: Remove usage of pipe_tsd_set and pipe_tsd_get
Yonggang Luo [Tue, 21 Jun 2022 09:23:59 +0000 (17:23 +0800)]
glx: Remove usage of pipe_tsd_set and pipe_tsd_get

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17213>

2 years agomeson: Remove pre_args += '-DUSE_ELF_TLS'
Yonggang Luo [Tue, 21 Jun 2022 09:52:21 +0000 (17:52 +0800)]
meson: Remove pre_args += '-DUSE_ELF_TLS'

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17213>

2 years agoutil: Remove usage of USE_ELF_TLS in u_thread.h
Yonggang Luo [Sat, 25 Jun 2022 05:32:32 +0000 (13:32 +0800)]
util: Remove usage of USE_ELF_TLS in u_thread.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17213>

2 years agoglx: Remove usage of USE_ELF_TLS
Yonggang Luo [Sat, 25 Jun 2022 05:31:52 +0000 (13:31 +0800)]
glx: Remove usage of USE_ELF_TLS

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17213>

2 years agoloader: Remove usage of USE_ELF_TLS in loader.c
Yonggang Luo [Sat, 25 Jun 2022 05:29:18 +0000 (13:29 +0800)]
loader: Remove usage of USE_ELF_TLS in loader.c

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17213>

2 years agomapi: Remove usage of USE_ELF_TLS
Yonggang Luo [Tue, 21 Jun 2022 09:21:50 +0000 (17:21 +0800)]
mapi: Remove usage of USE_ELF_TLS

After commit c47fd3dc006 ("windows: Use TLS context/dispatch with shared-glapi")
USE_ELF_TLS are always defined by
pre_args += '-DUSE_ELF_TLS'
So we can remove it safety

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17213>

2 years agoegl: Remove usage of USE_ELF_TLS macro
Yonggang Luo [Tue, 21 Jun 2022 06:03:41 +0000 (14:03 +0800)]
egl: Remove usage of USE_ELF_TLS macro

After commit c47fd3dc006 ("windows: Use TLS context/dispatch with shared-glapi")
USE_ELF_TLS are always defined by
pre_args += '-DUSE_ELF_TLS'
So we can remove it safety

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17213>

2 years agomeson: Remove usage of use_elf_tls
Yonggang Luo [Tue, 21 Jun 2022 07:33:07 +0000 (15:33 +0800)]
meson: Remove usage of use_elf_tls

After c47fd3dc006 ("windows: Use TLS context/dispatch with shared-glapi")

use_elf_tls are always setting to true, so we can remove it safety

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17213>

2 years agomapi: Trim trailing spaces in stub.c and u_current.c
Yonggang Luo [Tue, 21 Jun 2022 04:33:30 +0000 (12:33 +0800)]
mapi: Trim trailing spaces in stub.c and u_current.c

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17213>

2 years agoanv: enable VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM for modifier support
Yiwei Zhang [Fri, 29 Jul 2022 18:58:15 +0000 (18:58 +0000)]
anv: enable VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM for modifier support

This is a missed format to properly support media interop for Android.
Currently only used when layering GL atop Vulkan on Android, but will
be used directly with Vulkan when the platform default renderer has
switched to skiavk in modern Android.

Test: CtsMediaTestCases and CtsVideoTestCases with angle on venus on anv

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17808>

2 years agoanv: assert inheritance_info is not NULL
Iván Briano [Fri, 29 Jul 2022 19:54:59 +0000 (12:54 -0700)]
anv: assert inheritance_info is not NULL

Makes some static analysis tools happier.

Reviewed-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17809>

2 years agoutil: Disable tests/sparse_array_test.cpp on MacOS as it's too slow
Yonggang Luo [Thu, 28 Jul 2022 18:42:42 +0000 (02:42 +0800)]
util: Disable tests/sparse_array_test.cpp on MacOS as it's too slow

[----------] 1 test from SparseArrayTest
[ RUN      ] SparseArrayTest.Multithread
[       OK ] SparseArrayTest.Multithread (105624 ms)
[----------] 1 test from SparseArrayTest (105624 ms total)

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17802>

2 years agointel/compiler: reorder shader cache keys to minimize padding
Mark Janes [Mon, 25 Jul 2022 23:48:28 +0000 (16:48 -0700)]
intel/compiler: reorder shader cache keys to minimize padding

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17749>

2 years agointel/compiler: pad all data structures used by shader cache keys
Mark Janes [Mon, 25 Jul 2022 22:40:15 +0000 (15:40 -0700)]
intel/compiler: pad all data structures used by shader cache keys

When the compiler pads a data structure, the padded bytes will not be
initialized.  Shader keys are compared with memcmp and unitialized
bytes within the structure breaks this mechanism.

Explicitly pad the structures with members, so the compiler is forced
to initialize them.  Add a warning to indicate if a change to
alignment in any of the data structures requires additional padding.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17749>

2 years agoiris: reorder to minimize padding
Mark Janes [Mon, 25 Jul 2022 23:35:46 +0000 (16:35 -0700)]
iris: reorder to minimize padding

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17749>

2 years agoiris: pad all structures used in a shader key
Mark Janes [Mon, 25 Jul 2022 22:10:19 +0000 (15:10 -0700)]
iris: pad all structures used in a shader key

When the compiler pads a data structure, the padded bytes will not be
initialized.  Shader keys are compared with memcmp and unitialized
bytes within the structure breaks this mechanism.

Explicitly pad the structures with members, so the compiler is forced
to initialize them.  Add a warning to indicate if a change to
alignment in any of the data structures requires additional padding.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17749>

2 years agoutil: define helpful macros for compiler diagnostic features
Mark Janes [Thu, 28 Jul 2022 22:49:36 +0000 (15:49 -0700)]
util: define helpful macros for compiler diagnostic features

Suggested-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17749>

2 years agonine: set view_mask=0
Mike Blumenkrantz [Thu, 28 Jul 2022 13:59:53 +0000 (09:59 -0400)]
nine: set view_mask=0

nine doesn't use viewids, and this breaks drivers that support it

cc: mesa-stable

Reviewed-by: Axel Davy <davyaxel0@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17792>

2 years agod3dadapter: fix sw pipe loading
Mike Blumenkrantz [Thu, 28 Jul 2022 13:08:27 +0000 (09:08 -0400)]
d3dadapter: fix sw pipe loading

this needs to check the env var in order to work correctly

cc: mesa-stable

Reviewed-by: Axel Davy <davyaxel0@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17792>

2 years agovirgl: more ci flakes
Mike Blumenkrantz [Fri, 29 Jul 2022 14:29:26 +0000 (10:29 -0400)]
virgl: more ci flakes

I guess nobody is watching these?

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

2 years agovc4/v3d: stop adding NORAST when SHADERDB debug option is used
Alejandro Piñeiro [Thu, 28 Jul 2022 11:39:56 +0000 (13:39 +0200)]
vc4/v3d: stop adding NORAST when SHADERDB debug option is used

Right now if we use the option SHADERDB, NORAST is added
automatically. There's no comment justifying it, neither a lot of info
on the commits that added that. But I guess that the purpose is that
SHADERDB option is assumed to be used only to gather shader-db stats,
so setting setting NORAST would allow to get those dumps faster.

But adding debug options automatically can be confusing, as we could
get a behaviour that we were not expecting. At least I needed to check
why using SHADERDB was getting a black screen. And if we want to get
this behaviour, we can easily add manually the NORAST.

Finally, v3dv doesn't support NORAST right now (and we don't have
immediate plans to implement it), so it is somewhat inconsistent to
get different behaviour from the same debug option from the two
drivers.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17788>

2 years agoturnip: shared_consts and push_consts are mutually exclusive
Chia-I Wu [Wed, 27 Jul 2022 23:48:36 +0000 (16:48 -0700)]
turnip: shared_consts and push_consts are mutually exclusive

Skip gather_push_constants when shared consts are enabled.  This makes
sure push_consts is only zero-initialized, and reserved_user_consts is
0.  This saves some space in the const file.

This change also adds a few asserts and a comment to
lower_load_push_constant.  Because shared consts share the same range
for all stages, we should not apply per-stage offsets in
lower_load_push_constant.  It worked because nir_lower_explicit_io
always sets base to 0 for nir_var_mem_push_const and
shader->push_consts.lo was always 0 for all stages.

Fixes: 0c787d57e66 ("tu: increase maxPushConstantsSize to 256.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17777>

2 years agoturnip: remove shared_consts from tu_compiled_shaders
Chia-I Wu [Thu, 28 Jul 2022 00:37:17 +0000 (17:37 -0700)]
turnip: remove shared_consts from tu_compiled_shaders

It is set but unused.  We also don't serialize/deserialize shared_consts
to/from the pipeline cache.

Fixes: e1f2cabc5e2 ("turnip: Change to use shared consts for PushConstants")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17777>

2 years agoci: Building osmesa on OSX
Yonggang Luo [Thu, 28 Jul 2022 09:43:18 +0000 (17:43 +0800)]
ci: Building osmesa on OSX

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17784>

2 years agodri: Trim trailing space in dri/dri_util.*
Yonggang Luo [Thu, 28 Jul 2022 08:11:04 +0000 (16:11 +0800)]
dri: Trim trailing space in dri/dri_util.*

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17784>

2 years agoglx: Convert tab to space in applegl_glx.c
Yonggang Luo [Thu, 28 Jul 2022 05:37:18 +0000 (13:37 +0800)]
glx: Convert tab to space in applegl_glx.c

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17784>

2 years agoutil: thread_local doesn't support to be exported on OSX
Yonggang Luo [Wed, 27 Jul 2022 20:31:06 +0000 (04:31 +0800)]
util: thread_local doesn't support to be exported on OSX

The linkage error is:
Undefined symbols for architecture x86_64:
  "thread-local wrapper routine for _glapi_tls_Context", referenced from:
      __mesa_GetActiveUniform_impl in libmesa.a(main_uniform_query.cpp.o)

Fixes: a9e2c699aa3 ("util/c11: Update function u_thread_create to be c11 conformance")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6756

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17784>

2 years agoglx: __glX_tls_Context should use __THREAD_INITIAL_EXEC
Yonggang Luo [Thu, 28 Jul 2022 08:23:37 +0000 (16:23 +0800)]
glx: __glX_tls_Context should use __THREAD_INITIAL_EXEC

Error message on OSX:
../src/glx/tests/fake_glx_screen.cpp:101:20: error: thread-local declaration of '__glX_tls_Context' with dynamic initialization follows declaration with static initialization
thread_local void *__glX_tls_Context = &dummyContext;
                   ^
../src/glx/glxclient.h:655:36: note: previous declaration is here
extern __THREAD_INITIAL_EXEC void *__glX_tls_Context;

Fixes: be00a7c8acf ("glx: using C++11 keyword thread_local")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17784>

2 years agogallium: Disable dri2 interface on OSX
Yonggang Luo [Thu, 28 Jul 2022 08:12:49 +0000 (16:12 +0800)]
gallium: Disable dri2 interface on OSX

Error message:
Undefined symbols for architecture x86_64:
  "_dri_kms_driver_extensions", referenced from:
      _swkmsCreateNewScreen in libdri.a(dri_util.c.o)
  "_galliumdrm_driver_extensions", referenced from:
      _dri2CreateNewScreen in libdri.a(dri_util.c.o)
ld: symbol(s) not found for architecture x86_64

Fixes: b6f7a4836ab ("dri: Fill in the driver extensions for the legacy createNewScreen paths")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6519

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17784>

2 years agogallium: Rename macros HAVE_PIPE_LOADER*
Yonggang Luo [Thu, 28 Jul 2022 12:55:20 +0000 (20:55 +0800)]
gallium: Rename macros HAVE_PIPE_LOADER*

Rename macro HAVE_PIPE_LOADER_DRI to HAVE_DRI
Rename macro HAVE_PIPE_LOADER_KMS to HAVE_DRISW_KMS

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17784>

2 years agogallium: Do not call to pipe_loader_sw_probe_kms when not present
Yonggang Luo [Thu, 28 Jul 2022 05:54:55 +0000 (13:54 +0800)]
gallium: Do not call to pipe_loader_sw_probe_kms when not present

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17784>

2 years agogallium: Move -DHAVE_PIPE_LOADER_DRI and -DHAVE_PIPE_LOADER_KMS to be pre_args
Yonggang Luo [Thu, 28 Jul 2022 05:54:55 +0000 (13:54 +0800)]
gallium:  Move -DHAVE_PIPE_LOADER_DRI and -DHAVE_PIPE_LOADER_KMS to be pre_args

There is non pipe-loader source code depends on it.
After doing this, we found that shared library pipe_swrast depends on libswdri
The error message is:
src/gallium/targets/pipe-loader/pipe_swrast.so.p/pipe_swrast.c.o:pipe_swrast.c:swrast_driver_descriptor: error: undefined reference to 'dri_create_sw_winsys'
src/gallium/targets/pipe-loader/pipe_swrast.so.p/pipe_swrast.c.o:pipe_swrast.c:swrast_driver_descriptor: error: undefined reference to 'kms_dri_create_winsys'

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17784>

2 years agoci: add `--print-errorlogs` to `meson test`
Eric Engestrom [Fri, 29 Jul 2022 10:57:39 +0000 (11:57 +0100)]
ci: add `--print-errorlogs` to `meson test`

In order to avoid having to dig through artifacts to see what failed.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17804>

2 years agopvr: Fix cdm shared reg usage reported to fw.
Karmjit Mahil [Wed, 20 Jul 2022 09:48:21 +0000 (10:48 +0100)]
pvr: Fix cdm shared reg usage reported to fw.

For context switching we need to keep track of the max shared regs
used and report that to the fw.

Reported-by: Rajnesh Kanwal rajnesh.kanwal@imgtec.com
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17683>

2 years agopvr: Add compute pipeline barrier handling.
Karmjit Mahil [Fri, 4 Mar 2022 14:23:40 +0000 (14:23 +0000)]
pvr: Add compute pipeline barrier handling.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17683>

2 years agopvr: Add IDF/WDF program for compute pipeline barrier.
Karmjit Mahil [Fri, 24 Jun 2022 15:34:31 +0000 (16:34 +0100)]
pvr: Add IDF/WDF program for compute pipeline barrier.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17683>

2 years agopvr: Add initial vkCmdPipelineBarrier skeleton.
Karmjit Mahil [Fri, 4 Mar 2022 14:22:42 +0000 (14:22 +0000)]
pvr: Add initial vkCmdPipelineBarrier skeleton.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17683>

2 years agopvr: Add static consts to hard coding infra.
Karmjit Mahil [Tue, 14 Jun 2022 16:11:47 +0000 (17:11 +0100)]
pvr: Add static consts to hard coding infra.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17681>

2 years agopvr: Add static consts support in descriptor pds program.
Karmjit Mahil [Mon, 13 Jun 2022 13:42:47 +0000 (14:42 +0100)]
pvr: Add static consts support in descriptor pds program.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17681>

2 years agopvr: Rename uniform pds program to descriptor pds program.
Karmjit Mahil [Wed, 8 Jun 2022 08:51:25 +0000 (09:51 +0100)]
pvr: Rename uniform pds program to descriptor pds program.

The program will handle more than just DMAing uniforms so renaming
it. E.g. it will handle push constants and compile time static
constants.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17681>

2 years agoturnip: expose support for VK_EXT_acquire_drm_display
Eric Engestrom [Wed, 27 Jul 2022 13:59:57 +0000 (14:59 +0100)]
turnip: expose support for VK_EXT_acquire_drm_display

Turnip supports VK_EXT_direct_mode_display and can use the common
implementation of AcquireDrmDisplayEXT() & GetDrmDisplayEXT() (which use
wsi->can_present_on_device() that turnip implements).

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17768>

2 years agoiris|anv: gfx version 12.5 data cache flush is not a workaround
Dylan Baker [Thu, 28 Jul 2022 20:34:32 +0000 (13:34 -0700)]
iris|anv: gfx version 12.5 data cache flush is not a workaround

This was not a workaround, it was simply missing from the documentation.
So remove the workaround language.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17797>

2 years agoanv: add gfx version 12.5 flushes to CCS path
Dylan Baker [Thu, 28 Jul 2022 20:32:10 +0000 (13:32 -0700)]
anv: add gfx version 12.5 flushes to CCS path

This was already added to the MCS path in !17218, so this is just
adding it in the CCS path as well.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17797>

2 years agointel/eu: Mark header present in URB memory fences on XeHP
Kenneth Graunke [Mon, 18 Jul 2022 23:48:39 +0000 (16:48 -0700)]
intel/eu: Mark header present in URB memory fences on XeHP

Fixes the following EU validation error:

   ERROR: Header must be present for all URB messages.

The message header is ignored for URB fence messages, so I doubt that
this actually matters in practice.  But we should probably mark it as
present, because you have to send something, and according to the
documentation, there is a message header, it's just ignored.

Fixes: e6a9501aa27 ("intel/fs: Add the URB fence message")
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17624>