platform/upstream/mesa.git
3 years agoiris: Use different shader uploaders for precompile vs. draw time
Kenneth Graunke [Tue, 9 Feb 2021 01:00:36 +0000 (17:00 -0800)]
iris: Use different shader uploaders for precompile vs. draw time

When we enable u_threaded_context, the pipe->create_*_state hooks
(precompile variants) are going to be called from one thread, while
iris_update_compiled_shaders (on-the-fly variants) are going to be
called from a driver thread.  BLORP shaders also happen from
clear, blit, and so on in the driver thread.

u_upload_mgr isn't thread-safe, so use an uploader for each purpose.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8964>

3 years agoiris: Support rebinding of stream output targets
Kenneth Graunke [Wed, 3 Feb 2021 02:42:41 +0000 (18:42 -0800)]
iris: Support rebinding of stream output targets

This enables us to replace the backing storage of resources that have
been used as stream output targets, in case we're invalidating their
entire contents.  This can avoid stalls.  We simply hadn't supported it
because it was going to be tricky to re-emit 3DSTATE_SO_BUFFER without
screwing up "reset offset to zero" vs. "keep appending".  But that
should be working fine with the previous patch's refactor.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8964>

3 years agoiris: Rework zeroing of stream output buffer offsets
Kenneth Graunke [Wed, 3 Feb 2021 01:02:05 +0000 (17:02 -0800)]
iris: Rework zeroing of stream output buffer offsets

The previous mechanism was a bit fragile.  We stored the zero offset
in the pre-baked packet, and used an flag to override 0xFFFFFFFF
(append) offsets until our first emit - then prohibited anyone from
trying to re-emit the packet by flagging IRIS_DIRTY_SO_BUFFERS,
because that would re-emit the version with the zeroing of the offset.

Now, we always store 0xFFFFFFFF in the pre-baked packet, and use a
flag to override it to zero on the first emit.  That way, we can
re-emit that packet at any time, and it'll just keep appending.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8964>

3 years agoiris: Defer stream output target space allocation until set time
Kenneth Graunke [Mon, 1 Feb 2021 13:12:30 +0000 (05:12 -0800)]
iris: Defer stream output target space allocation until set time

In the future, Marek is planning to make u_threaded_context call
create_stream_output_target() from a different thread than the main
driver thread, which means that we can't safely use uploaders there.

To prepare for this eventual future, just defer the allocation of
the offset BO 'til later.  It's a very small amount of overhead.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8964>

3 years agoiris: Defer uploading of surface states
Kenneth Graunke [Mon, 1 Feb 2021 12:51:11 +0000 (04:51 -0800)]
iris: Defer uploading of surface states

With u_threaded_context, create_surface and create_sampler_view will
be called from a different thread than the driver thread.  They aren't
allowed to access the context, which means that they can't use the
uploaders there to upload our SURFACE_STATE entries.

Thanks to backing-storage replacement and iris_rebind_buffer, we already
reworked things to maintain CPU-side copies of the SURFACE_STATE entries
and added the ability to upload or re-upload them later.  So we can skip
the upload at object creation time, and add a simple resource-is-NULL
check at binding table upload time to ensure that they get uploaded by
the time we need them.  (They might get uploaded earlier due to rebinds
or clear color updates, but this is the last moment to do so.)

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8964>

3 years agolima: avoid stomping over bound shader state when creating new shaders
Eric Anholt [Tue, 16 Feb 2021 20:55:54 +0000 (12:55 -0800)]
lima: avoid stomping over bound shader state when creating new shaders

It shouldn't affect bound program state, and the current context state
shouldn't be relevant for shader creation precompiles anyway (level load
isn't going to have the eventual set of sampler views bound when you go to
draw with that shader).

Closes: #4306
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9089>

3 years agolima: upload the shader to a BO at shader creation
Eric Anholt [Tue, 16 Feb 2021 20:49:01 +0000 (12:49 -0800)]
lima: upload the shader to a BO at shader creation

No need to conditionally upload later.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9089>

3 years agolima: don't look at dirty bits for setup of FS key
Eric Anholt [Tue, 16 Feb 2021 20:45:08 +0000 (12:45 -0800)]
lima: don't look at dirty bits for setup of FS key

You always have to populate the key with the right texture swizzles, even
if textures haven't changed since binding a new shader.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9089>

3 years agolima: stop encoding the texture format in the shader key
Eric Anholt [Tue, 16 Feb 2021 20:42:22 +0000 (12:42 -0800)]
lima: stop encoding the texture format in the shader key

We can compose the swizzles at sampler view creation time, saving
recompiles on texture format changes.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9089>

3 years agoanv: implement INTEL_DEBUG=submit
Lionel Landwerlin [Wed, 17 Jun 2020 12:37:33 +0000 (15:37 +0300)]
anv: implement INTEL_DEBUG=submit

Name all the BOs!

v2: Fix 32bit build issue (Thanks Marge!)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5736>

3 years agovirgl: Add support for querying detailed memory info
Rohan Garg [Thu, 25 Feb 2021 17:13:22 +0000 (18:13 +0100)]
virgl: Add support for querying detailed memory info

This allows for virgl guests to expose GL_NVX_gpu_memory_info and
GL_ATI_meminfo when the extensions are supported on the host.

Signed-off-by: Rohan Garg <rohan.garg@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9337>

3 years agointel/mi_builder: Drop the gen_ prefix
Jason Ekstrand [Wed, 3 Mar 2021 18:29:39 +0000 (12:29 -0600)]
intel/mi_builder: Drop the gen_ prefix

mi_ is already a unique prefix in Mesa so the gen_ isn't really gaining
us anything except extra characters.  It's possible that MI_ may
conflict a tiny bit with GenXML but it doesn't seem to be a problem
today and we can deal with that in the future if it's ever an issue.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9393>

3 years agointel: Rename gen_mi_builder.h to mi_builder.h
Jason Ekstrand [Wed, 3 Mar 2021 18:09:11 +0000 (12:09 -0600)]
intel: Rename gen_mi_builder.h to mi_builder.h

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9393>

3 years agoir3: disallow moving memory writes over discard
Danylo Piliaiev [Tue, 2 Mar 2021 12:30:01 +0000 (14:30 +0200)]
ir3: disallow moving memory writes over discard

Writes to global memory should not be moved over discard,
otherwise we could have unintended side-effects or lack of
side-effects where they should be observed.

Fixes tests:
 dEQP-VK.rasterization.frag_side_effects.color_at_beginning.kill
 dEQP-VK.rasterization.frag_side_effects.color_at_end.kill

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9365>

3 years agoci: Bump deqp to vk-gl-cts 1.2.5.2
Juan A. Suarez Romero [Tue, 2 Mar 2021 10:45:27 +0000 (11:45 +0100)]
ci: Bump deqp to vk-gl-cts 1.2.5.2

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9369>

3 years agoir3: make mark_kill_path exit early if instr is already seen
Danylo Piliaiev [Wed, 3 Mar 2021 10:16:55 +0000 (12:16 +0200)]
ir3: make mark_kill_path exit early if instr is already seen

Would bring down its complexity in pathological cases.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9386>

3 years agoir3: prevent duplication of instruction's dependencies
Danylo Piliaiev [Wed, 3 Mar 2021 10:08:53 +0000 (12:08 +0200)]
ir3: prevent duplication of instruction's dependencies

Otherwise mark_kill_path() is happy to take exponential time to finish.

It was possible to have such chains:
  ...
 stib.base0 imm[0.000000,0,0x0], ssa_233, ssa_234, false-deps:ssa_231, ssa_231
 stib.base0 imm[0.000000,0,0x0], ssa_237, ssa_238, false-deps:ssa_235, ssa_235
 stib.base0 imm[0.000000,0,0x0], ssa_241, ssa_242, false-deps:ssa_239, ssa_239
 stib.base0 imm[0.000000,0,0x0], ssa_245, ssa_246, false-deps:ssa_243, ssa_243
 stib.base0 imm[0.000000,0,0x0], ssa_249, ssa_250, false-deps:ssa_247, ssa_247
 stib.base0 imm[0.000000,0,0x0], ssa_105, ssa_253, false-deps:ssa_251, ssa_251
 stib.base0 imm[0.000000,0,0x0], ssa_109, ssa_256, false-deps:ssa_254, ssa_254
 stib.base0 imm[0.000000,0,0x0], ssa_113, ssa_259, false-deps:ssa_257, ssa_257
 stib.base0 imm[0.000000,0,0x0], ssa_117, ssa_262, false-deps:ssa_260, ssa_260
 stib.base0 imm[0.000000,0,0x0], ssa_265, ssa_266, false-deps:ssa_263, ssa_263
 stib.base0 imm[0.000000,0,0x0], ssa_269, ssa_270, false-deps:ssa_267, ssa_267
 stib.base0 imm[0.000000,0,0x0], ssa_273, ssa_274, false-deps:ssa_271, ssa_271
  ...

Fixes tests:
 dEQP-VK.geometry.layered.cube_array.36_36_12.secondary_cmd_buffer_inherit_framebuffer
 dEQP-VK.geometry.layered.3d.64_64_8.secondary_cmd_buffer_inherit_framebuffer
 dEQP-VK.geometry.layered.cube_array.64_64_12.secondary_cmd_buffer_inherit_framebuffer

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9386>

3 years agoRevert "radv: stop using VM_ALWAYS_VALID on APUs"
Samuel Pitoiset [Mon, 1 Mar 2021 16:21:04 +0000 (16:21 +0000)]
Revert "radv: stop using VM_ALWAYS_VALID on APUs"

Disabling VM_ALWAYS_VALID actually hurts more than it helps
after doing more testing. Managing the global BO list in userspace
is really costly and make a bunch of games CPU bound.

I think re-enabling VM_ALWAYS_VALID is a step in the right direction.

This reverts commit 6ac6e2fbfb47e737f2f823fec2931d80769acc33.

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

3 years agor600/sfn: lower intrinsic_load_tess_coord to driver version
Gert Wollny [Tue, 2 Mar 2021 19:23:59 +0000 (20:23 +0100)]
r600/sfn: lower intrinsic_load_tess_coord to driver version

Fixes
  KHR-GL45.tessellation_shader.tessellation_shader_tessellation.TCS_TES
  KHR-GL45.tessellation_shader.tessellation_shader_tessellation.TES

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

3 years agonir: Add r600 specific intrinsic for loading the tesselation coords
Gert Wollny [Tue, 2 Mar 2021 19:21:53 +0000 (20:21 +0100)]
nir: Add r600 specific intrinsic for loading the tesselation coords

Only the XY pair is provided directly, the Z value has to be deducted
from the primitive type.

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

3 years agovirgl: add astc 2d compressed formats
cheyang [Fri, 26 Feb 2021 09:47:27 +0000 (17:47 +0800)]
virgl: add astc 2d compressed formats

Signed-off-by: cheyang <cheyang@bytedance.com>
Signed-off-by: hexin <hexin.op@bytedance.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9306>

3 years agobroadcom/compiler: be more aggressive skipping unifa writes
Iago Toral Quiroga [Tue, 2 Mar 2021 12:05:09 +0000 (13:05 +0100)]
broadcom/compiler: be more aggressive skipping unifa writes

We had an optimization in place to skip a unifa write if the address
happens to be right after the last ldunifa read address, but we can
take this further and update the unifa address by emitting ldunifa
instructions if needed to skip a unifa write that is close enough.
This is because a unifa write involves 4 cycles: 1 for the write
and 3 delay slots before we can emit the first ldunifa.

So if we have code like this:

unifa addr + 0
ldunifa.r0
unifa addr + 12
ldunifa.r1

In practice we end up with QPU like this:

unifa addr + 0
nop
nop
nop
ldunifa.r0
unifa addr + 12
nop
nop
nop
ldunifa.r1

And with this patch we get:

unifa addr + 0
nop
nop
nop
ldunifa.r0  <--- reads offset 0
ldunifa.-   <--- reads offset 4
ldunifa.-   <--- reads offset 8
ldunifa.r1  <--- reads offset 12

Of course, QPU scheduling might find ways to fill the NOPs to some
extent and remove some of the gains, but generally speaking, this is
still usually a win.

Going by shader-db results, allowing the next unifa address to be up
to 12 bytes after the address resulting from the last ldunifa read
shows the best results:

total instructions in shared programs: 13817048 -> 13812202 (-0.04%)
instructions in affected programs: 602701 -> 597855 (-0.80%)
helped: 1750
HURT: 760
Instructions are helped.

total uniforms in shared programs: 3795485 -> 3793200 (-0.06%)
uniforms in affected programs: 43930 -> 41645 (-5.20%)
helped: 898
HURT: 0
Uniforms are helped.

total max-temps in shared programs: 2326612 -> 2326621 (<.01%)
max-temps in affected programs: 651 -> 660 (1.38%)
helped: 10
HURT: 21
Inconclusive result (value mean confidence interval includes 0).

total sfu-stalls in shared programs: 30942 -> 30906 (-0.12%)
sfu-stalls in affected programs: 627 -> 591 (-5.74%)
helped: 186
HURT: 158
Inconclusive result (value mean confidence interval includes 0).

total inst-and-stalls in shared programs: 13847990 -> 13843108 (-0.04%)
inst-and-stalls in affected programs: 601404 -> 596522 (-0.81%)
helped: 1747
HURT: 757
Inst-and-stalls are helped.

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

3 years agobroadcom/compiler: drop the destination for unused ldunifa
Iago Toral Quiroga [Tue, 2 Mar 2021 14:37:30 +0000 (15:37 +0100)]
broadcom/compiler: drop the destination for unused ldunifa

We can't remove unused ldunifa that are not the first or last
in a sequence, but we can still ignore their destination
to reduce register pressure.

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

3 years agoutil/disk_cache: make MESA_DISK_CACHE_READ_ONLY_FOZ_DBS a relative path
Timothy Arceri [Thu, 25 Feb 2021 10:15:22 +0000 (21:15 +1100)]
util/disk_cache: make MESA_DISK_CACHE_READ_ONLY_FOZ_DBS a relative path

Rather than passing in full paths this changes things so that we can
just pass in filenames relative to the current cache directory.

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

3 years agoci/turnip: Mark a flaky WSI test.
Eric Anholt [Wed, 3 Mar 2021 21:51:12 +0000 (13:51 -0800)]
ci/turnip: Mark a flaky WSI test.

This one has flaked many times at this point, and I've even seen it flake
locally.  No luck debugging it yet.

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

3 years agofreedreno: Remove dead-cells MBR workaround
Rob Clark [Wed, 3 Mar 2021 19:49:06 +0000 (11:49 -0800)]
freedreno: Remove dead-cells MBR workaround

With threaded-context we won't have a chance to apply the workaround in
the backend driver.  But the previous commit moves it to a driconf
configured workaround in mesa/st, so we can drop this now.

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

3 years agodriconf: Add ignore_map_unsynchronized option
Rob Clark [Sun, 21 Feb 2021 18:36:50 +0000 (10:36 -0800)]
driconf: Add ignore_map_unsynchronized option

Add an option to workaround incorrect unsynchronized VBO updates in
Dead-Cells.

See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4337
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9316>

3 years agozink: rewrite macro for getting KHR device functions
Mike Blumenkrantz [Wed, 3 Mar 2021 21:44:09 +0000 (16:44 -0500)]
zink: rewrite macro for getting KHR device functions

we have the technology. we can improve our our lives with better macros.

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

3 years agofreedreno/a6xx: Fix compile warning
Rob Clark [Wed, 3 Mar 2021 19:05:52 +0000 (11:05 -0800)]
freedreno/a6xx: Fix compile warning

Fixes: 79921b81bcf ("freedreno/a6xx: Document threadsize-related fields")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9394>

3 years agofreedreno: Deduplicate fixup_shader_state()
Rob Clark [Wed, 3 Mar 2021 18:51:55 +0000 (10:51 -0800)]
freedreno: Deduplicate fixup_shader_state()

All the ir3 gens had the same thing, time to move it out into a shared
helper.

The keeping the storage in fdN_context is to avoid namespace clashes
between ir3 and ir2.

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

3 years agofreedreno/ir3: Add comments about shader key/gen
Rob Clark [Wed, 3 Mar 2021 18:24:17 +0000 (10:24 -0800)]
freedreno/ir3: Add comments about shader key/gen

I had forgotton on which gens these where used on (which is important if
you need to know which shader stages use these).. expand the comments a
bit.

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

3 years agoclover: fix array images view creation
Dave Airlie [Wed, 3 Mar 2021 02:44:46 +0000 (12:44 +1000)]
clover: fix array images view creation

Found this on top of Karol's patches but it seems like it can just be
applied to master.

Helps with some cases of
kernel_image_methods/test_kernel_image_methods 2Darray

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9381>

3 years agoci/zink: Add another primitive restart flake.
Eric Anholt [Wed, 3 Mar 2021 21:08:26 +0000 (13:08 -0800)]
ci/zink: Add another primitive restart flake.

This one flaked all the way to a run failure in a recent MR of mine.

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

3 years agoci/a5xx: Update piglit expectations.
Eric Anholt [Fri, 26 Feb 2021 21:47:12 +0000 (13:47 -0800)]
ci/a5xx: Update piglit expectations.

The mesa/st shader variants change fixed some fails for us.

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

3 years agoci/a5xx: Increase the gles3/31 coverage.
Eric Anholt [Fri, 26 Feb 2021 20:26:08 +0000 (12:26 -0800)]
ci/a5xx: Increase the gles3/31 coverage.

Now that there's more time available in our budget per board, we can run
all of gles31, and half of gles3, instead of 10%.

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

3 years agoci/a3xx: Run all of GLES3 dEQP.
Eric Anholt [Fri, 26 Feb 2021 20:55:49 +0000 (12:55 -0800)]
ci/a3xx: Run all of GLES3 dEQP.

We're not spending half our time booting any more, so run the other half.

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

3 years agoci/a5xx: Run all of gles2 in one job.
Eric Anholt [Fri, 26 Feb 2021 20:24:50 +0000 (12:24 -0800)]
ci/a5xx: Run all of gles2 in one job.

Now that we're not spending so much time on boot overhead, no need to
parallelize.

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

3 years agoci/freedreno: Switch the fastboot boards to using nfsroot.
Eric Anholt [Fri, 26 Feb 2021 18:24:31 +0000 (10:24 -0800)]
ci/freedreno: Switch the fastboot boards to using nfsroot.

This saves time in packing the rootfs, allows for larger rootfses, and
avoids the need for webdav.

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

3 years agoci/freedreno: Also retest when only CI configuration changes.
Eric Anholt [Fri, 26 Feb 2021 20:47:44 +0000 (12:47 -0800)]
ci/freedreno: Also retest when only CI configuration changes.

Fixes: dab845d457eb ("ci: Move specific driver testing to separate files in separate dirs.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9314>

3 years agotgsi_exec: Jump over entirely non-taken THEN or ELSE branches.
Eric Anholt [Mon, 1 Mar 2021 20:23:56 +0000 (12:23 -0800)]
tgsi_exec: Jump over entirely non-taken THEN or ELSE branches.

TGSI has these nice labels for us for where to jump in this case, let's
use them.  Improves piglit arb_shader_image_load_store-shader-mem-barrier
runtime massively, though not enough to make the test really reasonable to
run.

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

3 years agotgsi_exec: Roll the loops for condmask handling.
Eric Anholt [Mon, 1 Mar 2021 20:19:48 +0000 (12:19 -0800)]
tgsi_exec: Roll the loops for condmask handling.

No need to hand-unroll this, the compiler will do it.

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

3 years agoi965: support GL_EXT_color_buffer_half_float
Ilia Mirkin [Tue, 2 Mar 2021 21:05:59 +0000 (16:05 -0500)]
i965: support GL_EXT_color_buffer_half_float

FP16 rendering is supported on all gen4 hardware.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9379>

3 years agoci: Use lock file to build deqp-runner
Antonio Caggiano [Tue, 2 Mar 2021 15:01:05 +0000 (16:01 +0100)]
ci: Use lock file to build deqp-runner

Build deqp-runner with the `--locked` option to use dependencies
versions specified in `Cargo.lock`.

v2: Bump image tags.

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Suggested-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9368>

3 years agoac/llvm: open code fpow on LLVM 12 using fmul.legacy
Marek Olšák [Fri, 12 Feb 2021 06:06:18 +0000 (01:06 -0500)]
ac/llvm: open code fpow on LLVM 12 using fmul.legacy

A quick look at the asm shows that this enables source modifiers
(neg, abs) for v_mul_legacy_f32.

Totals from affected shaders:
SGPRS: 110104 -> 110400 (0.27 %)
VGPRS: 57632 -> 57636 (0.01 %)
Spilled SGPRs: 66 -> 63 (-4.55 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 3290412 -> 3283068 (-0.22 %) bytes
Max Waves: 32141 -> 32141 (0.00 %)

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

3 years agoac/llvm: add type parameter into ac_build_buffer_load to fix 16-bit TES inputs
Marek Olšák [Mon, 15 Feb 2021 06:25:25 +0000 (01:25 -0500)]
ac/llvm: add type parameter into ac_build_buffer_load to fix 16-bit TES inputs

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

3 years agoac/llvm: fix visit_load_ubo_buffer to use SMEM for 16 bits instead of VMEM
Marek Olšák [Fri, 12 Feb 2021 08:54:19 +0000 (03:54 -0500)]
ac/llvm: fix visit_load_ubo_buffer to use SMEM for 16 bits instead of VMEM

This has 3 advantages:
- It's SMEM.
- Multiple single component loads are merged into 1 multi-dword load by LLVM.
- The result is always packed for packed instructions.

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

3 years agoac/llvm: implement 16-bit and 64-bit fpow correctly
Marek Olšák [Fri, 12 Feb 2021 06:05:19 +0000 (01:05 -0500)]
ac/llvm: implement 16-bit and 64-bit fpow correctly

LLVM converts to 32 bits and back for llvm.pow, so we can't use it.

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

3 years agoac/llvm: add support for 16-bit source operands for samplers
Marek Olšák [Thu, 11 Feb 2021 08:22:00 +0000 (03:22 -0500)]
ac/llvm: add support for 16-bit source operands for samplers

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

3 years agonir/search: Constify instruction parameter to search helpers
Ian Romanick [Tue, 12 May 2020 19:48:17 +0000 (12:48 -0700)]
nir/search: Constify instruction parameter to search helpers

The search helps must *never* modify the instruction passed in, so let
the compiler enforce this.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9378>

3 years agoanv: fix missing general state pool in validation list
Lionel Landwerlin [Wed, 3 Mar 2021 13:21:55 +0000 (15:21 +0200)]
anv: fix missing general state pool in validation list

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 83fee30e85965c ("anv: allow multiple command buffers in anv_queue_submit")
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9388>

3 years agoci/lava: Move the driver expectation files to the per-driver CI dir.
Eric Anholt [Mon, 1 Mar 2021 20:53:37 +0000 (12:53 -0800)]
ci/lava: Move the driver expectation files to the per-driver CI dir.

This will cause less retesting of other drivers when changing the dEQP
results for a driver.

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

3 years agoci/lava: Move the per-driver gitlab-ci.yml to each driver.
Eric Anholt [Mon, 1 Mar 2021 20:50:51 +0000 (12:50 -0800)]
ci/lava: Move the per-driver gitlab-ci.yml to each driver.

Follow-up to !9139, will cause less testing of other drivers when changing
the CI configuration for a single driver.

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

3 years agoci: Move deqp-default-skips.txt back to .gitlab-ci/
Eric Anholt [Mon, 1 Mar 2021 20:57:30 +0000 (12:57 -0800)]
ci: Move deqp-default-skips.txt back to .gitlab-ci/

Since we don't manually enumerate the drivers using it, we have to retest
all drivers when changing it (which basically never happens, anyway).

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

3 years agoradv: fix RGP barrier layout transition for TC-compatible CMASK images
Samuel Pitoiset [Wed, 3 Mar 2021 16:11:15 +0000 (17:11 +0100)]
radv: fix RGP barrier layout transition for TC-compatible CMASK images

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

3 years agozink: Enable GL_EXT_depth_bounds_test
Adam Jackson [Tue, 2 Mar 2021 17:28:04 +0000 (12:28 -0500)]
zink: Enable GL_EXT_depth_bounds_test

Available since Vulkan 1.0, and in fact already wired up, just not
advertised. It looks like we could make this dynamic state but this
works for now.

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

3 years agoradv: don't shrink image stores for The Surge 2
Rhys Perry [Tue, 23 Feb 2021 19:33:02 +0000 (19:33 +0000)]
radv: don't shrink image stores for The Surge 2

The game seems to declare the wrong format.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: e4d75c22 ("nir/opt_shrink_vectors: shrink image stores using the format")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4347
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9229>

3 years agonir/opt_shrink_vectors: add option to skip shrinking image stores
Rhys Perry [Tue, 23 Feb 2021 19:31:48 +0000 (19:31 +0000)]
nir/opt_shrink_vectors: add option to skip shrinking image stores

Some games declare the wrong format, so we might want to disable this
optimization in that case.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: e4d75c22 ("nir/opt_shrink_vectors: shrink image stores using the format")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9229>

3 years agoturnip: fix leak of tu_shader object during compute pipeline creation
Danylo Piliaiev [Tue, 2 Mar 2021 10:00:58 +0000 (12:00 +0200)]
turnip: fix leak of tu_shader object during compute pipeline creation

tu_shader should be freed after pipeline is successfully created.

Fixes tests:
 dEQP-VK.api.object_management.alloc_callback_fail.compute_pipeline
 dEQP-VK.api.object_management.alloc_callback_fail_multiple.compute_pipeline

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9364>

3 years agoradv: bump the initial SQTT buffer size to 32MB per SE
Samuel Pitoiset [Tue, 2 Mar 2021 14:33:36 +0000 (15:33 +0100)]
radv: bump the initial SQTT buffer size to 32MB per SE

Most of the games need 32MB or more, but rarely less.

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

3 years agoradv: trigger a new SQTT capture automatically after resizing the buffer
Samuel Pitoiset [Tue, 2 Mar 2021 14:29:25 +0000 (15:29 +0100)]
radv: trigger a new SQTT capture automatically after resizing the buffer

It's way better.

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

3 years agoradv: double the SQTT buffer size when it is resized
Samuel Pitoiset [Tue, 2 Mar 2021 14:14:50 +0000 (15:14 +0100)]
radv: double the SQTT buffer size when it is resized

Computing the expected buffer size isn't reliable on GFX10+ because
DROPPED_CNTR returns weird results.

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

3 years agoac/sqtt: fix determining if the trace is complete on GFX10+
Samuel Pitoiset [Tue, 2 Mar 2021 14:13:24 +0000 (15:13 +0100)]
ac/sqtt: fix determining if the trace is complete on GFX10+

DROPPED_CNTR isn't reliable and might still report non-zero if the
SQTT buffer isn't full. Checking if the number of written bytes by
the hw is equal to the SQTT buffer size seems reliable.

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

3 years agoradv: do not trace inactive shader engines with SQTT
Samuel Pitoiset [Tue, 2 Mar 2021 15:42:39 +0000 (16:42 +0100)]
radv: do not trace inactive shader engines with SQTT

This fixes a GPU hang on my Sienna because the number of SE is
less than the maximum, and SE #1 is disabled.

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

3 years agozink: ci updates
Mike Blumenkrantz [Wed, 3 Mar 2021 01:21:00 +0000 (20:21 -0500)]
zink: ci updates

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

3 years agozink: use staging resource for write transfer_map in order to not stall
Mike Blumenkrantz [Wed, 9 Sep 2020 20:08:54 +0000 (16:08 -0400)]
zink: use staging resource for write transfer_map in order to not stall

we can just give the user a staging resource and then flush the data back
later

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

3 years agoradeonsi: don't crash on NULL images in si_check_needs_implicit_sync
Marek Olšák [Tue, 2 Mar 2021 07:33:36 +0000 (02:33 -0500)]
radeonsi: don't crash on NULL images in si_check_needs_implicit_sync

This fixes CTS test: KHR-GL46.arrays_of_arrays_gl.AtomicUsage

Fixes: bddc0e023c "radeonsi: fix read from compute / write from draw sync"

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9361>

3 years agoac/llvm: fix ac_build_atomic_rmw with LLVM 13
Marek Olšák [Tue, 2 Mar 2021 07:59:23 +0000 (02:59 -0500)]
ac/llvm: fix ac_build_atomic_rmw with LLVM 13

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

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9361>

3 years agonir/vec_to_movs: Don't generate MOVs for undef channels.
Eric Anholt [Mon, 1 Mar 2021 19:57:19 +0000 (11:57 -0800)]
nir/vec_to_movs: Don't generate MOVs for undef channels.

This appeared in softpipe's image operations, since NIR always uses
4-component values for the coords, while the GLSL IR only has 2 components
for a 2D image (for example).
arb_shader_image_load_store-shader-mem-barrier (which times out in CI and
spends its time inside of tgsi_exec) was spending 4/51 of its instructions
on moving these undefs around.

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

3 years agonir: Add a nir_src_is_undef() helper, like nir_src_is_const().
Eric Anholt [Mon, 1 Mar 2021 23:04:25 +0000 (15:04 -0800)]
nir: Add a nir_src_is_undef() helper, like nir_src_is_const().

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

3 years agozink: export PIPE_CAP_TGSI_VS_LAYER_VIEWPORT
Mike Blumenkrantz [Mon, 14 Dec 2020 16:41:26 +0000 (11:41 -0500)]
zink: export PIPE_CAP_TGSI_VS_LAYER_VIEWPORT

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

3 years agozink: enable PIPE_CAP_CLEAR_SCISSORED
Mike Blumenkrantz [Wed, 14 Oct 2020 13:10:17 +0000 (09:10 -0400)]
zink: enable PIPE_CAP_CLEAR_SCISSORED

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

3 years agolavapipe: sort bindings before creating descriptor set
Dave Airlie [Tue, 2 Mar 2021 20:50:00 +0000 (06:50 +1000)]
lavapipe: sort bindings before creating descriptor set

This ensures the dynamic offsets are correct

Fixes: b38879f8c5f5 ("vallium: initial import of the vulkan frontend")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9359>

3 years agolavapipe: reorder descriptor set stages to get correct binding
Dave Airlie [Tue, 2 Mar 2021 04:30:30 +0000 (14:30 +1000)]
lavapipe: reorder descriptor set stages to get correct binding

The fragment stage was in the wrong place here.

Fixes: b38879f8c5f5 ("vallium: initial import of the vulkan frontend")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9359>

3 years agogallium/dri: Remove dri2_format_mapping::cpp
Ian Romanick [Mon, 1 Mar 2021 23:11:31 +0000 (15:11 -0800)]
gallium/dri: Remove dri2_format_mapping::cpp

I was suspicious that some entries in dri2_format_table (in
dri_helpers.c) had this field set incorrectly.  It seemed like
DRM_FORMAT_ABGR16161616F and DRM_FORMAT_XBGR16161616F should have been 8
instead of 4.  Upon digging I found that nothing uses the field.  Fix
code by removing it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9354>

3 years agoclover: Add missing include for llvm-12 build fix
Karol Herbst [Tue, 2 Mar 2021 19:09:39 +0000 (20:09 +0100)]
clover: Add missing include for llvm-12 build fix

Fixes: d1eab2b1eb1 ("clover: Fix build with llvm-12.")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9372>

3 years agozink: apply only the pending zs clear bits during deferred clears
Mike Blumenkrantz [Tue, 2 Mar 2021 14:22:18 +0000 (09:22 -0500)]
zink: apply only the pending zs clear bits during deferred clears

both bits will have been flagged at this point in order to indicate
that the aspects will be cleared "at some point" during the loop, but
when actually iterating through the pending clears, only the bits set
in the clear call should be applied

Fixes: 5c629e9ff24 ("zink: defer pipe_context::clear calls when not currently in a renderpass")

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

3 years agost/nine: Simplify checks for driconf options
Axel Davy [Sun, 7 Feb 2021 19:28:34 +0000 (20:28 +0100)]
st/nine: Simplify checks for driconf options

Remove the useless driCheckOption calls. They always
succeed.

As a result the intended behaviour for thread_submit
was not working (different default depending on the gpu
used). Add a comment to fix that in the future.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agodriconf: Rename csmt_int back to csmt_force
Axel Davy [Sun, 7 Feb 2021 19:01:57 +0000 (20:01 +0100)]
driconf: Rename csmt_int back to csmt_force

Fixes regression introduced by
<https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6916>

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agost/nine: Fix leak at device destruction
Axel Davy [Mon, 8 Feb 2021 22:33:29 +0000 (23:33 +0100)]
st/nine: Fix leak at device destruction

At the release of the last object holding a reference
on the device, the device dtor was executed and
the objector dtor was ignored.

The proper way is to execute the object dtor, then
the device dtor.

The previous code was likely for a workaround against
something that was fixed since.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agost/nine: Protect *PrivateData also for Volumes
Axel Davy [Wed, 3 Feb 2021 22:12:12 +0000 (23:12 +0100)]
st/nine: Protect *PrivateData also for Volumes

*PrivateData functions were not protected by
a mutex for Volumes whereas they definitely
should.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agost/nine: Refactor ht_guid_delete
Axel Davy [Sun, 31 Jan 2021 19:04:40 +0000 (20:04 +0100)]
st/nine: Refactor ht_guid_delete

Have ht_guid_delete take a hash_entry.

As a result, we can use _mesa_hash_table_remove instead of
_mesa_hash_table_remove_key.
The previous code using the latter was incorrect as the key
of the entry was read after it was freed.

Fixes: https://github.com/iXit/wine-nine-standalone/issues/40

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agost/nine: Add new debug and error checks
Axel Davy [Thu, 21 May 2020 14:55:19 +0000 (16:55 +0200)]
st/nine: Add new debug and error checks

Add new debug messages and error checks

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agost/nine: Enable DF24 support
Axel Davy [Sat, 26 Jan 2019 20:24:05 +0000 (21:24 +0100)]
st/nine: Enable DF24 support

We can enable it, now that FETCH4 is
implemented.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agost/nine: Implement experimental FETCH4
Axel Davy [Sun, 13 Jan 2019 21:44:51 +0000 (22:44 +0100)]
st/nine: Implement experimental FETCH4

FETCH4 is a feature that needs to be implemented
to advertise D3DFMT_DF24.
It's basically a variant of Gather4.

This first implementation will need to be completed
to implement the feature fully, but the feature
doesn't seem to be much used (other equivalent
features are preferred by games).

Note until DF24 is advertised, apps are not supposed to use
FETCH4.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agost/nine: Track formats compatible with FETCH4
Axel Davy [Sat, 2 Feb 2019 18:20:35 +0000 (19:20 +0100)]
st/nine: Track formats compatible with FETCH4

FETCH4 is a d3d9 extension not much used, as newer
ones were prefered. However it's support is required
to advertise the DF24 format.

Prepares support by tracking compatible formats.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agost/nine: Unmap buffers after full unlock
Axel Davy [Sun, 20 Dec 2020 18:37:13 +0000 (19:37 +0100)]
st/nine: Unmap buffers after full unlock

Do not unmap anything until all buffer unlocks
were received.

A buffer can be filled in several threads, and thus
in the case of double locks, it's not possible to know
which unlock is received first.
Thus only unmap the buffers when the last unlock is
received.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agost/nine: Clamp GetAvailableTextureMem
Axel Davy [Sun, 17 Jan 2021 17:20:03 +0000 (18:20 +0100)]
st/nine: Clamp GetAvailableTextureMem

Previously we used to clamp "available_texture_limit",
which was incorrect. "available_texture_mem" should
have been clamped instead.
The resulting code was noop.

The idea behind that code was that 32 bits executable
would see maximum 4GB video memory.

However it seems according to users that 32 bits apps
should be able to allocate more than 4GB, thus the
clamping is inappropriate.

Instead clamp the return of GetAvailableTextureMem, to
correctly report a high value when there is more than
4GB available.

I do not know what should exactly be the clamp value,
for now have a 64MB margin below UINT_MAX.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agost/nine: Do not allow depth buffer render targets
Axel Davy [Tue, 4 Aug 2020 20:09:56 +0000 (22:09 +0200)]
st/nine: Do not allow depth buffer render targets

Without the proposed check, some apps will decide to use depth buffers
as render targets.

Bug found investigating:
https://github.com/iXit/wine-nine-standalone/issues/82

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agost/nine: Reduce system memory allocated by D3DUSAGE_AUTOGENMIPMAP
Axel Davy [Thu, 21 May 2020 15:51:55 +0000 (17:51 +0200)]
st/nine: Reduce system memory allocated by D3DUSAGE_AUTOGENMIPMAP

For D3DUSAGE_AUTOGENMIPMAP basically, everything behaves
for the application as if the texture had one level.
However the pipe_resource has more levels, and those
get generated automatically.

Previously we did allocate all the Surfaces as if
the texture had all the levels, except of just one.
The app could still just access the first level.

This patch completly removes the useless unaccessible
Surfaces.
In addition removes redundant handling of D3DUSAGE_AUTOGENMIPMAP.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>

3 years agor600/sfn: Update status
Gert Wollny [Fri, 26 Feb 2021 21:15:15 +0000 (22:15 +0100)]
r600/sfn: Update status

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

3 years agor600: Enable GLSL 450 for nir shaders.
Gert Wollny [Fri, 26 Feb 2021 15:15:31 +0000 (16:15 +0100)]
r600: Enable GLSL 450 for nir shaders.

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

3 years agor600: Don't optimize using source modifiers on literals
Gert Wollny [Sun, 28 Feb 2021 21:52:58 +0000 (22:52 +0100)]
r600: Don't optimize using source modifiers on literals

The code improvement is limited and it interferes with using literals
directly in LDS index ops, since here source modifiers are not
supported, but the current assembler code might inject the modifiers.

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

3 years agor600/sfn: Fix loading TES gl_PatchVerticesIn
Gert Wollny [Sun, 28 Feb 2021 20:41:28 +0000 (21:41 +0100)]
r600/sfn: Fix loading TES gl_PatchVerticesIn

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

3 years agor600/sfn: handle querying the number of layers in cube arrays
Gert Wollny [Sun, 28 Feb 2021 19:15:56 +0000 (20:15 +0100)]
r600/sfn: handle querying the number of layers in cube arrays

This has to be loaded from a constant buffer instead of the actual
texture.

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

3 years agonir: disaallow reordering for r600 shared load and remove component field
Gert Wollny [Sun, 28 Feb 2021 18:03:55 +0000 (19:03 +0100)]
nir: disaallow reordering for r600 shared load and remove component field

The original shared load op can't be reordered, so it might be better to
also not allow this for the lowered variant.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9330>

3 years agor600/sfn: encode component in address for local IO
Gert Wollny [Sun, 28 Feb 2021 18:02:08 +0000 (19:02 +0100)]
r600/sfn: encode component in address for local IO

The backend code was actually assuming this, but the lowering still set
the components and write masks like it would be honoured.

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

3 years agor600/sfn: remove some old debug output
Gert Wollny [Fri, 26 Feb 2021 20:24:18 +0000 (21:24 +0100)]
r600/sfn: remove some old debug output

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

3 years agor600/sfn: remove unused emit_alu_op2_split_src_mods
Gert Wollny [Fri, 26 Feb 2021 20:24:01 +0000 (21:24 +0100)]
r600/sfn: remove unused emit_alu_op2_split_src_mods

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

3 years agor600/sfn: remove code for nir_op_fsign since it is lowered
Gert Wollny [Fri, 26 Feb 2021 20:23:39 +0000 (21:23 +0100)]
r600/sfn: remove code for nir_op_fsign since it is lowered

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

3 years agor600: unify nir shader options evaluation
Gert Wollny [Fri, 26 Feb 2021 20:11:44 +0000 (21:11 +0100)]
r600: unify nir shader options evaluation

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