platform/upstream/mesa.git
3 years agoiris: fix the order of src and dst for fence memcpy
Tapani Pälli [Fri, 23 Oct 2020 10:25:39 +0000 (13:25 +0300)]
iris: fix the order of src and dst for fence memcpy

This fixes random failures with "deqp-egl --deqp-case=*multithread*":
   iris: Failed to submit batchbuffer: No such file or directory

Fixes: 6b1a56b908e ("iris: Drop stale syncobj references in fence_server_sync")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7289>

3 years agonir: get rid of OOB dereferences in nir_lower_io_arrays_to_elements
Andrii Simiklit [Mon, 31 Aug 2020 12:09:43 +0000 (15:09 +0300)]
nir: get rid of OOB dereferences in nir_lower_io_arrays_to_elements

This patch fixes mesa compiler crash in i965 on shaders like the following one:
```
   in VS_OUTPUT {
      mat4 data;
   } vs_output;
   out vec4 fs_output;

   vec4 convert(in float val) {
       return vec4(val);
   }

   void main()
   {
       fs_output = vec4(0.0);
       for (int a = -1; a < 5; a++) {
           for (int b = -1; b < 5; b++) {
               fs_output += convert(vs_output.data[b][a]);
           }
       }
   }
```

Section 5.11 (Out-of-Bounds Accesses) of the GLSL 4.60 spec says:
   In the subsections described above for array, vector, matrix and
   structure accesses, any out-of-bounds access produced undefined
   behavior....
   Out-of-bounds reads return undefined values, which
   include values from other variables of the active program or zero.
   Out-of-bounds writes may be discarded or overwrite
   other variables of the active program.

GL_KHR_robustness and GL_ARB_robustness encourage us to return zero
for reads.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6560>

3 years agoradv: replace RADV_TRACE_FILE by RADV_DEBUG=hang
Samuel Pitoiset [Mon, 19 Oct 2020 16:37:26 +0000 (18:37 +0200)]
radv: replace RADV_TRACE_FILE by RADV_DEBUG=hang

The trace file will be dumped as part of the hang report into
$HOME/radv_dumps_<pid>/trace.log if a GPU hang is detected.

The old and famous RADV_TRACE_FILE envvar is now deprecated.

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

3 years agoradv: re-order GPU hang report dumps by usefulness
Samuel Pitoiset [Tue, 20 Oct 2020 09:40:09 +0000 (11:40 +0200)]
radv: re-order GPU hang report dumps by usefulness

In case the GPU recover, it's probably better to dump useful info
first.

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

3 years agoradv: dump GPU hang report logs into $HOME/radv_dumps_<pid>
Samuel Pitoiset [Mon, 19 Oct 2020 15:56:14 +0000 (17:56 +0200)]
radv: dump GPU hang report logs into $HOME/radv_dumps_<pid>

This creates a directory and save various logs (dmesg, umr,
pipeline, gpu info, etc) instead of printing stuff to stdout/stderr.

This dumps the following files when a GPU hang is detected:
- dmesg.log
- gpu_info.lo
- options.log
- pipeline.log (shaders including SPIR-V if spirv-dis found)
- registers.log
- trace.log
- vm_fault (if a VM fault is detected)
- umr_ring.log (if UMR found)
- umr_waves.log (if UMR found)

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

3 years agoradv: dump UMR ring and waves into the hang report
Samuel Pitoiset [Mon, 19 Oct 2020 14:38:26 +0000 (16:38 +0200)]
radv: dump UMR ring and waves into the hang report

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3620
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/7233>

3 years agoradv: add radv_dump_cmd() helper
Samuel Pitoiset [Mon, 19 Oct 2020 14:38:13 +0000 (16:38 +0200)]
radv: add radv_dump_cmd() helper

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

3 years agoac: add an option to dump GPU info to a file
Samuel Pitoiset [Mon, 19 Oct 2020 14:11:25 +0000 (16:11 +0200)]
ac: add an option to dump GPU info to a file

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

3 years agov3dv: properly describe swap_color_rb
Iago Toral Quiroga [Thu, 22 Oct 2020 08:58:16 +0000 (10:58 +0200)]
v3dv: properly describe swap_color_rb

This key field is only used for V3D versions before 4.1, so it
should not be set for v3dv. Also, it is a mask not a boolean.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7271>

3 years agov3dv: compute swap_rb flag after applying all swizzles
Iago Toral Quiroga [Thu, 22 Oct 2020 08:48:22 +0000 (10:48 +0200)]
v3dv: compute swap_rb flag after applying all swizzles

We were computing this too early based on the view's format alone
which is not correct, since we need to consider the view's swizzle
as well.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7271>

3 years agov3d/compiler: fix BGRA vertex attributes for vec2/float size.
Iago Toral Quiroga [Thu, 22 Oct 2020 08:40:57 +0000 (10:40 +0200)]
v3d/compiler: fix BGRA vertex attributes for vec2/float size.

We don't natively support BGRA format, instead we handle these
as RGBA and we lower the loads to swap components R and B.

However, the driver emits VPM loads based on the size of the
input variables so when we have a vec2 or float BGRA input,
it would only emit VPM loads for components 0 and 1, which is
not correct since we emit a load of component 2 to swap with
component 0.

v2: handle GL legacy vertex inputs gracefully.

Fixes:
dEQP-VK.draw.output_location.array.b8g8r8a8-unorm-highp-output-vec2
dEQP-VK.draw.output_location.array.b8g8r8a8-unorm-mediump-output-vec2

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7271>

3 years agobroadcom/cle: fix vec size dump when set to 0
Iago Toral Quiroga [Thu, 22 Oct 2020 08:37:15 +0000 (10:37 +0200)]
broadcom/cle: fix vec size dump when set to 0

There are two bits for the vector size of a vertex input, with the
value 0 meaning 4 components. The CLE decoder seems to try and dump
"4" instead of "0" is to be a bit more user friendly, but it had an
off-by-one error that would cause it to dump "2" instead.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7271>

3 years agoglsl: Initialize lower_shared_reference_visitor members.
Vinson Lee [Wed, 21 Oct 2020 00:25:44 +0000 (17:25 -0700)]
glsl: Initialize lower_shared_reference_visitor members.

Fix defects reported by Coverity Scan.

Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member buffer_access_type is not
initialized in this constructor nor in any functions that it
calls.
uninit_member: Non-static class member progress is not initialized
in this constructor nor in any functions that it calls.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7243>

3 years agofrontends/va: Return P010/P016 as possible surface formats when encoding
Thong Thai [Thu, 22 Oct 2020 01:54:57 +0000 (21:54 -0400)]
frontends/va: Return P010/P016 as possible surface formats when encoding

When gstreamer's vaapih265enc queries for possible surface formats, it
only queries using VA_RT_FORMAT_YUV420, so add P010 and P016 as possible
surface formats to enable 10-bit/16-bit encoding.

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7268>

3 years agosrc/util/disk_cache_os.c: Add missing headers for open/fcntl
Aníbal Limón [Wed, 14 Oct 2020 19:45:20 +0000 (14:45 -0500)]
src/util/disk_cache_os.c: Add missing headers for open/fcntl

Fixes, strict musl build [1],

...
17:25:31 ../git/src/util/disk_cache_os.c: In function 'disk_cache_load_item':
17:25:31 ../git/src/util/disk_cache_os.c:526:9: error: implicit declaration of function 'open'; did you mean 'popen'? [-Werror=implicit-function-declaration]
17:25:31   526 |    fd = open(filename, O_RDONLY | O_CLOEXEC);
17:25:31       |         ^~~~
17:25:31       |         popen
17:25:31 ../git/src/util/disk_cache_os.c:526:24: error: 'O_RDONLY' undeclared (first use in this function)
17:25:31   526 |    fd = open(filename, O_RDONLY | O_CLOEXEC);
17:25:31       |                        ^~~~~~~~
17:25:31 ../git/src/util/disk_cache_os.c:526:24: note: each undeclared identifier is reported only once for each function it appears in
17:25:31 ../git/src/util/disk_cache_os.c:526:35: error: 'O_CLOEXEC' undeclared (first use in this function); did you mean 'MFD_CLOEXEC'?
17:25:31   526 |    fd = open(filename, O_RDONLY | O_CLOEXEC);
17:25:31       |                                   ^~~~~~~~~
17:25:31       |                                   MFD_CLOEXEC
17:25:31 ../git/src/util/disk_cache_os.c: In function 'disk_cache_write_item_to_disk':
17:25:31 ../git/src/util/disk_cache_os.c:666:28: error: 'O_WRONLY' undeclared (first use in this function)
17:25:31   666 |    fd = open(filename_tmp, O_WRONLY | O_CLOEXEC | O_CREAT, 0644);
17:25:31       |                            ^~~~~~~~
17:25:31 ../git/src/util/disk_cache_os.c:666:39: error: 'O_CLOEXEC' undeclared (first use in this function); did you mean 'MFD_CLOEXEC'?
17:25:31   666 |    fd = open(filename_tmp, O_WRONLY | O_CLOEXEC | O_CREAT, 0644);
17:25:31       |                                       ^~~~~~~~~
17:25:31       |                                       MFD_CLOEXEC
17:25:31 ../git/src/util/disk_cache_os.c:666:51: error: 'O_CREAT' undeclared (first use in this function)
17:25:31   666 |    fd = open(filename_tmp, O_WRONLY | O_CLOEXEC | O_CREAT, 0644);
17:25:31       |                                                   ^~~~~~~
17:25:31 ../git/src/util/disk_cache_os.c:705:30: error: 'O_RDONLY' undeclared (first use in this function)
17:25:31   705 |    fd_final = open(filename, O_RDONLY | O_CLOEXEC);
17:25:31       |                              ^~~~~~~~
17:25:31 ../git/src/util/disk_cache_os.c: In function 'disk_cache_mmap_cache_index':
17:25:31 ../git/src/util/disk_cache_os.c:902:20: error: 'O_RDWR' undeclared (first use in this function)
17:25:31   902 |    fd = open(path, O_RDWR | O_CREAT | O_CLOEXEC, 0644);
17:25:31       |                    ^~~~~~
17:25:31 ../git/src/util/disk_cache_os.c:902:29: error: 'O_CREAT' undeclared (first use in this function)
17:25:31   902 |    fd = open(path, O_RDWR | O_CREAT | O_CLOEXEC, 0644);
17:25:31       |                             ^~~~~~~
17:25:31 ../git/src/util/disk_cache_os.c:902:39: error: 'O_CLOEXEC' undeclared (first use in this function); did you mean 'MFD_CLOEXEC'?
17:25:31   902 |    fd = open(path, O_RDWR | O_CREAT | O_CLOEXEC, 0644);
17:25:31       |                                       ^~~~~~~~~
17:25:31       |                                       MFD_CLOEXEC
17:25:31 cc1: some warnings being treated as errors
...

[1] https://ci.linaro.org/job/lt-qcom-openembedded-meta-qcom-master-premerge/MACHINE=qrb5165-rb5,TCLIBC=musl,label=docker-buster-amd64/87/console

Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7146>

3 years agoanv: Enable stencil buffer compression on Gen12+
Sagar Ghuge [Fri, 24 Apr 2020 17:41:42 +0000 (10:41 -0700)]
anv: Enable stencil buffer compression on Gen12+

v2: (Nanley Chery)
- Fix condition check.
- Move aux_usage assignment after add_aux_state_tracking_buffer method.

v3: (Nanley Chery)
- Move stencil condition close to depth block.

v4: (Nanley Chery)
- Add DEBUG_NO_RBC condition.

v5: (Nanley Chery)
- Don't add CCS plane explicitly.
- Use isl_surf_supports_ccs.

v6:
- Simplify condition (Nanley Chery)

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2942>

3 years agoanv: Pass correct stencil aux usage during MSAA resolve
Sagar Ghuge [Wed, 18 Mar 2020 23:10:39 +0000 (16:10 -0700)]
anv: Pass correct stencil aux usage during MSAA resolve

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2942>

3 years agoanv: Return optimal aux state for stencil buffer compression
Sagar Ghuge [Fri, 24 Apr 2020 17:33:27 +0000 (10:33 -0700)]
anv: Return optimal aux state for stencil buffer compression

v2:
- Assert on aux_supported. (Nanley Chery)

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2942>

3 years agoanv: Don't track clear bo for stencil buffer compression
Sagar Ghuge [Mon, 18 Nov 2019 20:47:10 +0000 (12:47 -0800)]
anv: Don't track clear bo for stencil buffer compression

On Gen12+, stencil buffer compression does not support fast clear so we
don't have to track clear address for it.

v2:
- Use isl_aux_usage_has_fast_clears (Nanley Chery)

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2942>

3 years agoanv: Get aux usage from plane while clearing stencil buffer
Sagar Ghuge [Fri, 24 Apr 2020 17:09:45 +0000 (10:09 -0700)]
anv: Get aux usage from plane while clearing stencil buffer

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2942>

3 years agoanv: Set stencil_aux_usage flag
Sagar Ghuge [Mon, 18 Nov 2019 20:41:13 +0000 (12:41 -0800)]
anv: Set stencil_aux_usage flag

v2: Use image aux usage (Nanley Chery)

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2942>

3 years agoanv: Handle compressed stencil buffer transition on Gen12+
Sagar Ghuge [Mon, 18 Nov 2019 19:21:14 +0000 (11:21 -0800)]
anv: Handle compressed stencil buffer transition on Gen12+

Handle compressed stencil buffer transition from one layout to another
on gen12+.

When stencil compression is enabled, we have to initialize buffer via
stencil clear (HZ_OP) before any renderpass.

v2:
- Pass predicate bit false to anv_image_ccs_op (Nanley Chery)

v3:
- update aspect assertion (Nanley Chery)

v4:
- Make state decision based on anv_layout_to_aux_state instated of
  anv_layout_to_aux_usage (Sagar Ghuge)

v5:
- No need to handle stencil CCS resolve case (Jason Ekstrand)
- Initialize buffer using HZ_OP (Nanley Chery)

v6: (Nanley Chery)
- Pass correct layer/level count.
- Remove local variable.

v7:
- Skip stencil initialization with HZ_OP packet if followed by fast
  clear. (Nanley Chery)

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2942>

3 years agoanv: Return number of layers/levels attached to anv_image
Sagar Ghuge [Tue, 13 Oct 2020 02:12:39 +0000 (19:12 -0700)]
anv: Return number of layers/levels attached to anv_image

Don't check the auxiliary surface's ISL surf in order to return the
surface levels/layers instead we can return the anv_image parameter.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2942>

3 years agonir: Rename replicated-result dot-product instructions
Ian Romanick [Sat, 20 Jun 2020 21:33:57 +0000 (14:33 -0700)]
nir: Rename replicated-result dot-product instructions

All these instructions replicate the result of a N-component dot-product
to a vec4.  Naming them fdot_replicatedN gives the impression that are
some sort of abstract dot-product that replicates the result to a vecN.
They also deviate from fdph_replicated... which nobody would reasonably
consider naming fdot_replicatedh.

Naming these opcodes fdotN_replicated more closely matches what they
are, and it matches the pattern of fdph_replicated.

I believe that the only reason these opcodes were named this way was
because it simplified the implementation of the binop_reduce function in
nir_opcodes.py.  I made some fairly simple changes to that function, and
I think the end result is ok.

The bulk of the changes come from the sed rename:

    sed --in-place -e 's/fdot_replicated\([234]\)/fdot\1_replicated/g' \
        $(grep -r 'fdot_replicated[234]' src/)

v2: Use a named parameter to binop_reduce instead of using
isinstance(name, str).  Suggested by Jason.

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

3 years agospirv: switch to util_bswap32 to improve portability
Jan Beich [Wed, 21 Oct 2020 17:32:02 +0000 (17:32 +0000)]
spirv: switch to util_bswap32 to improve portability

`bswap_32` and `<byteswap.h>` aren't available on BSDs. Instead the
same function is spelled slightly different and is provided by
different header file. However, Mesa provides `util_bswap32` to avoid
complicated conditionals.

Fixes: fb6b243c113a ("spirv: Support big-endian strings")
Tested-by: Piotr Kubaj <pkubaj@FreeBSD.org>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7257>

3 years agoci: Add the new timeout-prone softpipe-gl test to the skips list.
Eric Anholt [Thu, 22 Oct 2020 16:29:18 +0000 (09:29 -0700)]
ci: Add the new timeout-prone softpipe-gl test to the skips list.

The NIR path does a whole lot more work on this testcase and we often time
out, even after the NIR validation speedup.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7279>

3 years agodocs: Fix "Hosted by" link and drop duplicate.
Eric Anholt [Wed, 21 Oct 2020 18:47:45 +0000 (11:47 -0700)]
docs: Fix "Hosted by" link and drop duplicate.

We had two links to planet.fdo, with "Hosted by" incorrectly pointing to
it instead of the top-level "what is fdo".

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

3 years agodocs: Add a link to the linux kernel DRM docs under "Developer Topics"
Eric Anholt [Wed, 21 Oct 2020 17:13:32 +0000 (10:13 -0700)]
docs: Add a link to the linux kernel DRM docs under "Developer Topics"

It's a great source of documentation and replaces a lot of the stale
content on the DRI wiki.

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

3 years agodocs: Drop extra link to old DRI wiki in the "Help" section.
Eric Anholt [Wed, 21 Oct 2020 16:50:48 +0000 (09:50 -0700)]
docs: Drop extra link to old DRI wiki in the "Help" section.

It's at the bottom under "Links" still, but if you're looking for help
this old wiki is probably not going to help you.

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

3 years agoloader/dri3: Allocate up to 4 back buffers for page flips
Michel Dänzer [Fri, 2 Oct 2020 13:55:05 +0000 (15:55 +0200)]
loader/dri3: Allocate up to 4 back buffers for page flips

With swap interval 0, i.e. sync-to-vblank disabled.

This can be necessary for unthrottled drawing with Xwayland:

1) One buffer can be scanned out
2) One buffer can be pending in the kernel for a page flip
3) One buffer can be pending in the Wayland compositor

Therefore, with 3 buffers, the frame-rate could be capped much lower
than the throughput the GPU is capable of, in the worst case at the
Wayland compositor refresh rate.

(The native Wayland EGL backend always uses up to 4 buffers)

Leave the maximum number of buffers at 3 for swap interval != 0, it's
sufficient in that case to always be able to queue one frame ahead of
time.

https://gitlab.gnome.org/GNOME/mutter/-/issues/1455
https://gitlab.gnome.org/GNOME/mutter/-/issues/1462

Cc: mesa-stable
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7033>

3 years agoloader/dri3: Keep current number of back buffers if frame was skipped
Michel Dänzer [Tue, 6 Oct 2020 15:52:08 +0000 (17:52 +0200)]
loader/dri3: Keep current number of back buffers if frame was skipped

We'd previously take the copy path. If we were actually flipping (in
which case skipped frames are more likely to occur), we'd ping-pong
between a smaller and larger number of back buffers, and frame-rate
could vary / take a dip due to the buffer management overhead.

While I'm not sure this is actually possible to hit at this point, it
definitely will be with the next change.

Cc: mesa-stable
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7033>

3 years agoloader/dri3: Only allocate additional buffers if needed
Michel Dänzer [Fri, 2 Oct 2020 13:20:17 +0000 (15:20 +0200)]
loader/dri3: Only allocate additional buffers if needed

Previously, we would always allocate 3 buffers for page flipping. But 2
buffers can suffice for clients which always wait for buffer swaps to
complete before starting a new frame.

Therefore, keep track of the maximum number of buffers separately from
the current number, and only bump the latter if both current buffers are
busy.

Cc: mesa-stable
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7033>

3 years agoanv: fix source/destination layers for 3D blits
Lionel Landwerlin [Tue, 29 Sep 2020 07:55:35 +0000 (10:55 +0300)]
anv: fix source/destination layers for 3D blits

When blitting from source depth range [0-3] into destination depth
range [0-2], we'll have to use a source layer that is in between 2
layers of the 3D source image.

Other than having an incorrect formula, we're also using integer which
prevent us from using the right source layer.

v2: Drop + 0.5 on application offsets

v3: Reuse num_layers (Jason)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3458
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6909>

3 years agoblorp: allow blits with floating point source layers
Lionel Landwerlin [Tue, 15 Sep 2020 18:40:51 +0000 (21:40 +0300)]
blorp: allow blits with floating point source layers

The current blorp API only allows source layers for 3D images to be
integers. That is causing problems with the Vulkan API where we need
to be able to use a 3D layer that could be in between 2 layers.

This change allows a floating point value to be passed for blits and
internally sets up the input parameters to pass floating point values
to kernels.

v2: Use tex op to determinate what types are the coordinates (Jason)
    Drop setting params->z (Lionel)

v3: Fix nir_texop_txf_ms_mcs op not considered as having integer coords (Lionel)

v4: Fix incorrect test on nir_texop_txf_ms_mcs (Ivan)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3458
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6909>

3 years agoblorp: identify copy kernels in NIR
Lionel Landwerlin [Tue, 29 Sep 2020 07:54:07 +0000 (10:54 +0300)]
blorp: identify copy kernels in NIR

This was useful in identifying blit vs copy kernels.

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

3 years agoac/nir: abort when an unknown intrinsic is reached
Samuel Pitoiset [Wed, 14 Oct 2020 08:01:58 +0000 (10:01 +0200)]
ac/nir: abort when an unknown intrinsic is reached

This would have catched this NIR GS lowering regression earlier.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7127>

3 years agoac/nir: ignore set_vertex_and_primitive_count intrinsic
Samuel Pitoiset [Thu, 22 Oct 2020 06:50:23 +0000 (08:50 +0200)]
ac/nir: ignore set_vertex_and_primitive_count intrinsic

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

3 years agocompile/nir: Correct printing dest_type
Gert Wollny [Wed, 21 Oct 2020 22:36:13 +0000 (00:36 +0200)]
compile/nir: Correct printing dest_type

Fixes: 0aa08ae2f673a36709c5485679d4c89a747ec0e9
    nir: Split NIR_INTRINSIC_TYPE into separate src/dest indices

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

3 years agoaco: fix determining if LOD is zero for nir_texop_txf/nir_texop_txs
Samuel Pitoiset [Wed, 21 Oct 2020 16:25:56 +0000 (18:25 +0200)]
aco: fix determining if LOD is zero for nir_texop_txf/nir_texop_txs

txf/txs expects LOD to be a 32-bit unsigned integer while other
texture operations expects a float.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3668
Fixes: 93c8ebfa780 ("aco: Initial commit of independent AMD compiler")
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/7256>

3 years agonir/loop_analyze: adjust force unrolling to only include interesting modes
Rhys Perry [Thu, 15 Oct 2020 10:41:20 +0000 (11:41 +0100)]
nir/loop_analyze: adjust force unrolling to only include interesting modes

Instead of force-unrolling any loop which reads an entire array, only do
it for arrays which might be faster to access with constant indices.

Significantly improves compile-time for these CTS tests, which could
previously timeout:
dEQP-VK.spirv_assembly.instruction.graphics.16bit_storage.struct_mixed_types.uniform_buffer_block_geom
dEQP-VK.spirv_assembly.instruction.graphics.16bit_storage.struct_mixed_types.uniform_geom
dEQP-VK.spirv_assembly.instruction.graphics.8bit_storage.struct_mixed_types.storage_buffer_geom
dEQP-VK.spirv_assembly.instruction.graphics.spirv_ids_abuse.lots_ids_geom

fossil-db (Navi):
Totals from 19 (0.01% of 137413) affected shaders:
SGPRs: 1728 -> 1688 (-2.31%)
VGPRs: 1176 -> 1168 (-0.68%)
CodeSize: 198496 -> 136580 (-31.19%)
MaxWaves: 154 -> 156 (+1.30%)
Instrs: 38889 -> 26029 (-33.07%)
Cycles: 446108 -> 1059924 (+137.59%); split: -0.91%, +138.51%
VMEM: 3245 -> 2926 (-9.83%)
SMEM: 850 -> 828 (-2.59%); split: +4.71%, -7.29%
VClause: 549 -> 533 (-2.91%)
SClause: 1810 -> 1522 (-15.91%)
Copies: 2209 -> 1705 (-22.82%); split: -22.95%, +0.14%
Branches: 854 -> 603 (-29.39%); split: -29.86%, +0.47%
PreSGPRs: 1512 -> 1506 (-0.40%); split: -0.53%, +0.13%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7161>

3 years agoci: disable check commits job for now
Rhys Perry [Thu, 22 Oct 2020 11:05:34 +0000 (12:05 +0100)]
ci: disable check commits job for now

This job currently disallows reasonably long commit messages (for example,
CTS test names).

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

3 years agov3dv: handle buffer to linear depth/stencil image copies in blit path
Iago Toral Quiroga [Tue, 20 Oct 2020 10:51:50 +0000 (12:51 +0200)]
v3dv: handle buffer to linear depth/stencil image copies in blit path

We can't render to linear depth/stencil so we want to convert these to a
compatible color blit.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7247>

3 years agov3dv: handle compressed image to buffer copies on the blit path
Iago Toral Quiroga [Fri, 9 Oct 2020 15:35:01 +0000 (17:35 +0200)]
v3dv: handle compressed image to buffer copies on the blit path

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7247>

3 years agov3dv: fix Z coordinate for 3D blits
Iago Toral Quiroga [Fri, 9 Oct 2020 17:11:30 +0000 (19:11 +0200)]
v3dv: fix Z coordinate for 3D blits

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7247>

3 years agov3dv: do not attempt to blit from a linear image source
Iago Toral Quiroga [Fri, 9 Oct 2020 16:41:20 +0000 (18:41 +0200)]
v3dv: do not attempt to blit from a linear image source

The hardware only supports texturing from tiled images.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7247>

3 years agov3dv: fix multi-layered buffer to image copies on the blit path
Iago Toral Quiroga [Fri, 9 Oct 2020 12:57:57 +0000 (14:57 +0200)]
v3dv: fix multi-layered buffer to image copies on the blit path

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7247>

3 years agov3dv: skip unnecessary tile loads when blitting
Iago Toral Quiroga [Thu, 8 Oct 2020 11:24:13 +0000 (13:24 +0200)]
v3dv: skip unnecessary tile loads when blitting

If we are blitting to tile boundaries we don't need to emit
tile loads. The exception to this is the case where we are
blitting only a subset of the pixel components in the image
(which we do for single aspect blits of D24S8), since in that
case we need to preserve the components we are not writing.

There is a corner case where some times we create framebuffers
that alias subregions of a larger image. In that case the edge
tiles are not padded and we can't skip the loads.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7247>

3 years agogallivm/nir: handle nir_op_flt in lp_build_nir_llvm
Tapani Pälli [Wed, 21 Oct 2020 05:43:25 +0000 (08:43 +0300)]
gallivm/nir: handle nir_op_flt in lp_build_nir_llvm

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3663
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7248>

3 years agodriconf: allow higher compat version for Brink
Martin Peres [Tue, 20 Oct 2020 06:40:34 +0000 (09:40 +0300)]
driconf: allow higher compat version for Brink

This fixes the game on mesa classic drivers that still expose OpenGL
3.0 for compatibility profiles.

Suggested-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7212>

3 years agodriconf: disable GLX_OML_swap_method by default on Brink
Martin Peres [Fri, 16 Oct 2020 05:26:05 +0000 (08:26 +0300)]
driconf: disable GLX_OML_swap_method by default on Brink

Brink makes use of the WGL-equivalent extension, and Wine translates
that to GLX_OML_swap_method. However, Mesa does not expose the exchange
swap method, which is what Wine is looking for.

Not exposing the extension fixes everything, so let's keep things
simple!

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/106
Tested-by: Gregor Münch <gr.muench_at_gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7212>

3 years agodriconf: add a way to override indirect-GL extensions
Martin Peres [Tue, 20 Oct 2020 13:20:20 +0000 (16:20 +0300)]
driconf: add a way to override indirect-GL extensions

Support for DRI1 is not implemented, but who still uses that?

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7212>

3 years agodriconf: add a way to override GLX extensions
Martin Peres [Thu, 15 Oct 2020 15:29:45 +0000 (18:29 +0300)]
driconf: add a way to override GLX extensions

Support for DRI1 is not implemented, but who still uses that?

v2:
 - Add the option to the list of new features
 - Drop overriding the Xorg-exposed extensions

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7212>

3 years agoglx: let users force-enable/disable indirect GL extensions
Martin Peres [Tue, 20 Oct 2020 13:05:24 +0000 (16:05 +0300)]
glx: let users force-enable/disable indirect GL extensions

This can be useful for debugging or working around bugs involving
indirect GL.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7212>

3 years agoglx: initial plumbing to let users force-enable/disable extensions
Martin Peres [Thu, 15 Oct 2020 05:55:41 +0000 (08:55 +0300)]
glx: initial plumbing to let users force-enable/disable extensions

This can be useful for debugging or working around bugs such as
Mesa#106 where Wine is expecting to find a visual that isn't
available.

v2:
 - split the indirect GL extension override to its own commit
 - memset the bitfields to 0 in __glXExtensionsCtrScreen

Reviewed-by: Adam Jackson <ajax@redhat.com>
v3:
 - slight rework necessary after splitting the computation of usable
   extensions (Ian)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7212>

3 years agoglx: rework __glXCalculateUsableExtensions to be more readable
Ian Romanick [Wed, 21 Oct 2020 05:40:44 +0000 (08:40 +0300)]
glx: rework __glXCalculateUsableExtensions to be more readable

We are about to make the GLX extension equation even more complex by
adding force-enable/disable. Before doing so, split the line into
multiple stages that can get a proper comment to explain what is going
on.

The code is taken mostly verbatim from Ian Romanick's comment:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7212#note_668045

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7212>

3 years agoglx: stop using hardcoded array sizes for bitfields
Martin Peres [Tue, 20 Oct 2020 06:09:57 +0000 (09:09 +0300)]
glx: stop using hardcoded array sizes for bitfields

Replicate the solution used for OpenGL extensions by introducing
__GLX_EXT_BYTES.

Suggested-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7212>

3 years agoglx/extensions: split set_glx_extension into find_ and set_
Martin Peres [Thu, 15 Oct 2020 05:47:50 +0000 (08:47 +0300)]
glx/extensions: split set_glx_extension into find_ and set_

An upcoming commit will require to find an extension in a list. Rather
than duplicating part of the code from set_glx_extension, split it into
find_extension and set_glx_extension.

NOTE: set_glx_extension is a bit of a misnomer since it is also used
for gl extensions. This is why the find function is named
find_extension rather than find_glx_extension.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7212>

3 years agodri/DRI2ConfigQueryExtension: add support for string options
Martin Peres [Thu, 15 Oct 2020 12:23:05 +0000 (15:23 +0300)]
dri/DRI2ConfigQueryExtension: add support for string options

This will be useful to enable extension overriding as a drirc option.

v2 (Adam Jackson):
 - Rename from configQuerystr to configQuerys for symmetry
 - Increase the version number of the interface

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7212>

3 years agodriconf: initialize the option value before using it
Martin Peres [Thu, 15 Oct 2020 15:27:27 +0000 (18:27 +0300)]
driconf: initialize the option value before using it

ParseValue is freeing the pointer if the address is != 0. However,
since we allocate this value on the stack, we need to initialize the
data first.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7212>

3 years agodriconf: bump the maximum string size from 25 to 1024
Martin Peres [Fri, 5 Jun 2015 13:04:03 +0000 (16:04 +0300)]
driconf: bump the maximum string size from 25 to 1024

The soon-to-be-introduced string entries will potentially introduce
very long strings that should not be truncated.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Martin peres <martin.peres@linux.intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7212>

3 years agoandroid: util,ac,aco,radv: Cross-platform memstream API
Mauro Rossi [Thu, 22 Oct 2020 00:06:59 +0000 (02:06 +0200)]
android: util,ac,aco,radv: Cross-platform memstream API

Fixes the following building errors:

external/mesa/src/amd/common/ac_debug.c:589:
error: undefined reference to 'u_memstream_open'

external/mesa/src/amd/common/ac_debug.c:593:
error: undefined reference to 'u_memstream_close'

Fixes: af8d488ea5e1 ("util,ac,aco,radv: Cross-platform memstream API")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7267>

3 years agoglsl: Initialize ir_if_to_cond_assign_visitor members in constructor.
Vinson Lee [Mon, 19 Oct 2020 23:03:52 +0000 (16:03 -0700)]
glsl: Initialize ir_if_to_cond_assign_visitor members in constructor.

Fix defects reported by Coverity Scan.

Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member found_unsupported_op is not
initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member found_expensive_op is not
initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member found_dynamic_arrayref is not
initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member is_then is not initialized in
this constructor nor in any functions that it calls.
uninit_member: Non-static class member then_cost is not initialized in
this constructor nor in any functions that it calls.
uninit_member: Non-static class member else_cost is not initialized in
this constructor nor in any functions that it calls.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7228>

3 years agonir: Use a switch in nir_lower_explicit_io_instr
Caio Marcelo de Oliveira Filho [Mon, 5 Oct 2020 21:25:10 +0000 (14:25 -0700)]
nir: Use a switch in nir_lower_explicit_io_instr

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

3 years agodocs/v3d: Add a little stub of v3d documentation.
Eric Anholt [Thu, 15 Oct 2020 21:15:42 +0000 (14:15 -0700)]
docs/v3d: Add a little stub of v3d documentation.

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

3 years agodocs/vc4: Add information on the hw documentation available.
Eric Anholt [Thu, 15 Oct 2020 23:19:51 +0000 (16:19 -0700)]
docs/vc4: Add information on the hw documentation available.

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

3 years agodocs/vc4: Move my old vc4 wiki's documentation into docs.mesa3d.org.
Eric Anholt [Thu, 15 Oct 2020 20:54:38 +0000 (13:54 -0700)]
docs/vc4: Move my old vc4 wiki's documentation into docs.mesa3d.org.

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

3 years agodocs/vmware: Move the vmware driver docs into the drivers section.
Eric Anholt [Fri, 16 Oct 2020 17:40:35 +0000 (10:40 -0700)]
docs/vmware: Move the vmware driver docs into the drivers section.

For more consistency with the other drivers.

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

3 years agodocs: Move the gallium driver documentation to the top level.
Eric Anholt [Fri, 16 Oct 2020 17:35:17 +0000 (10:35 -0700)]
docs: Move the gallium driver documentation to the top level.

I actually had never found these, buried under Developer Topics -> Gallium
-> Drivers.  Given that driver documentation contains not just gallium
driver documentation but also end-user information, bring it to a much
more prominent location between User Topics and Developer Topics at the
top level.

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

3 years agodocs: specify redirects in conf.py instead
Erik Faye-Lund [Wed, 21 Oct 2020 11:50:11 +0000 (13:50 +0200)]
docs: specify redirects in conf.py instead

This makes it much easier to discover these.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7174>

3 years agodocs: specify redirects relative to docs-root
Erik Faye-Lund [Wed, 21 Oct 2020 11:42:30 +0000 (13:42 +0200)]
docs: specify redirects relative to docs-root

It's a lot easier to reason about redirects if they're specified
relative to thje docs-root, so let's do that instead.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7174>

3 years agodocs: verify that targets for relative redirects exist
Erik Faye-Lund [Wed, 21 Oct 2020 11:38:23 +0000 (13:38 +0200)]
docs: verify that targets for relative redirects exist

This makes it a bit easier to update the redirects.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7174>

3 years agodocs: create leading directories for redirects
Erik Faye-Lund [Wed, 21 Oct 2020 12:00:23 +0000 (14:00 +0200)]
docs: create leading directories for redirects

This will be useful when removing entire directories from the docs,
which will happen in an upcoming patch.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7174>

3 years agovirgl: Fixes portal2 binary name in tweak config
Ryan Neph [Wed, 21 Oct 2020 00:47:04 +0000 (00:47 +0000)]
virgl: Fixes portal2 binary name in tweak config

Portal 2 on virgl w/ GLES host requires bgraswz and emubgra tweaks.
Application binary name matching mismatch caused tweaks to default
to a disabled state.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Fixes: 9760a7ed913 ("virgl: apply bgra dest swizzle and add Portal 2")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7246>

3 years agost/mesa: initialize lower alpha func to ALWAYS
Juan A. Suarez Romero [Wed, 21 Oct 2020 09:45:08 +0000 (11:45 +0200)]
st/mesa: initialize lower alpha func to ALWAYS

The lower_alpha_func is initialized as COMPARE_FUNC_NEVER, and the
nir_lower_alpha_test() only executed if the alpha_func has changed.

This means when user runs an alpha test with GL_NEVER function the
lowering is never executed, and no fragment is discarded.

Rather, we would like to initialize the function as COMPARE_FUNC_ALWAYS,
and run the lowering when the alpha_func is different. If user runs the
alpha test with GL_ALWAYS, indeed the lowering is never executed; but
using GL_ALWAYS makes no fragment is discarded, so it is like not
executing the testing.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7251>

3 years agonir: drop unused alpha_ref_float
Erik Faye-Lund [Mon, 7 Oct 2019 10:19:15 +0000 (12:19 +0200)]
nir: drop unused alpha_ref_float

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

3 years agonir: drop support for using load_alpha_ref_float
Erik Faye-Lund [Mon, 7 Oct 2019 10:08:55 +0000 (12:08 +0200)]
nir: drop support for using load_alpha_ref_float

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

3 years agovc4: do not report alpha-test as supported
Erik Faye-Lund [Mon, 7 Oct 2019 10:07:47 +0000 (12:07 +0200)]
vc4: do not report alpha-test as supported

This triggers lowering in the state-tracker, which makes things a bit
simpler.

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

3 years agov3d: do not report alpha-test as supported
Erik Faye-Lund [Mon, 7 Oct 2019 10:18:09 +0000 (12:18 +0200)]
v3d: do not report alpha-test as supported

This triggers lowering in the state-tracker, which makes things a bit
simpler.

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

3 years agoci: Add jobs running ci-fairy checks
Michel Dänzer [Thu, 6 Aug 2020 15:37:33 +0000 (17:37 +0200)]
ci: Add jobs running ci-fairy checks

These can catch various common issues in MR settings and Git commit
logs.

The "check mr" job only exists in pre-merge pipelines for MRs, and runs
automatically.

The "check commits" job only exists in pre-merge pipelines for MRs and
in pipelines for forked branches. It runs automatically in the former
case and can be manually triggered in the latter.

v2:
* Use git_archive docker image (Daniel Stone)
* Use a single sanity stage for both jobs (Tomeu Vizoso)

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6209>

3 years agoci: Add empty needs: to pages job
Michel Dänzer [Thu, 6 Aug 2020 15:12:11 +0000 (17:12 +0200)]
ci: Add empty needs: to pages job

So it doesn't need to wait for jobs in earlier stages.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6209>

3 years agoci: Move test-docs job to deploy stage
Michel Dänzer [Thu, 6 Aug 2020 15:10:08 +0000 (17:10 +0200)]
ci: Move test-docs job to deploy stage

We put it in the first container stage to prevent it from waiting for
jobs in previous stages, but empty needs: works for that as well.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6209>

3 years agost/mesa: make sure prog->info is up to date for NIR (v2)
Marek Olšák [Mon, 28 Sep 2020 22:18:43 +0000 (18:18 -0400)]
st/mesa: make sure prog->info is up to date for NIR (v2)

so that info changes from pipe_screem::finalize_nir are reflected
in gl_program

v2: don't call nir_shader_gather_info again, because it crashes with freedreno

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6950>

3 years agoRevert "st/mesa: don't pass NIR to draw module if IO is lowered"
Marek Olšák [Mon, 28 Sep 2020 17:12:14 +0000 (13:12 -0400)]
Revert "st/mesa: don't pass NIR to draw module if IO is lowered"

This reverts commit 493fdcf44647ee471e934de3e63d193c6a3b6ff0.

The lowered IO support has been added to Draw recently:
    https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6698

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6950>

3 years agonir: consider load_color intrinsics as both inputs and sysval in gathering
Marek Olšák [Tue, 29 Sep 2020 01:09:40 +0000 (21:09 -0400)]
nir: consider load_color intrinsics as both inputs and sysval in gathering

src/mesa expects this somewhere.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6950>

3 years agoamd: update addrlib
Marek Olšák [Fri, 16 Oct 2020 12:14:11 +0000 (08:14 -0400)]
amd: update addrlib

All Mesa-specific includes and definitions have been moved to addrcommon.h.

Instead of suppressing warnings in the code, they are suppressed
in meson.build.

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

3 years agoglx: Move glXGet{ScreenDriver,DriverConfig} to common code
Adam Jackson [Fri, 16 Oct 2020 21:32:25 +0000 (17:32 -0400)]
glx: Move glXGet{ScreenDriver,DriverConfig} to common code

These no longer reference anything specific to a particular DRI
protocol.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7219>

3 years agoglx: Delegate the core of glXGetScreenDriver to the GLX screen vtable
Adam Jackson [Fri, 16 Oct 2020 21:18:18 +0000 (17:18 -0400)]
glx: Delegate the core of glXGetScreenDriver to the GLX screen vtable

This is a minor bugfix, in that the prior code required that the server
expose either XFree86-DRI or DRI2 to get the name; Xwayland exposed
neither, just DRI3. Now, for DRI2 and DRI3, we just ask the loader. It
also means we report "swrast" for the driver name when that's what we're
using, which is probably a good thing.

v2: Trust the driver name from the server for DRI2 (Michel Dänzer)

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7219>

3 years agoglx: move __glXGetUST into the DRI1 code
Adam Jackson [Fri, 16 Oct 2020 20:17:54 +0000 (16:17 -0400)]
glx: move __glXGetUST into the DRI1 code

This is only used from the __DRI_SYSTEM_TIME loader extension, which
only the DRI1 drivers ever looked for.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7219>

3 years agoradv,aco: fix use of texop_samples_identical in the resolve meta path
Samuel Pitoiset [Tue, 20 Oct 2020 14:56:29 +0000 (16:56 +0200)]
radv,aco: fix use of texop_samples_identical in the resolve meta path

The return value of this texture intrinsic should be a NIR 1-bit bool.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7236>

3 years agoac/nir: do not sign-extend the result of texop_samples_identical
Samuel Pitoiset [Tue, 20 Oct 2020 14:54:45 +0000 (16:54 +0200)]
ac/nir: do not sign-extend the result of texop_samples_identical

The return value should be a NIR 1-bit bool.

This fixes a regression with piglit
ext_shader_samples_identical-simple-fs 2 on RadeonSI.

Fixes: e690a1b78bf ("ac/llvm: don't lower bool to int32, switch to native i1 bool")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7236>

3 years agodocs/features: add v3dv driver
Alejandro Piñeiro [Wed, 14 Oct 2020 07:48:44 +0000 (09:48 +0200)]
docs/features: add v3dv driver

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

3 years agofrontends/va/postproc: Un-break field flag
Thong Thai [Thu, 15 Oct 2020 19:32:47 +0000 (15:32 -0400)]
frontends/va/postproc: Un-break field flag

Fixes an issue where deinterlaced videos would play at half the
framerate, since only one field was repeated, instead of using both
fields. Reverts a change I made previously which broke this.

Fixes: 78786a219ea ("frontends/va: Fix deinterlace bottom field first flag")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3621
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7194>

3 years agoaco/isel: Miscellaneous cleanups using the new Stage API
Tony Wasserka [Tue, 6 Oct 2020 20:52:02 +0000 (22:52 +0200)]
aco/isel: Miscellaneous cleanups using the new Stage API

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7094>

3 years agoaco: Clean up symbol names and comments related to NGG
Tony Wasserka [Wed, 7 Oct 2020 16:21:48 +0000 (18:21 +0200)]
aco: Clean up symbol names and comments related to NGG

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7094>

3 years agoaco: Use strong typing to model SW<->HW stage mappings
Tony Wasserka [Mon, 5 Oct 2020 15:50:37 +0000 (17:50 +0200)]
aco: Use strong typing to model SW<->HW stage mappings

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7094>

3 years agonir: Only validate in passes that might have changed things.
Eric Anholt [Tue, 20 Oct 2020 20:43:03 +0000 (13:43 -0700)]
nir: Only validate in passes that might have changed things.

If a pass returning boolean progress reports no change, we shouldn't need
to re-validate.  If a pass breaks the NIR but also fails to report
progress correctly, it would be up to the next pass to catch that.

This should hopefully help with test timeouts on
KHR-GL33.texture_swizzle.functional since switching softpipe to
nir-to-tgsi and enabling NIR validation in CI (27s to 20s on my system).

Suggested-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7239>

3 years agoglsl: relax rule on varying matching for shaders older than 4.00
Timothy Arceri [Fri, 16 Oct 2020 08:26:51 +0000 (19:26 +1100)]
glsl: relax rule on varying matching for shaders older than 4.00

Please see new code commment for full justification.

Fixes: 18004c338f6b ("glsl: fail when a shader's input var has not an equivalent out var in previous")

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3648

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7184>

3 years agopanfrost: Only enable occlusion queries when active
Icecream95 [Wed, 14 Oct 2020 11:08:36 +0000 (00:08 +1300)]
panfrost: Only enable occlusion queries when active

Fixes piglit tests:
 - occlusion_query_meta_fragments
 - occlusion_query_meta_save

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

3 years agopanfrost: Precise occlusion query support
Icecream95 [Fri, 9 Oct 2020 07:01:16 +0000 (20:01 +1300)]
panfrost: Precise occlusion query support

In the "counter" occlusion query mode, each shader core has a separate
counter.

When MSAA is disabled, counter values need to be divided by four.

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

3 years agost/mesa: Drop the TGSI paths for drawpixels and use nir-to-tgsi if needed.
Eric Anholt [Wed, 26 Aug 2020 19:51:15 +0000 (12:51 -0700)]
st/mesa: Drop the TGSI paths for drawpixels and use nir-to-tgsi if needed.

Now that we have a NIR translator in gallium, we can drop this duplicated
code in the API implementation.

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