platform/upstream/mesa.git
4 years agoanv: drop likely/unlikely around INTEL_DEBUG
Marcin Ślusarz [Mon, 14 Sep 2020 16:53:13 +0000 (18:53 +0200)]
anv: drop likely/unlikely around INTEL_DEBUG

It's included in declaration of INTEL_DEBUG.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6732>

4 years agoi965: drop likely/unlikely around INTEL_DEBUG
Marcin Ślusarz [Mon, 14 Sep 2020 16:52:02 +0000 (18:52 +0200)]
i965: drop likely/unlikely around INTEL_DEBUG

It's included in declaration of INTEL_DEBUG.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6732>

4 years agoiris: drop likely/unlikely around INTEL_DEBUG
Marcin Ślusarz [Mon, 14 Sep 2020 16:49:43 +0000 (18:49 +0200)]
iris: drop likely/unlikely around INTEL_DEBUG

It's included in declaration of INTEL_DEBUG.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6732>

4 years agointel: add INTEL_DEBUG expected value in declaration
Marcin Ślusarz [Mon, 14 Sep 2020 16:43:50 +0000 (18:43 +0200)]
intel: add INTEL_DEBUG expected value in declaration

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6732>

4 years agoanv: Add driconf option to disable compression for 16bpp format
Sagar Ghuge [Mon, 14 Sep 2020 22:52:11 +0000 (15:52 -0700)]
anv: Add driconf option to disable compression for 16bpp format

On Fallout4, enabling HIZ_CCS_WT compression for D16_UNORM format
regress the performance by 2%, in order to avoid that disable
compression via driconf option.

The experiment showed that, running Fallout4 with HIZ performs better
than HIZ_CCS and HIZ_CCS_WT. Reason behind that is the benchmark uses
the depth pass with D16_UNORM surfaces format which fills the L3 cache
and next pass doesn't make use of it where we end up clearing cache.

v2:
- Don't add conditional check in isl (Nanley, Jason)
- Move disable_d16unorm_compression flag to instance (Lionel)
- Use plane_format.isl_format (Nanley)

v3:
- Add more descriptive comment (Marcin Ślusarz)

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6734>

4 years agoanv: Factor out dri option initialization code in separate function
Sagar Ghuge [Mon, 14 Sep 2020 19:21:41 +0000 (12:21 -0700)]
anv: Factor out dri option initialization code in separate function

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6734>

4 years agoclover/nir: extract constant buffer into its own section
Karol Herbst [Wed, 2 Sep 2020 18:45:26 +0000 (20:45 +0200)]
clover/nir: extract constant buffer into its own section

Fixes test_basic constant_source

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

4 years agoclover: bind constant buffer if one is provided
Karol Herbst [Wed, 2 Sep 2020 18:36:41 +0000 (20:36 +0200)]
clover: bind constant buffer if one is provided

We will use that with NIR as it is easier to manage the constant buffer
inside clover instead of letting all drivers to deal with it.

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

4 years agoclover/util: add id_type_equals to support symbols with multiple sections
Karol Herbst [Wed, 2 Sep 2020 18:35:35 +0000 (20:35 +0200)]
clover/util: add id_type_equals to support symbols with multiple sections

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

4 years agodriconf: Restore the ability to override driconf with the environment.
Eric Anholt [Mon, 5 Oct 2020 17:18:49 +0000 (10:18 -0700)]
driconf: Restore the ability to override driconf with the environment.

I distinctly remember testing this during development, yet clearly deleted
the code.

I pulled the parseValue code back up to the top where it used to be since
we have to use it, rather than just adding a prototype.

Fixes: 8a05d6ffc65d ("driconf: Make the driver's declarations be structs instead of XML.")
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7012>

4 years agodriconf: Make sure that the range check on the defaults actually works.
Eric Anholt [Mon, 5 Oct 2020 17:33:28 +0000 (10:33 -0700)]
driconf: Make sure that the range check on the defaults actually works.

Fixes: 8a05d6ffc65d ("driconf: Make the driver's declarations be structs instead of XML.")
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7012>

4 years agoCI: Re-enable Panfrost T7xx CI
Daniel Stone [Tue, 6 Oct 2020 15:49:10 +0000 (16:49 +0100)]
CI: Re-enable Panfrost T7xx CI

Lab maintenance is done now.

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

4 years agogallium/u_threaded_context: fix use-after-free in transfer_unmap
Marek Olšák [Mon, 5 Oct 2020 16:02:19 +0000 (12:02 -0400)]
gallium/u_threaded_context: fix use-after-free in transfer_unmap

discovered by valgrind

Fixes: fd6a5e112aa

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

4 years agogallium/u_threaded_context: always flush asynchronously if requested
Marek Olšák [Sat, 3 Oct 2020 08:12:47 +0000 (04:12 -0400)]
gallium/u_threaded_context: always flush asynchronously if requested

This can reduce overhead depending on whether st/mesa uses the ASYNC flag
and the app flushes often.

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

4 years agogallium/u_threaded_context: don't call memcpy in tc_set_constant_buffer
Marek Olšák [Mon, 28 Sep 2020 14:33:06 +0000 (10:33 -0400)]
gallium/u_threaded_context: don't call memcpy in tc_set_constant_buffer

In sysprof, the CPU time spend in tc_set_constant_buffer drops
from 7% to 1.4% in a release build. It doesn't make sense to me.

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

4 years agoradeonsi: implement GL_INTEL_blackhole_render
Marek Olšák [Mon, 21 Sep 2020 06:05:49 +0000 (02:05 -0400)]
radeonsi: implement GL_INTEL_blackhole_render

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

4 years agoradeonsi: remove dead variable postponed_kill
Marek Olšák [Sat, 19 Sep 2020 22:35:42 +0000 (18:35 -0400)]
radeonsi: remove dead variable postponed_kill

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

4 years agogallium/util: add set_frontend_noop into driver_noop and u_threaded_context
Marek Olšák [Mon, 21 Sep 2020 06:22:25 +0000 (02:22 -0400)]
gallium/util: add set_frontend_noop into driver_noop and u_threaded_context

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

4 years agoutil/idalloc: resize if ID is too large for reservation
Marek Olšák [Wed, 30 Sep 2020 17:44:52 +0000 (13:44 -0400)]
util/idalloc: resize if ID is too large for reservation

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7031>

4 years agost/mesa: enable GL name reuse for queries based on the driconf option
Marek Olšák [Fri, 25 Sep 2020 19:15:53 +0000 (15:15 -0400)]
st/mesa: enable GL name reuse for queries based on the driconf option

Fixes: a56849ddda6

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

4 years agodriconf: enable force_glsl_extensions_warn for viewperf
Marek Olšák [Sat, 26 Sep 2020 11:50:07 +0000 (07:50 -0400)]
driconf: enable force_glsl_extensions_warn for viewperf

Discovered by Pierre-Eric Pelloux-Prayer.

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

4 years agodriconf: force the vendor string to NVIDIA to fix viewperf energy tests
Marek Olšák [Sat, 26 Sep 2020 01:06:16 +0000 (21:06 -0400)]
driconf: force the vendor string to NVIDIA to fix viewperf energy tests

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

4 years agogl_marshal.py: inline print_sync_dispatch
Marek Olšák [Sat, 26 Sep 2020 00:20:19 +0000 (20:20 -0400)]
gl_marshal.py: inline print_sync_dispatch

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7031>

4 years agomesa: factor out layout parsing for glInterleavedArrays
Marek Olšák [Sat, 26 Sep 2020 00:02:14 +0000 (20:02 -0400)]
mesa: factor out layout parsing for glInterleavedArrays

glthread will use it.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7031>

4 years agonir/constant_folding: Fold load_deref of nir_var_mem_constant
Jason Ekstrand [Thu, 3 Sep 2020 19:14:03 +0000 (14:14 -0500)]
nir/constant_folding: Fold load_deref of nir_var_mem_constant

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

4 years agonir: Validate constant initializers
Jason Ekstrand [Fri, 2 Oct 2020 07:14:36 +0000 (02:14 -0500)]
nir: Validate constant initializers

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

4 years agonir/constant_folding: Use nir_shader_instruction_pass
Jason Ekstrand [Thu, 1 Oct 2020 23:29:08 +0000 (18:29 -0500)]
nir/constant_folding: Use nir_shader_instruction_pass

This gets rid of so much boilerplate...

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

4 years agonir/constant_folding: Use the builder
Jason Ekstrand [Thu, 1 Oct 2020 23:25:37 +0000 (18:25 -0500)]
nir/constant_folding: Use the builder

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

4 years agoradv: remove VkPipelineCacheCreateInfo::flags assert
Mike Blumenkrantz [Tue, 6 Oct 2020 14:14:33 +0000 (10:14 -0400)]
radv: remove VkPipelineCacheCreateInfo::flags assert

flags are handled, so this just crashes for no reason

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

4 years agoiris: Fix a fast-clear skipping optimization
Nanley Chery [Tue, 29 Sep 2020 12:49:54 +0000 (05:49 -0700)]
iris: Fix a fast-clear skipping optimization

When support for multi-slice fast-clears was introduced for color
surfaces, an existing optimization for skipping fast-clears was not
updated (this optimization assumed single-slice fast-clears). As a
result, the driver began to skip multi-layer fast-clears if just the
first slice was in the CLEAR state (ignoring the state of the others).

A Civilization VI trace was the only workload I found to make use of
this optimization and it did so for 2D, non-array textures. Therefore,
this fix simply checks that the depth of the clear box is 1. It also
moves the single-slice aux-state query closer to the optimization to
clarify the need for the depth check.

Enables iris to pass a case of the fcc-write-after-clear piglit test,
[fast-clear tracking across layers 0 -> 1 -> (0,1)].

Fixes: 393f659ed83 ("iris: Enable fast clears on other miplevels and layers than 0.")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6973>

4 years agoanv: remove VkPipelineCacheCreateInfo::flags assert
Mike Blumenkrantz [Tue, 6 Oct 2020 14:14:33 +0000 (10:14 -0400)]
anv: remove VkPipelineCacheCreateInfo::flags assert

flags are handled, so this just crashes for no reason

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

4 years agointel/dev: add a small non installable tool to print device info
Lionel Landwerlin [Thu, 1 Oct 2020 10:05:20 +0000 (13:05 +0300)]
intel/dev: add a small non installable tool to print device info

Mostly for debug purposes.

$ ./build/src/intel/dev/intel_device_info
/dev/dri/renderD128:
   name: Intel(R) UHD Graphics 620 (WHL GT2)
   gen: 9
   PCI id: 0x3ea0
   revision: 2
   slice0.subslice0: 11111111
   slice0.subslice1: 11111111
   slice0.subslice2: 11111111
   slices: 1
   subslices: 3
   EUs: 24
   EU threads: 168
   LLC: 1
   threads per EU: 7
   L3 banks: 4
   max VS  threads: 336
   max TCS threads: 336
   max TES threads: 336
   max GS  threads: 336
   max WM  threads: 256
   max CS  threads: 56
   timestamp frequency: 12000000

v2: Missing license (Marcin)
    Fix stderr usage (Marcin)

v3: Reformat topology printing (Marcin)

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

4 years agozink: enable pipe caps for ARB_timer_query
Mike Blumenkrantz [Fri, 10 Jul 2020 18:47:32 +0000 (14:47 -0400)]
zink: enable pipe caps for ARB_timer_query

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

4 years agozink: add pipe_context::get_timestamp hook
Mike Blumenkrantz [Fri, 10 Jul 2020 18:46:18 +0000 (14:46 -0400)]
zink: add pipe_context::get_timestamp hook

this uses VK_EXT_calibrated_timestamps to read a timestamp immediately from
the device without using a batch, which is what the gallium api expects

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

4 years agozink: handle TIME_ELAPSED queries
Mike Blumenkrantz [Mon, 17 Aug 2020 20:44:45 +0000 (16:44 -0400)]
zink: handle TIME_ELAPSED queries

these just need to write a timestamp at the start to diff against

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

4 years agozink: handle timestamp queries
Mike Blumenkrantz [Fri, 10 Jul 2020 18:44:58 +0000 (14:44 -0400)]
zink: handle timestamp queries

a lot of this is just rejiggering code to allow timestamp queries to
take the same codepaths as "normal" queries instead of even more explicitly
special casing everything

key point here is that we need to convert vulkan-level timestamp "ticks" to
nanoseconds like the gallium api expects

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

4 years agointel/perf: fix crash when no perf queries are supported
Lionel Landwerlin [Tue, 6 Oct 2020 08:38:54 +0000 (11:38 +0300)]
intel/perf: fix crash when no perf queries are supported

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: ec1fa1d51ff614 ("intel/perf: fix raw query kernel metric selection")
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7024>

4 years agoutil: drop non-posix header fnmatch
Michel Zou [Mon, 5 Oct 2020 18:11:26 +0000 (20:11 +0200)]
util: drop non-posix header fnmatch

Seems fnmatch usage was removed but not the include

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

4 years agoCI: Disable Panfrost T7xx CI
Daniel Stone [Sat, 3 Oct 2020 10:53:06 +0000 (11:53 +0100)]
CI: Disable Panfrost T7xx CI

The lab is having some more maintenance work this morning to continue
expanding capacity and improving resilience.

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

4 years agoxmlconfig: fix scandir_filter
Mike Blumenkrantz [Tue, 6 Oct 2020 01:21:16 +0000 (21:21 -0400)]
xmlconfig: fix scandir_filter

this was changed from a fnmatch usage to strcmp, and the return value
was flipped, breaking matching

also fix the formatting of the changed lines

Fixes: 4f37161a8f2: ("util/xmlconfig: Indent to Mesa style.")

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

4 years agospirv: Make the clc_shader const
Jason Ekstrand [Tue, 6 Oct 2020 00:21:29 +0000 (19:21 -0500)]
spirv: Make the clc_shader const

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7016>

4 years agoturnip/kgsl: Add strerror decode in BO init failure.
Eric Anholt [Tue, 22 Sep 2020 18:28:02 +0000 (11:28 -0700)]
turnip/kgsl: Add strerror decode in BO init failure.

Just covering more of the error paths.

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

4 years agoturnip: Report device loss through _mesa_loge() instead of fprintf.
Eric Anholt [Tue, 22 Sep 2020 02:41:06 +0000 (19:41 -0700)]
turnip: Report device loss through _mesa_loge() instead of fprintf.

We drop the file/line, but there are only a couple of places calling this
and they have unique strings anyway.

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

4 years agoturnip: Always enable TU_DEBUG=startup on debug drivers.
Eric Anholt [Mon, 5 Oct 2020 21:31:26 +0000 (14:31 -0700)]
turnip: Always enable TU_DEBUG=startup on debug drivers.

For Android, it's hard to inject environment variables for testing, and I
figure if you've got a debug driver then you'd love to see about driver
init failures anyway.

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

4 years agoturnip: Extend the coverage of TU_DEBUG=startup.
Eric Anholt [Wed, 16 Sep 2020 02:42:41 +0000 (19:42 -0700)]
turnip: Extend the coverage of TU_DEBUG=startup.

I found while debugging KGSL that we were missing failure output for a
bunch of the error paths.

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

4 years agoturnip: Mark the vk_errorf helper as bring printflike.
Eric Anholt [Mon, 5 Oct 2020 21:22:40 +0000 (14:22 -0700)]
turnip: Mark the vk_errorf helper as bring printflike.

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

4 years agoturnip: Use mesa's normal PRINTFLIKE macro instead of our own.
Eric Anholt [Wed, 16 Sep 2020 02:29:13 +0000 (19:29 -0700)]
turnip: Use mesa's normal PRINTFLIKE macro instead of our own.

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

4 years agoturnip: Don't expose VK_ANDROID_native_buffer on non-Android.
Eric Anholt [Mon, 21 Sep 2020 16:35:23 +0000 (09:35 -0700)]
turnip: Don't expose VK_ANDROID_native_buffer on non-Android.

The code is only there when compiling that platform.

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

4 years agoanv: Implement VK_EXT_transform_feedback on Gen7
Jason Ekstrand [Sun, 4 Oct 2020 14:15:36 +0000 (09:15 -0500)]
anv: Implement VK_EXT_transform_feedback on Gen7

Things work a little different on Gen7 than they do on Gen8+.  In
particular, SOBufferEnable lives in 3DSTATE_STREAMOUT but BufferPitch
lives in 3DSTATE_SO_BUFFER.  This leaves us having to marshal data
around a bit more than we did on Gen8.  Still, it's not too bad.

Normally, I don't spend much time on Gen7 but XFB just became a hard
requirement for DXVK so it stopped working for all our Haswell users.
Let's get them happily playing their games again. 😸

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

4 years agoandroid: panfrost: use python3 for generated sources rules
Mauro Rossi [Sat, 3 Oct 2020 22:25:34 +0000 (00:25 +0200)]
android: panfrost: use python3 for generated sources rules

Scripts are python3 ready

Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6996>

4 years agoandroid: pan/bi: Use new disassembler (v2)
Mauro Rossi [Sat, 3 Oct 2020 22:14:29 +0000 (00:14 +0200)]
android: pan/bi: Use new disassembler (v2)

(v2) bifrost_gen_disasm.c generated source belongs to libpanfrost_bifrost_disasm

Fixes the following build errors, which happen with Android P, but not with Android Q

FAILED: out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/gallium_dri_intermediates/LINKED/gallium_dri.so
...
external/mesa/src/panfrost/bifrost/disassemble.c:678: error: undefined reference to 'bi_disasm_fma'
external/mesa/src/panfrost/bifrost/disassemble.c:679: error: undefined reference to 'bi_disasm_add'

Fixes: 792b51713 ("android: pan/bi: Use new disassembler")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6996>

4 years agoturnip: implement timestamp fences/semaphores for kgsl backend
Jonathan Marek [Mon, 5 Oct 2020 02:06:18 +0000 (22:06 -0400)]
turnip: implement timestamp fences/semaphores for kgsl backend

This gets fences and semaphores working for kgsl (minus import/export).

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

4 years agobroadcom/simulator: update to a newer simulator
Alejandro Piñeiro [Wed, 23 Sep 2020 21:54:44 +0000 (23:54 +0200)]
broadcom/simulator: update to a newer simulator

Some headers were moved, and macros renamed.

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

4 years agozink: hook up driconf
Mike Blumenkrantz [Wed, 23 Sep 2020 19:42:18 +0000 (15:42 -0400)]
zink: hook up driconf

we need this

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7009>

4 years agoac/nir,radv: fix invalid IR when loading inline uniform blocks
Samuel Pitoiset [Mon, 28 Sep 2020 13:47:38 +0000 (15:47 +0200)]
ac/nir,radv: fix invalid IR when loading inline uniform blocks

Fixes dEQP-VK.binding_model.descriptorset_random.* and
dEQP-VK.binding_model.descriptor_copy.*.

Fixes: 05b6612b4ec ("radv: do not lower UBO/SSBO access to offsets")
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/6977>

4 years agoradv: remove dead deref code in the shader info pass
Samuel Pitoiset [Wed, 30 Sep 2020 07:59:56 +0000 (09:59 +0200)]
radv: remove dead deref code in the shader info pass

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

4 years agoradv: remove unused gs.writes_memory in the shader info pass
Samuel Pitoiset [Wed, 30 Sep 2020 07:58:16 +0000 (09:58 +0200)]
radv: remove unused gs.writes_memory in the shader info pass

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

4 years agoac,radv,radeonsi: remove unused parameters in the shader ABI IO
Samuel Pitoiset [Wed, 30 Sep 2020 07:57:00 +0000 (09:57 +0200)]
ac,radv,radeonsi: remove unused parameters in the shader ABI IO

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

4 years agoradeonsi: remove dead code in TCS/TES/GS since const_index is always 0
Samuel Pitoiset [Wed, 30 Sep 2020 07:51:08 +0000 (09:51 +0200)]
radeonsi: remove dead code in TCS/TES/GS since const_index is always 0

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

4 years agoac/nir: remove dead shader IO code
Samuel Pitoiset [Wed, 30 Sep 2020 07:26:18 +0000 (09:26 +0200)]
ac/nir: remove dead shader IO code

RADV/LLVM and RadeonSI now lower IO.

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

4 years agoac/nir: remove dead global load/store/atomic derefs code
Samuel Pitoiset [Wed, 30 Sep 2020 07:21:31 +0000 (09:21 +0200)]
ac/nir: remove dead global load/store/atomic derefs code

RADV/LLVM now lowers global operations and RadeonSI doesn't use that.

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

4 years agoradv/llvm: enable lower_unpack_half_2x16
Samuel Pitoiset [Wed, 30 Sep 2020 13:01:46 +0000 (15:01 +0200)]
radv/llvm: enable lower_unpack_half_2x16

To match ACO.

fossils-db (Navi10):
Totals from 294 (0.22% of 136420) affected shaders:
SGPRs: 16504 -> 16496 (-0.05%)
VGPRs: 19008 -> 19124 (+0.61%); split: -0.06%, +0.67%
SpillVGPRs: 511 -> 476 (-6.85%); split: -7.63%, +0.78%
CodeSize: 1688852 -> 1687932 (-0.05%); split: -0.10%, +0.05%
Scratch: 305152 -> 307200 (+0.67%)
MaxWaves: 2877 -> 2878 (+0.03%)

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

4 years agoac/llvm: implement nir_op_unpack_half_2x16_split_{x,y}
Samuel Pitoiset [Wed, 30 Sep 2020 13:09:54 +0000 (15:09 +0200)]
ac/llvm: implement nir_op_unpack_half_2x16_split_{x,y}

nir_unpack_half_2x16_split_{x,y}_flush_to_zero don't have to be
implemented because RADV/LLVM doesn't allow flushing denorms
for 16-bit floating point.

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

4 years agoradv/llvm: lower VS IO
Samuel Pitoiset [Wed, 30 Sep 2020 07:15:54 +0000 (09:15 +0200)]
radv/llvm: lower VS IO

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

4 years agoradv/llvm: gather VS input usage mask from load_input
Samuel Pitoiset [Fri, 25 Sep 2020 15:14:13 +0000 (17:14 +0200)]
radv/llvm: gather VS input usage mask from load_input

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

4 years agoradv/llvm: lower TCS IO
Samuel Pitoiset [Wed, 30 Sep 2020 06:46:19 +0000 (08:46 +0200)]
radv/llvm: lower TCS IO

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

4 years agoradv/llvm: gather TCS outputs from the output variables
Samuel Pitoiset [Tue, 29 Sep 2020 17:13:23 +0000 (19:13 +0200)]
radv/llvm: gather TCS outputs from the output variables

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

4 years agoradv/llvm: lower TES IO
Samuel Pitoiset [Tue, 29 Sep 2020 17:12:37 +0000 (19:12 +0200)]
radv/llvm: lower TES IO

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

4 years agoradv/llvm: lower GS IO
Samuel Pitoiset [Tue, 29 Sep 2020 15:05:57 +0000 (17:05 +0200)]
radv/llvm: lower GS IO

The LLVM bakend expects 64-bit IO to be lowered to 32-bit but
it's unclear if we want to do that for ACO at this point.

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

4 years agoradv/llvm: assign driver locations for VS, TCS, TES and GS correctly
Samuel Pitoiset [Tue, 29 Sep 2020 17:18:14 +0000 (19:18 +0200)]
radv/llvm: assign driver locations for VS, TCS, TES and GS correctly

RADV/LLVM doesn't use assigned IO locations (yet).

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

4 years agoac/nir: remove dead load/store deref code for temporary variables
Samuel Pitoiset [Fri, 2 Oct 2020 14:35:14 +0000 (16:35 +0200)]
ac/nir: remove dead load/store deref code for temporary variables

They should have been lowered before reaching the backend.

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

4 years agoac/llvm: adjust dmask when image stores are shrinked using the format
Samuel Pitoiset [Fri, 2 Oct 2020 12:58:15 +0000 (14:58 +0200)]
ac/llvm: adjust dmask when image stores are shrinked using the format

It looks like GFX10 doesn't care about dmask if it's greater than
the number of components stored but it matters on GFX8-9 (I haven't
checked older gens).

Fixes: 1b4d968106d ("ac/llvm: fix invalid IR if image stores are shrinked using the format")
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/6982>

4 years agovc4: Avoid negative scissor caused by no intersection
Jose Maria Casanova Crespo [Thu, 1 Oct 2020 23:55:07 +0000 (00:55 +0100)]
vc4: Avoid negative scissor caused by no intersection

This fixes 6 tests that were crashing on VC4 since
EGL_KHR_swap_buffers_with_damage was enabled.

dEQP-EGL.functional.swap_buffers_with_damage.*.buffer_age_render

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

4 years agov3d: Update the TEXTURE_SHADER_STATE when there’s a new buf for a tex
Neil Roberts [Tue, 29 Sep 2020 15:24:51 +0000 (17:24 +0200)]
v3d: Update the TEXTURE_SHADER_STATE when there’s a new buf for a tex

When a texture is mapped with the DISCARD_WHOLE_RESOURCE flag set,
v3d_map_usage_prep will try to allocate a new buffer for the resource.
Previously, if the resource was used in a bound texture then nothing
would cause it to update the sampler view with the offset for the new
buffer. This commit just adds that in by looking at all sampler views
and calling v3d_create_texture_shader_state_bo for each one that
references this resource.

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

4 years agov3d: Split the creating of TEXTURE_SHADER_STATE into a helper function
Neil Roberts [Tue, 29 Sep 2020 15:22:37 +0000 (17:22 +0200)]
v3d: Split the creating of TEXTURE_SHADER_STATE into a helper function

This extracts the part of v3d_create_sampler_view that creates and fills
in the buffer for the TEXTURE_SHADER_STATE record into a helper
function. This will be used in a later patch to update the record when
the information changes.

v2: Also put the part that creates the buffer into the helper function
    so that it won’t override the contents of an inflight buffer.

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

4 years agov3d: Make the function to set tex dirty state for a stage global
Neil Roberts [Tue, 29 Sep 2020 15:20:31 +0000 (17:20 +0200)]
v3d: Make the function to set tex dirty state for a stage global

This moves the static function v3d_dirty_tex_state_for_shader_type from
v3dx_state.c to v3d_context.c and adds a declaration for it in the
header so that it can be used as a general utility function in a later
patch.

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

4 years agoturnip: remove pre-emption marker
Jonathan Marek [Sun, 4 Oct 2020 02:00:31 +0000 (22:00 -0400)]
turnip: remove pre-emption marker

turnip doesn't implement pre-emption, this hasn't been a problem with drm
backend since the kernel driver doesn't implement it either, however this
causes issues with kgsl backend.

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

4 years agoglsl: Initialize ast_node member field location.path in constructor.
Vinson Lee [Tue, 29 Sep 2020 01:20:32 +0000 (18:20 -0700)]
glsl: Initialize ast_node member field location.path in constructor.

Fix defect reported by Coverity Scan.

Uninitialized pointer field (UNINIT_CTOR)
uninit_member: Non-static class member field location.path 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/6905>

4 years agointel/vec4: Remove leftover code from Gen8+ removal.
Vinson Lee [Tue, 29 Sep 2020 23:58:47 +0000 (16:58 -0700)]
intel/vec4: Remove leftover code from Gen8+ removal.

Remove code missed in commit 2a49007411bb ("intel/vec4: Remove all
support for Gen8+ [v2]").

Fix defect reported by Coverity Scan.

Logically dead code (DEADCODE)
dead_error_begin: Execution cannot reach this statement:
mcs.swizzle = 80U;

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6927>

4 years agofreedreno: Move rsc NULL check to before rsc dereferences.
Vinson Lee [Mon, 28 Sep 2020 23:16:37 +0000 (16:16 -0700)]
freedreno: Move rsc NULL check to before rsc dereferences.

Fix defect reported by Coverity Scan.

Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking rsc suggests that it may be
null, but it has already been dereferenced on all paths leading
to the check.

Fixes: 6173cc19c45d ("freedreno: gallium driver for adreno")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6903>

4 years agoiris: Fix the constant data address calculation
Jason Ekstrand [Fri, 2 Oct 2020 22:41:15 +0000 (17:41 -0500)]
iris: Fix the constant data address calculation

In 536727c46517, we switched iris to patching the constant data address
into the shader but, thanks to my lack of understanding how iris works,
I got the calculation wrong.  I didn't realize, we needed to call
iris_bo_offset_from_base_address to get the BO offset from the start of
instruction state base address.

Fixes: 536727c465170c "iris: Patch constant data pointers into shaders"
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3596
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6992>

4 years agonv50/ir: Initialize Source members.
Vinson Lee [Fri, 18 Sep 2020 00:05:56 +0000 (17:05 -0700)]
nv50/ir: Initialize Source members.

Fix defects reported by Coverity Scan.

uninit_member: Non-static class member insns is not initialized in this
constructor nor in any functions that it calls.
uninit_member: Non-static class member clipVertexOutput is not
initialized in this constructor nor in any functions that it calls.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6769>

4 years agoradv: Fix asserts using assign instead of compare.
Vinson Lee [Mon, 28 Sep 2020 23:01:03 +0000 (16:01 -0700)]
radv: Fix asserts using assign instead of compare.

Fix defects reported by Coverity Scan.

Assign instead of compare (PW.ASSIGN_WHERE_COMPARE_MEANT)
assign_where_compare_meant: use of "=" where "==" may have been
intended

Fixes: d8cdcd4adf7a ("radv: use syncobj for wsi fence")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6902>

4 years agolima: Print usage if --help is any of the arguments.
Vinson Lee [Tue, 29 Sep 2020 01:35:04 +0000 (18:35 -0700)]
lima: Print usage if --help is any of the arguments.

Fix defect reported by Coverity Scan.

Structurally dead code (UNREACHABLE)
unreachable: Since the loop increment n++; is unreachable, the loop body
will never execute more than once.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6906>

4 years agoandroid: Disable the user XML config parsing.
Eric Anholt [Tue, 29 Sep 2020 16:37:50 +0000 (09:37 -0700)]
android: Disable the user XML config parsing.

The android platform is not interested in this feature of Mesa.  There are
currently workarounds for apps on Android, and no support for it in the
xmlconfig code.  Even if there we do need workarounds eventually, we'll
want to bake them in as structs rather than have this awkward external
dependency for parsing user-readable data installed by Mesa for
Mesa-internal details.

This gets rid of the expat dependency in the turnip driver.

Note that rather than have more #ifdefs in the file, I've opted to move
the code to have more logical locations since the structs refactor had
left less-used helpers scattered across the file.

Acked-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6916>

4 years agoutil/xmlconfig: Drop use of XML_Char in parsing.
Eric Anholt [Fri, 11 Sep 2020 20:36:24 +0000 (13:36 -0700)]
util/xmlconfig: Drop use of XML_Char in parsing.

We don't define the use-16-bit-unicode defines (and our strings are plain
utf8), so it's just char.  This will let me use some of this code in the
absence of expat.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6916>

4 years agodriconf: Stop quoting true/false in boolean option definitions.
Eric Anholt [Tue, 29 Sep 2020 16:28:18 +0000 (09:28 -0700)]
driconf: Stop quoting true/false in boolean option definitions.

Now that we're not trying to evade preprocessor macro expansion in
preprocessor string concatenation, we can use plain old bools in option
setup.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6916>

4 years agodriconf: Make the driver's declarations be structs instead of XML.
Eric Anholt [Fri, 25 Sep 2020 19:56:22 +0000 (12:56 -0700)]
driconf: Make the driver's declarations be structs instead of XML.

We can generate the XML if anybody actually queries it, but this reduces
the amount of work in driver setup and means that we'll be able to support
driconf option queries on Android without libexpat.

This updates the driconf interface struct version for i965, i915, and
radeon to use the new getXml entrypoint to call the on-demand xml
generation.  Note that our loaders (egl, glx) implement the v2 function
interface and don't use .xml when that's set, and the X server doesn't use
this interface at all.

XML generation tested on iris and i965 using adriconf

Acked-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6916>

4 years agodriconf: Use DRI_CONF_OPT_I for remaining int options
Eric Anholt [Tue, 29 Sep 2020 17:23:52 +0000 (10:23 -0700)]
driconf: Use DRI_CONF_OPT_I for remaining int options

Now that we have a single range in the option and start==end means "no
range", we can switch over these non-ranged int options.  This will ease
later refactors.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6916>

4 years agodriconf: Delete disjoint range support.
Eric Anholt [Mon, 28 Sep 2020 18:21:00 +0000 (11:21 -0700)]
driconf: Delete disjoint range support.

The only user was radeon/r200, which was using it to have something that
looks a lot like an enum value return a float from the config option.
Just convert that option to a plain float value (for compat with existing
driconfs) with the min and max of its disjoint range as the range.  The
driver's option handling code already correctly deals with other values in
the range.

The disjoint range support was a bunch of extra parsing for this dead
driver, and made turning driconf into static structs difficult.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6916>

4 years agoutil/xmlconfig: Indent to Mesa style.
Eric Anholt [Thu, 10 Sep 2020 23:54:38 +0000 (16:54 -0700)]
util/xmlconfig: Indent to Mesa style.

I'm heavily editing this code, and having Mesa's style not apply sucks.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6916>

4 years agoutil/xmlconfig: Drop silly open-coded strdup.
Eric Anholt [Thu, 10 Sep 2020 23:45:14 +0000 (16:45 -0700)]
util/xmlconfig: Drop silly open-coded strdup.

The comment about using "malloc"?  The strdup man page says 'Memory for
the new string is obtained with malloc(3), and can be freed with free(3)'

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6916>

4 years agodriconf: Make a DRI_CONF_OPT_S() for string options.
Eric Anholt [Sat, 26 Sep 2020 00:06:07 +0000 (17:06 -0700)]
driconf: Make a DRI_CONF_OPT_S() for string options.

This gets rid of most of the remaining special case option definitions.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6916>

4 years agor200: Reuse DRI_CONF_OPT_F for texture_blend_quality.
Eric Anholt [Fri, 25 Sep 2020 22:35:16 +0000 (15:35 -0700)]
r200: Reuse DRI_CONF_OPT_F for texture_blend_quality.

I missed this one in the nested macros conversion.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6916>

4 years agodriconf: Fix extra quoting on "Jimenez'".
Eric Anholt [Mon, 28 Sep 2020 22:44:21 +0000 (15:44 -0700)]
driconf: Fix extra quoting on "Jimenez'".

We're in a "" C string, no need to add extra '\'.  Fixes an extra '\' in
adriconf's interface.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6916>

4 years agodriconf: Eliminate the DRI_CONF_OPT_BEGIN_B macro.
Eric Anholt [Fri, 25 Sep 2020 22:06:11 +0000 (15:06 -0700)]
driconf: Eliminate the DRI_CONF_OPT_BEGIN_B macro.

Since the nested-sections rework, this use in the testcase was the only
remaining one.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6916>

4 years agointel/fs: Don't use NoDDClk/NoDDClr for split SHUFFLEs
Jason Ekstrand [Fri, 2 Oct 2020 18:37:05 +0000 (13:37 -0500)]
intel/fs: Don't use NoDDClk/NoDDClr for split SHUFFLEs

When I copied and pasted the code from MOV_INDIRECT for handling the
dependency controls, I missed a subtle difference between MOV_INDIRECT
and SHUFFLE.  Specifically, MOV_INDIRECT gets lowered to a narrow
instruction on Gen7 by the SIMD width lowering whereas SHUFFLE has to
split it in the generator.  Therefore, the check safety check for
whether or not we can use dependency control has to be based on the
lowered width rather than the width of the original instruction.

Fixes: a8ac61b0ee2fd "intel/fs: NoMask initialize the address..."
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3593
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6989>

4 years agoandroid: util: add log.c to Makefile.sources
Mauro Rossi [Thu, 1 Oct 2020 22:42:32 +0000 (00:42 +0200)]
android: util: add log.c to Makefile.sources

Fixes the following building errors:

external/mesa/src/intel/vulkan/anv_android.c:627: error: undefined reference to 'mesa_log'
...
external/mesa/src/intel/vulkan/anv_device.c:164: error: undefined reference to 'mesa_log'

Fixes: 13ea7db76 ("mesa: Promote Intel's simple logging façade for Android to util/")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6972>

4 years agopanfrost: decode: Flag pandecode_log_typed() as PRINTFLIKE
Boris Brezillon [Tue, 29 Sep 2020 08:25:56 +0000 (10:25 +0200)]
panfrost: decode: Flag pandecode_log_typed() as PRINTFLIKE

This way we can catch mismatch between the format string and the
arguments.

Suggested-by: Kristian H. Kristensen <hoegsberg@google.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6886>

4 years agopanfrost: decode: Fix decode_bifrost_constant() prototype
Boris Brezillon [Thu, 24 Sep 2020 06:49:36 +0000 (08:49 +0200)]
panfrost: decode: Fix decode_bifrost_constant() prototype

We expect a float, not an integer.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6886>