platform/upstream/mesa.git
3 years agoradv: Add sam option.
Bas Nieuwenhuizen [Sat, 27 Feb 2021 19:16:21 +0000 (20:16 +0100)]
radv: Add sam option.

So that people without large BAR can try this out.

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

3 years agov3dv: fix branching to large secondaries with more than one BCL buffer.
Iago Toral Quiroga [Mon, 1 Mar 2021 09:42:42 +0000 (10:42 +0100)]
v3dv: fix branching to large secondaries with more than one BCL buffer.

Fixes:
dEQP-VK.api.command_buffers.record_many_draws_secondary_*

Tested-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9333>

3 years agoradv: Enable linear sampling for depth textures.
Bas Nieuwenhuizen [Sun, 28 Feb 2021 02:09:48 +0000 (03:09 +0100)]
radv: Enable linear sampling for depth textures.

Turns out there are CTS tests.

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

3 years agoradeonsi,radv: do not overallocate the SQTT buffer size
Samuel Pitoiset [Fri, 26 Feb 2021 14:19:25 +0000 (15:19 +0100)]
radeonsi,radv: do not overallocate the SQTT buffer size

The number of shader engines isn't always 4.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9307>

3 years agoRevert "radv: do not overallocate the SQTT buffer"
Samuel Pitoiset [Fri, 26 Feb 2021 14:23:33 +0000 (15:23 +0100)]
Revert "radv: do not overallocate the SQTT buffer"

This fixes computing the thread trace data offset.

This reverts commit c7e6f4ff3da39f36fdda8f0ec6eea4925cd3afdc.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9307>

3 years agoradv: exclude perf counters for SQTT also on GFX10.3
Samuel Pitoiset [Fri, 26 Feb 2021 15:36:39 +0000 (16:36 +0100)]
radv: exclude perf counters for SQTT also on GFX10.3

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

3 years agoradv: fix exporting SQTT pipelines with LLVM
Samuel Pitoiset [Fri, 26 Feb 2021 07:53:57 +0000 (08:53 +0100)]
radv: fix exporting SQTT pipelines with LLVM

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

3 years agoradv: always select the first active CU when profiling with SQTT
Samuel Pitoiset [Fri, 26 Feb 2021 07:43:48 +0000 (08:43 +0100)]
radv: always select the first active CU when profiling with SQTT

This probably fixes instruction tracing on many chips.

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

3 years agoradv: remove duplicate REG_INCLUDE_CONTEXT setting for SQTT
Samuel Pitoiset [Fri, 26 Feb 2021 07:27:16 +0000 (08:27 +0100)]
radv: remove duplicate REG_INCLUDE_CONTEXT setting for SQTT

It was set twice.

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

3 years agov3dv: Output a message if file open fails in physical_device_init
Andreas Bergmeier [Sat, 27 Feb 2021 22:28:19 +0000 (22:28 +0000)]
v3dv: Output a message if file open fails in physical_device_init

In the caller, this error simply gets mapped to VK_ERROR_INIT[...].
Especially for users it is very valuable to know what the driver
tried and what kind of failure occured. Thus just straight out log
to stderr.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9317>

3 years agogitlab-ci: bump piglit commit for windows
Tapani Pälli [Mon, 1 Mar 2021 06:39:16 +0000 (08:39 +0200)]
gitlab-ci: bump piglit commit for windows

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8520>

3 years agomesa: add check that non base level attachment is mipmap complete
Tapani Pälli [Tue, 19 Jan 2021 05:43:41 +0000 (07:43 +0200)]
mesa: add check that non base level attachment is mipmap complete

Patch adds a check for mipmap completeness of framebuffer object texture
attachments. Since a glTexImage call might have updated miplevels
meanwhile, we test the completeness before setting framebuffer object
incomplete.

Fixes some upcoming framebuffer completeness CTS tests that explicitly
test case where we have mipmap incomplete non base level texture which
should make also framebuffer object incomplete. After update to the
texture it should make framebuffer object complete again.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8520>

3 years agoi965: Call util_cpu_detect() early in screen creation
Jordan Justen [Sun, 28 Feb 2021 21:23:07 +0000 (13:23 -0800)]
i965: Call util_cpu_detect() early in screen creation

This helps to avoid this assertion in debug builds:

src/util/u_cpu_detect.h:116: util_get_cpu_caps: Assertion `util_cpu_caps.nr_cpus >= 1' failed.

Fixes: a9618e7c421 ("util: Add accessor for util_cpu_caps")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9325>

3 years agomeson: Add missing lavapipe dep
Greg V [Sat, 14 Nov 2020 14:53:28 +0000 (17:53 +0300)]
meson: Add missing lavapipe dep

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

3 years agofrontends/va: Use correct size for secondary planes.
Bas Nieuwenhuizen [Tue, 23 Feb 2021 23:00:58 +0000 (00:00 +0100)]
frontends/va: Use correct size for secondary planes.

And initialize the whandle format while at it.

Fixes: f7a4051b836 ("radeonsi: Check pitch and offset for validity.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4126
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9236>

3 years agoradeonsi/uvd: make format modifiers-aware
Simon Ser [Fri, 26 Feb 2021 15:49:17 +0000 (16:49 +0100)]
radeonsi/uvd: make format modifiers-aware

When format modifiers are supported, use
resource_create_with_modifiers instead of resource_create. This
allows radeonsi to set the modifier field, and allows VA-API
clients to have a proper modifier instead of
DRM_FORMAT_MOD_INVALID.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9308>

3 years agodocs/features: Add OpenCL status
Pierre Moreau [Thu, 7 May 2020 11:45:11 +0000 (13:45 +0200)]
docs/features: Add OpenCL status

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

Signed-off-by: Pierre Moreau <dev@pmoreau.org>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4979>

3 years agoci: add libdrm to the x86_test-vk container
Andres Gomez [Wed, 17 Feb 2021 16:23:30 +0000 (18:23 +0200)]
ci: add libdrm to the x86_test-vk container

Fixes: 5d0ba8b1834 (ci: Split building of libdrm to its own script)
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9102>

3 years agomesa: ensure parameter list capacity before associating uniform storage
Andrii Simiklit [Thu, 25 Feb 2021 12:28:24 +0000 (14:28 +0200)]
mesa: ensure parameter list capacity before associating uniform storage

We have to reserve at lease 16 program parameters in storage to
avoid its reallocation.

v2: move allocation to `st_deserialise_ir_program` and add helper for that
                     ( Eric Anholt <eric@anholt.net> )

v3 amend comments a bit

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4352
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9282>

3 years agoanv: group as many command buffers into a single execbuf
Lionel Landwerlin [Wed, 9 Dec 2020 11:23:16 +0000 (13:23 +0200)]
anv: group as many command buffers into a single execbuf

When semaphores are not involved, try to batch things up as much as
possible across VkSubmitInfo and also batch command buffers within a
VkSubmitInfo.

v2: Reuse anv_cmd_buffer_is_chainable()

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2371>

3 years agoanv: allow multiple command buffers in anv_queue_submit
Lionel Landwerlin [Wed, 9 Dec 2020 11:22:45 +0000 (13:22 +0200)]
anv: allow multiple command buffers in anv_queue_submit

v2: Fixup crash spotted by Mark about missing alloc vfuncs

v3: Fixup double iteration over device->memory_objects (that ought to
    be expensive...) (Ken)

v4: Add more asserts for non-softpin cases (Ken)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2371>

3 years agoanv: end command buffer with a potential jump
Lionel Landwerlin [Wed, 9 Dec 2020 11:19:30 +0000 (13:19 +0200)]
anv: end command buffer with a potential jump

We would like to chain multiple primary command buffer to be submitted
together to i915. For prepare this, add end the command buffers with a
MI_BATCH_BUFFER_START and at submit time, replace it with
MI_BATHC_BUFFER_END if needed.

v2: Don't even consider non softpin platforms

v3: Fix inverted condition

v4: Limit is_chainable() to checking device->use_softpin (Jason)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2371>

3 years agoanv: track the end of the command buffers
Lionel Landwerlin [Wed, 9 Dec 2020 09:56:31 +0000 (11:56 +0200)]
anv: track the end of the command buffers

Where MI_BATCH_BUFFER_END is recorded.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2371>

3 years agoanv: make use of new helper function directly in anv_QueueSubmit()
Lionel Landwerlin [Sun, 6 Dec 2020 21:38:03 +0000 (23:38 +0200)]
anv: make use of new helper function directly in anv_QueueSubmit()

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2371>

3 years agoradv: Expose robustBufferAccessUpdateAfterBind correctly.
Bas Nieuwenhuizen [Thu, 25 Feb 2021 12:29:09 +0000 (13:29 +0100)]
radv: Expose robustBufferAccessUpdateAfterBind correctly.

We do support it.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4351
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9281>

3 years agomesa: skip a subset of _mesa_update_state if no relevant flags are set
Marek Olšák [Wed, 3 Feb 2021 07:40:59 +0000 (02:40 -0500)]
mesa: skip a subset of _mesa_update_state if no relevant flags are set

We only need to check 12 out of 32 flags.

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

3 years agomesa: don't update tnl spaces on irrelevant _NEW_POINT/TEXTURE_STATE changes
Marek Olšák [Wed, 3 Feb 2021 19:02:39 +0000 (14:02 -0500)]
mesa: don't update tnl spaces on irrelevant _NEW_POINT/TEXTURE_STATE changes

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

3 years agomesa: don't update the fixed-func frag prog on irrelevant _NEW_COLOR changes
Marek Olšák [Wed, 3 Feb 2021 18:13:51 +0000 (13:13 -0500)]
mesa: don't update the fixed-func frag prog on irrelevant _NEW_COLOR changes

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

3 years agomesa: don't update fixed-func programs on irrelevant _NEW_RENDER_MODE changes
Marek Olšák [Wed, 3 Feb 2021 18:13:51 +0000 (13:13 -0500)]
mesa: don't update fixed-func programs on irrelevant _NEW_RENDER_MODE changes

The fixed-func vertex program uses it too, which was ignored. This commit
fixes it.

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

3 years agomesa: don't update fixed-func programs on irrelevant _NEW_FOG changes
Marek Olšák [Wed, 3 Feb 2021 18:13:51 +0000 (13:13 -0500)]
mesa: don't update fixed-func programs on irrelevant _NEW_FOG changes

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

3 years agomesa: don't update fixed-func programs on irrelevant _NEW_POINT changes
Marek Olšák [Wed, 3 Feb 2021 18:13:51 +0000 (13:13 -0500)]
mesa: don't update fixed-func programs on irrelevant _NEW_POINT changes

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

3 years agomesa: don't update fixed-func vert prog on irrelevant _NEW_TRANSFORM changes
Marek Olšák [Wed, 3 Feb 2021 18:13:51 +0000 (13:13 -0500)]
mesa: don't update fixed-func vert prog on irrelevant _NEW_TRANSFORM changes

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

3 years agomesa: only update fixed-func programs on texture matrix enablement changes
Marek Olšák [Wed, 3 Feb 2021 18:03:24 +0000 (13:03 -0500)]
mesa: only update fixed-func programs on texture matrix enablement changes

This should reduce fixed-func program key recomputations.

I also update the fixed-func fragment program, which was incorrectly
ignored because it's clearly used there.

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

3 years agomesa: move _mesa_update_pixel out of _mesa_update_state
Marek Olšák [Wed, 3 Feb 2021 17:56:52 +0000 (12:56 -0500)]
mesa: move _mesa_update_pixel out of _mesa_update_state

This only has to be called in a few places and not in normal draw calls.

egl_image_target_texture doesn't call  _mesa_update_pixel because it only
assigns an EGL image to a texture object.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8850>

3 years agomesa: be precise about when to set _NEW_CURRENT_ATTRIB and _NEW_MATERIAL
Marek Olšák [Wed, 3 Feb 2021 17:41:18 +0000 (12:41 -0500)]
mesa: be precise about when to set _NEW_CURRENT_ATTRIB and _NEW_MATERIAL

This commit fixes _mesa_update_color_material, which allows cleaning up
the unnecessary state flagging.

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

3 years agovbo: don't call update_color_material in copy_to_current if it's a no-op
Marek Olšák [Wed, 3 Feb 2021 16:58:49 +0000 (11:58 -0500)]
vbo: don't call update_color_material in copy_to_current if it's a no-op

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

3 years agovbo: optimize copy_to_current functions
Marek Olšák [Tue, 2 Feb 2021 01:01:13 +0000 (20:01 -0500)]
vbo: optimize copy_to_current functions

- execute vbo_set_vertex_format in a separate skipable conditional block
- replace dmul with dmul_shift
- don't check <= VBO_ATTRIB_MAT_BACK_INDEXES because there is no attrib
  above that

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

3 years agomesa: merge STATE_LIGHT_ATTENUATION and STATE_LIGHT_POSITION_* parameters
Marek Olšák [Sun, 13 Dec 2020 04:04:56 +0000 (23:04 -0500)]
mesa: merge STATE_LIGHT_ATTENUATION and STATE_LIGHT_POSITION_* parameters

This decreases the CPU time spent in fetch_state.

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

3 years agomesa: merge STATE_LIGHTPROD parameters
Marek Olšák [Sat, 5 Dec 2020 21:00:14 +0000 (16:00 -0500)]
mesa: merge STATE_LIGHTPROD parameters

This decreases the CPU time spent in fetch_state.

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

3 years agomesa: sort state parameters for ffvp to enable better parameter merging
Marek Olšák [Mon, 1 Feb 2021 23:55:42 +0000 (18:55 -0500)]
mesa: sort state parameters for ffvp to enable better parameter merging

_mesa_optimize_state_parameters will benefit from this.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8850>

3 years agomesa: remove the fixed-func vert prog dependency on all texture states
Marek Olšák [Mon, 1 Feb 2021 21:57:12 +0000 (16:57 -0500)]
mesa: remove the fixed-func vert prog dependency on all texture states

Just flag _NEW_FF_VERT_PROGRAM where needed. There are only a few places
that must do it.

Also do the same with _NEW_FF_FRAG_PROGRAM, but this is not sufficient
for the ff frag prog to ignore texture states.

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

3 years agomesa: don't push/pop ctx->Texture._* derived states
Marek Olšák [Wed, 3 Feb 2021 18:54:34 +0000 (13:54 -0500)]
mesa: don't push/pop ctx->Texture._* derived states

They are always recomputed by _mesa_update_state, which will need the old
values, so that it can update other dependent states if needed.

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

3 years agomesa: remove _NEW_LIGHT_FF_PROGRAM in favor of _NEW_FF_(VERT|FRAG)_PROGRAM
Marek Olšák [Mon, 1 Feb 2021 21:09:04 +0000 (16:09 -0500)]
mesa: remove _NEW_LIGHT_FF_PROGRAM in favor of _NEW_FF_(VERT|FRAG)_PROGRAM

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

3 years agomesa: remove _NEW_VARYING_VP_INPUTS in favor of _NEW_FF_(VERT|FRAG)_PROGRAM
Marek Olšák [Mon, 1 Feb 2021 21:09:04 +0000 (16:09 -0500)]
mesa: remove _NEW_VARYING_VP_INPUTS in favor of _NEW_FF_(VERT|FRAG)_PROGRAM

This adds _NEW_FF_FRAG_PROGRAM.

_mesa_set_varying_vp_inputs flags both fixed-func programs because both use
the state.

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

3 years agomesa: don't update derived material values in _mesa_update_state and elsewhere
Marek Olšák [Mon, 1 Feb 2021 20:46:25 +0000 (15:46 -0500)]
mesa: don't update derived material values in _mesa_update_state and elsewhere

To my great surprise, many drivers don't use these values at all.
Move the update to the places where they are used.

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

3 years agomesa: add _NEW_MATERIAL to reduce the weight of _NEW_LIGHT_CONSTANTS
Marek Olšák [Mon, 1 Feb 2021 20:07:31 +0000 (15:07 -0500)]
mesa: add _NEW_MATERIAL to reduce the weight of _NEW_LIGHT_CONSTANTS

This reduces no-op compute_light_positions in _mesa_update_state.

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

3 years agomesa: don't compute the ModelView * Projection matrix if not used
Marek Olšák [Mon, 1 Feb 2021 19:21:29 +0000 (14:21 -0500)]
mesa: don't compute the ModelView * Projection matrix if not used

Only GLSL built-in uniforms use it.

This further reduces the time spent in _mesa_update_state.

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

3 years agomesa: don't compute the inverted projection matrix if not used
Marek Olšák [Mon, 1 Feb 2021 19:03:46 +0000 (14:03 -0500)]
mesa: don't compute the inverted projection matrix if not used

Only clip planes and GLSL built-in uniforms use it.

update_projection (called by _mesa_update_state) removes
the _math_matrix_analyse call, reducing the time spent
in _mesa_update_state.

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

3 years agomesa: rework _MESA_NEW_NEED_EYE_COORDS to reduce fixed-func program updates
Marek Olšák [Mon, 1 Feb 2021 18:17:13 +0000 (13:17 -0500)]
mesa: rework _MESA_NEW_NEED_EYE_COORDS to reduce fixed-func program updates

This eliminates a lot of the remaining no-op fixed-func program key
recomputations in _mesa_update_state.

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

3 years agomesa: split _NEW_LIGHT into 3 flags: _NEW_LIGHT_(FF_PROGRAM|CONSTANTS|STATE)
Marek Olšák [Mon, 1 Feb 2021 09:07:18 +0000 (04:07 -0500)]
mesa: split _NEW_LIGHT into 3 flags: _NEW_LIGHT_(FF_PROGRAM|CONSTANTS|STATE)

_NEW_LIGHT_CONSTANTS: state parameters
_NEW_LIGHT_FF_PROGRAM: keys for fixed-func programs
_NEW_LIGHT_STATE: gallium rasterizer state

This reduces:
- the number of no-op fixed-func program key recomputations
  in _mesa_update_state
- the number of no-op rasterizer state updates in st/mesa

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

3 years agomesa: move fixed-func-related _mesa_update_state code closer together
Marek Olšák [Mon, 1 Feb 2021 05:48:03 +0000 (00:48 -0500)]
mesa: move fixed-func-related _mesa_update_state code closer together

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

3 years agomesa: remove unnecessary NewState flagging for glPopAttrib(GL_ENABLE_BIT)
Marek Olšák [Mon, 1 Feb 2021 04:10:26 +0000 (23:10 -0500)]
mesa: remove unnecessary NewState flagging for glPopAttrib(GL_ENABLE_BIT)

pop_enable_group calls _mesa_set_enable for every state it changes,
so we don't need do anything else.

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

3 years agoac/rgp: Only report double the prims per clock on GFX10.
Bas Nieuwenhuizen [Fri, 26 Feb 2021 22:59:52 +0000 (23:59 +0100)]
ac/rgp: Only report double the prims per clock on GFX10.

Misinterpreted review comment.

Fixes: 4ded99f99dd ("ac/rgp: report the number of primitives per clock")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9312>

3 years agonir: fix build at -O1
Rhys Perry [Fri, 26 Feb 2021 09:08:56 +0000 (09:08 +0000)]
nir: fix build at -O1

At -O1 with GCC 10.2.1, _nir_visit_dest_indirect (declared ALWAYS_INLINE)
will fail to inline if it's caller (nir_foreach_dest) is not inlined,
because _nir_visit_dest_indirect is passed as a function pointer. This
results in a compilation error.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
Fixes: 336bcbacd05 ("nir: inline nir_foreach_{src,dest}")
Tested-by: Witold Baryluk <witold.baryluk@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4353
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9301>

3 years agogallium: call util_cpu_detect()
Christian Gmeiner [Fri, 26 Feb 2021 21:05:42 +0000 (22:05 +0100)]
gallium: call util_cpu_detect()

Fix undefined behavior from using util_cpu_caps.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9311>

3 years agoturnip/ir3: check for bindless IBOs in atomic dests fixup
Danylo Piliaiev [Fri, 26 Feb 2021 20:24:37 +0000 (22:24 +0200)]
turnip/ir3: check for bindless IBOs in atomic dests fixup

Otherwise destinations may remain unfixed because ir3_shader_nibo
doesn't count bindless IBOs.

Fixes tests:
 dEQP-VK.image.atomic_operations.*intermediate_values

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

3 years agoutil: add mesa_glthread for Valheim in OpenGL mode.
Tamara Schmitz [Thu, 25 Feb 2021 21:30:18 +0000 (21:30 +0000)]
util: add mesa_glthread for Valheim in OpenGL mode.

Drastically reduces hitching when traversing the landscape.

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

3 years agoetnaviv: extend lower ubo tests
Christian Gmeiner [Fri, 26 Feb 2021 08:05:57 +0000 (09:05 +0100)]
etnaviv: extend lower ubo tests

Test a full transformation path (load_uniform -> load_ubo -> load_uniform)
and validate the load_uniform offset.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9305>

3 years agoetnaviv: fix etna_nir_lower_ubo_to_uniform pass
Christian Gmeiner [Thu, 25 Feb 2021 13:01:28 +0000 (14:01 +0100)]
etnaviv: fix etna_nir_lower_ubo_to_uniform pass

The restoring of the acutal uniform offset was wrong.

Fixes: 1837135f7ca ("etnaviv: nir: add ubo lowering pass")
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9305>

3 years agodocs: Document GL_EXT_depth_bounds_test
Adam Jackson [Thu, 25 Feb 2021 18:58:37 +0000 (13:58 -0500)]
docs: Document GL_EXT_depth_bounds_test

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

3 years agosoftpipe: Implement GL_EXT_depth_bounds_test
Adam Jackson [Thu, 25 Feb 2021 00:20:20 +0000 (19:20 -0500)]
softpipe: Implement GL_EXT_depth_bounds_test

This is a little bit contorted because the Z storage for the tile is
either float or int depending on the Z format, so we have to be careful
about types when comparing.

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

3 years agosoftpipe: Fix depth comparison with float Z formats
Adam Jackson [Wed, 24 Feb 2021 22:31:53 +0000 (17:31 -0500)]
softpipe: Fix depth comparison with float Z formats

We just stuff the Z bits into [bq]zzzz literally for floats, but
comparing those like they're integers only works for == and !=.

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

3 years agomesa: Store depth bounds test bounds as GLclampd
Adam Jackson [Thu, 25 Feb 2021 00:57:50 +0000 (19:57 -0500)]
mesa: Store depth bounds test bounds as GLclampd

... instead of truncating to GLfloat. This seems somewhat silly since
the "clamp" part means only values [0.0, 1.0] are defined, but if the
depth buffer is Z32_UNORM then storing as GLfloat means you lose 8 bits
of depth bounds precision. This happens not to matter, yet, since swrast
classic doesn't support Z32_UNORM for depth, and the software gallium
drivers don't support EXT_depth_bounds_test. But the latter part is
about to change.

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

3 years agoutil: Add accessor for util_cpu_caps
Rob Clark [Thu, 25 Feb 2021 18:04:50 +0000 (10:04 -0800)]
util: Add accessor for util_cpu_caps

In release builds, there should be no change, but in debug builds the
assert will help us catch undefined behavior resulting from using
util_cpu_caps before it is initialized.

With fix for u_half_test for MSVC from Jesse Natalie squashed in.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9266>

3 years agoutil/u_queue: Ensure num_cpu_mask_bits is valid
Rob Clark [Wed, 24 Feb 2021 21:59:15 +0000 (13:59 -0800)]
util/u_queue: Ensure num_cpu_mask_bits is valid

I noticed that we were hitting this before st_create_context() called
util_cpu_detect() and so num_cpu_mask_bits was zero.  But there is no
harm in calling util_cpu_detect(), so lets just call it here to be safe.

Fixes: d877451b48a ("util/u_queue: add UTIL_QUEUE_INIT_SET_FULL_THREAD_AFFINITY")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9266>

3 years agoac/rgp: report the number of primitives per clock
Samuel Pitoiset [Fri, 26 Feb 2021 13:07:56 +0000 (14:07 +0100)]
ac/rgp: report the number of primitives per clock

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

3 years agoac/rgp: report the number of memory operations per clock
Samuel Pitoiset [Fri, 26 Feb 2021 13:01:19 +0000 (14:01 +0100)]
ac/rgp: report the number of memory operations per clock

So that RGP reports the memory type and the memory throughput.
Based on AMDVLK.

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

3 years agoac/rgp: report LDS size in CU mode on GFX10+
Samuel Pitoiset [Fri, 26 Feb 2021 12:55:55 +0000 (13:55 +0100)]
ac/rgp: report LDS size in CU mode on GFX10+

RGP expects that.

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

3 years agoac/rgp: recognize more memory types
Samuel Pitoiset [Fri, 26 Feb 2021 09:22:12 +0000 (09:22 +0000)]
ac/rgp: recognize more memory types

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

3 years agoinclude/drm-uapi: bump AMDGPU headers
Samuel Pitoiset [Fri, 26 Feb 2021 09:18:07 +0000 (09:18 +0000)]
include/drm-uapi: bump AMDGPU headers

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

3 years agor600/sfn: remove old cube texturing code
Gert Wollny [Mon, 4 Jan 2021 08:55:40 +0000 (09:55 +0100)]
r600/sfn: remove old cube texturing code

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

3 years agor600/sfn: use lowering pass for cube textures
Gert Wollny [Wed, 23 Dec 2020 21:42:45 +0000 (22:42 +0100)]
r600/sfn: use lowering pass for cube textures

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

3 years agor600/sfn: use lower bool to int32 and lower int_tg4 only on shader clone
Gert Wollny [Thu, 24 Dec 2020 15:48:00 +0000 (16:48 +0100)]
r600/sfn: use lower bool to int32 and lower int_tg4 only on shader clone

These changes should not be visible to shader variants that may go through
the optimization another time.

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

3 years agor600/sfn: fix gather with cube lowering
Gert Wollny [Mon, 4 Jan 2021 08:47:38 +0000 (09:47 +0100)]
r600/sfn: fix gather with cube lowering

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

3 years agor600/sfn: add lowering pass for cube textures
Gert Wollny [Wed, 23 Dec 2020 21:42:26 +0000 (22:42 +0100)]
r600/sfn: add lowering pass for cube textures

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

3 years agor600/sfn: Add support for cube_r600 instruction
Gert Wollny [Wed, 23 Dec 2020 21:42:07 +0000 (22:42 +0100)]
r600/sfn: Add support for cube_r600 instruction

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

3 years agoaco: use p_as_uniform for get_sampler_desc and convert_pointer_to_64_bit
Rhys Perry [Fri, 26 Feb 2021 09:45:07 +0000 (09:45 +0000)]
aco: use p_as_uniform for get_sampler_desc and convert_pointer_to_64_bit

Since value-numbering no longer works across loops, we no longer need to
use v_readfirstlane_b32.

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

3 years agoaco: calculate all p_as_uniform and v_readfirstlane_b32 sources in WQM
Rhys Perry [Thu, 25 Feb 2021 15:37:17 +0000 (15:37 +0000)]
aco: calculate all p_as_uniform and v_readfirstlane_b32 sources in WQM

We should avoid a situation where a v_readfirstlane_b32 is in WQM but it's
source is calculated in Exact.

Fixes hang when running Assassin's Creed: Valhalla benchmark.

fossil-db (GFX10.3):
Totals from 1021 (0.70% of 146267) affected shaders:
CodeSize: 7835228 -> 7842992 (+0.10%); split: -0.00%, +0.10%
Instrs: 1519208 -> 1521149 (+0.13%); split: -0.00%, +0.13%
SClause: 78921 -> 78920 (-0.00%)
Copies: 44456 -> 45421 (+2.17%); split: -0.05%, +2.22%
Branches: 12987 -> 13933 (+7.28%)
PreSGPRs: 47599 -> 47813 (+0.45%)
Cycles: 10037540 -> 10045304 (+0.08%); split: -0.00%, +0.08%
VMEM: 538381 -> 538777 (+0.07%); split: +0.11%, -0.03%
SMEM: 84553 -> 84554 (+0.00%); split: +0.01%, -0.01%

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

3 years agoci/piglit: fix parallel piglit results
Juan A. Suarez Romero [Thu, 25 Feb 2021 11:21:57 +0000 (12:21 +0100)]
ci/piglit: fix parallel piglit results

Commit bcea453d4a6 removed the summary from the expected piglit
results, but handling of results when using parallel jobs was also doing
the same, which ends up on removing too many lines from results.

Fixes: bcea453d4a6 ("ci/piglit: Stop including the test counts at the
end of expectations.")

Acked-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/9286>

3 years agonir: Add r600 specific CUBE opcode to evaluate cube texture coords and
Gert Wollny [Wed, 23 Dec 2020 15:19:31 +0000 (16:19 +0100)]
nir: Add r600 specific CUBE opcode to evaluate cube texture coords and
face

The opcode evaluates tha unnormalized coordinates, the length of the
major axis, and the cube face.

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

3 years agonir: Add flag to tex instruction to indicate lowering cube to array
Gert Wollny [Wed, 13 Jan 2021 09:28:59 +0000 (10:28 +0100)]
nir: Add flag to tex instruction to indicate lowering cube to array

E.g. r600 a cube texture lookup uses a specific cube instruction
to evaluate the sample coordinates and the face ID, so that the cube
texture lookup can be lowered to a array texture lookup, thereby sharing
the code with the 2D array texture lopkup.
However, for TXD the given gradients still need to be three-component
vectors, so add a flag that the NIR validation knows that we deal with
cube texture that was lowered to an array and can validate accordingly.

v2: Handle new flag in serialization (Marek)
v3: Rebase so that the change does not require the patch to deduct the
    number of offset and grad components from sampler type

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v2)
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9200>

3 years agozink: use pre-fetched format properties everywhere
Mike Blumenkrantz [Wed, 7 Oct 2020 16:46:38 +0000 (12:46 -0400)]
zink: use pre-fetched format properties everywhere

this is a noticeable perf improvement

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

3 years agozink: pre-fetch all format properties during screen init
Mike Blumenkrantz [Wed, 7 Oct 2020 16:45:04 +0000 (12:45 -0400)]
zink: pre-fetch all format properties during screen init

this ends up being a tradeoff where we waste a little startup time and
an extra ~4k memory for the overall screen object in exchange for never having
to fetch format properties again, which is a surprisingly expensive call
to be making as much as we have to make it

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

3 years agoi965: Eliminate all tabs except in brw_defines.h
Kenneth Graunke [Tue, 23 Feb 2021 03:04:39 +0000 (19:04 -0800)]
i965: Eliminate all tabs except in brw_defines.h

For a while we were doing 3-space indent with 8-space tabs, largely
due to the emacs settings of a couple of contributors.  We stopped
using tabs a long time ago, and they're just a nuisance at this point.

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

3 years agoi965: Rename DRI extension structs to be "brw" instead of "intel"
Kenneth Graunke [Tue, 23 Feb 2021 01:13:12 +0000 (17:13 -0800)]
i965: Rename DRI extension structs to be "brw" instead of "intel"

Matching the rest of the driver, and avoiding confusion with i915.

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

3 years agoi965: Rename more camel-case functions to brw and underscore style
Kenneth Graunke [Tue, 23 Feb 2021 00:46:16 +0000 (16:46 -0800)]
i965: Rename more camel-case functions to brw and underscore style

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

3 years agoi965: Rename some camel-case local variables
Kenneth Graunke [Tue, 23 Feb 2021 00:05:49 +0000 (16:05 -0800)]
i965: Rename some camel-case local variables

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

3 years agoi965: Rename intelInit and brwInit camel-case functions to brw_*
Kenneth Graunke [Mon, 22 Feb 2021 23:59:39 +0000 (15:59 -0800)]
i965: Rename intelInit and brwInit camel-case functions to brw_*

The driver style has been to use underscores for internal functions.

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

3 years agoi965: Rename the rest of intel_* functions to brw_*
Kenneth Graunke [Mon, 22 Feb 2021 19:43:46 +0000 (11:43 -0800)]
i965: Rename the rest of intel_* functions to brw_*

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

3 years agoi965: Rename intel_image_format and intel_buffer to brw_*
Kenneth Graunke [Mon, 22 Feb 2021 19:43:46 +0000 (11:43 -0800)]
i965: Rename intel_image_format and intel_buffer to brw_*

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

3 years agoi965: Rename intel_buffer_object to brw_buffer_object
Kenneth Graunke [Mon, 22 Feb 2021 19:37:49 +0000 (11:37 -0800)]
i965: Rename intel_buffer_object to brw_buffer_object

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

3 years agoi965: Use __func__ in blorp perf_debug macros
Kenneth Graunke [Tue, 23 Feb 2021 00:42:05 +0000 (16:42 -0800)]
i965: Use __func__ in blorp perf_debug macros

These had the function name baked into the perf_debug message, which
after a bunch of refactoring, was out of sync with the actual code.

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

3 years agoi965: Rename intel_mip* to brw_mip*.
Kenneth Graunke [Mon, 22 Feb 2021 19:01:33 +0000 (11:01 -0800)]
i965: Rename intel_mip* to brw_mip*.

With lots of indentation fixes.

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

3 years agoi965: Rename intel_renderbuffer to brw_renderbuffer
Kenneth Graunke [Mon, 22 Feb 2021 18:43:42 +0000 (10:43 -0800)]
i965: Rename intel_renderbuffer to brw_renderbuffer

For now, keeping the 'irb' name on local variables.

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

3 years agoi965: Rename intel_texture_{object,image} to brw_texture_{object,image}
Kenneth Graunke [Mon, 22 Feb 2021 18:41:26 +0000 (10:41 -0800)]
i965: Rename intel_texture_{object,image} to brw_texture_{object,image}

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

3 years agoi965: Rename intel_screen to brw_screen
Kenneth Graunke [Mon, 22 Feb 2021 18:40:10 +0000 (10:40 -0800)]
i965: Rename intel_screen to brw_screen

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

3 years agoi965: Rename intel_batchbuffer_* to brw_batch_*.
Kenneth Graunke [Mon, 22 Feb 2021 18:35:03 +0000 (10:35 -0800)]
i965: Rename intel_batchbuffer_* to brw_batch_*.

Shorter, matching the convention in iris, and drops use of "intel_"
on i965-specific code that isn't shared.

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

3 years agoi965: Rename use_intel_mipree_map_blit to use_blitter_to_map
Kenneth Graunke [Mon, 22 Feb 2021 19:04:53 +0000 (11:04 -0800)]
i965: Rename use_intel_mipree_map_blit to use_blitter_to_map

Mip...ree?  Use a more descriptive name instead of just fixing the typo.

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

3 years agofreedreno: Add macro for duration based warns
Rob Clark [Wed, 24 Feb 2021 19:21:01 +0000 (11:21 -0800)]
freedreno: Add macro for duration based warns

Add a macro to do a perf_debug() if a block of code takes longer than a
specified amount of time.

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

3 years agofreedreno: Slight perf_debug rework
Rob Clark [Wed, 24 Feb 2021 20:36:56 +0000 (12:36 -0800)]
freedreno: Slight perf_debug rework

Allow ctx to be NULL in perf_debug_ctx() and make perf_debug() a
shortcut for perf_debug_ctx(NULL, ...) to simplify things slightly
in the next patch.

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