mesa.git
6 years agobroadcom/vc5: Fix a race between XML codegen build and CLIF build.
Eric Anholt [Sat, 27 Jan 2018 07:50:10 +0000 (18:50 +1100)]
broadcom/vc5: Fix a race between XML codegen build and CLIF build.

6 years agoAndroid: Attempt to fix broadcom build after vc5 changes.
Eric Anholt [Wed, 17 Jan 2018 20:46:35 +0000 (12:46 -0800)]
Android: Attempt to fix broadcom build after vc5 changes.

6 years agoac: rename and move si_const_array into common code
Marek Olšák [Sun, 31 Dec 2017 22:35:59 +0000 (23:35 +0100)]
ac: rename and move si_const_array into common code

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoac: move address space definitions to common code
Marek Olšák [Mon, 1 Jan 2018 20:03:29 +0000 (21:03 +0100)]
ac: move address space definitions to common code

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoac: don't use byval LLVM qualifier in shaders
Marek Olšák [Sun, 31 Dec 2017 23:30:51 +0000 (00:30 +0100)]
ac: don't use byval LLVM qualifier in shaders

shader-db doesn't show any regression and 32-bit pointers with byval
are declared as VGPRs for some reason.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agogallium/radeon: set number of pb_cache buckets = number of heaps
Marek Olšák [Mon, 1 Jan 2018 21:58:43 +0000 (22:58 +0100)]
gallium/radeon: set number of pb_cache buckets = number of heaps

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agopb_cache: let drivers choose the number of buckets
Marek Olšák [Mon, 1 Jan 2018 21:47:36 +0000 (22:47 +0100)]
pb_cache: let drivers choose the number of buckets

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agopb_cache: call os_time_get outside of the loop
Marek Olšák [Mon, 1 Jan 2018 21:38:14 +0000 (22:38 +0100)]
pb_cache: call os_time_get outside of the loop

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agogallium/radeon: simplify radeon_flags_from_heap
Marek Olšák [Sun, 31 Dec 2017 19:42:27 +0000 (20:42 +0100)]
gallium/radeon: simplify radeon_flags_from_heap

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agost/shader_cache: restore num_tgsi_tokens when loading from cache
Timothy Arceri [Fri, 26 Jan 2018 00:56:50 +0000 (11:56 +1100)]
st/shader_cache: restore num_tgsi_tokens when loading from cache

Without this we will fail to correctly serialise programs when
using glGetProgramBinary() if the program was retrieved from
the disk cache rather than freshly compiled.

Fixes: c69b0dd6817b "st/glsl_to_tgsi: store num_tgsi_tokens in st_*_program"
Reviewed-by: Gert Wollny <gw.fossdev@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104762

6 years agowinsys/amdgpu: fix assertion failure with UVD and VCE rings
Marek Olšák [Fri, 26 Jan 2018 02:48:37 +0000 (03:48 +0100)]
winsys/amdgpu: fix assertion failure with UVD and VCE rings

Cc: 18.0 <mesa-stable@lists.freedesktop.org>
6 years agomesa: remove MESA_FUNCTION
Brian Paul [Thu, 25 Jan 2018 20:44:19 +0000 (13:44 -0700)]
mesa: remove MESA_FUNCTION

Just use __func__ in the two macros where it was used.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
6 years agomesa: change gl_link_status enums to uppercase
Brian Paul [Thu, 25 Jan 2018 19:50:12 +0000 (12:50 -0700)]
mesa: change gl_link_status enums to uppercase

follow the convention of other enums.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
6 years agomesa: change gl_compile_status enums to uppercase
Brian Paul [Thu, 25 Jan 2018 19:43:48 +0000 (12:43 -0700)]
mesa: change gl_compile_status enums to uppercase

To follow the convention of other enums.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
6 years agomesa: minor comment reformatting, whitespace fixes in mtypes.h
Brian Paul [Thu, 25 Jan 2018 19:37:14 +0000 (12:37 -0700)]
mesa: minor comment reformatting, whitespace fixes in mtypes.h

Trivial.

6 years agoi965/gen10: Use CS Stall instead of WriteImmediate.
Rafael Antognolli [Fri, 26 Jan 2018 19:19:31 +0000 (11:19 -0800)]
i965/gen10: Use CS Stall instead of WriteImmediate.

Fixes: ca19ee33d7d39cb89d948b1c983763065975ce5b
Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoanv/gen10: Emit CS stall and mark push constants dirty.
Rafael Antognolli [Fri, 26 Jan 2018 19:15:47 +0000 (11:15 -0800)]
anv/gen10: Emit CS stall and mark push constants dirty.

I got reviews and fixed the patches locally, but ended up merging the
ones that I sent originally to the list. This patch fixes those
mistakes.

Fixes: 78c125af3904c539ea69bec2dd9fdf7a5162854f
Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Cc: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoi965/gen10: Re-enable push constants.
Rafael Antognolli [Thu, 25 Jan 2018 00:33:58 +0000 (16:33 -0800)]
i965/gen10: Re-enable push constants.

The GPU hang caused by push constants is apparently fixed, so let's
enable them again.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Cc: "18.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoanv/gen10: Ignore push constant packets during context restore.
Rafael Antognolli [Thu, 25 Jan 2018 00:33:57 +0000 (16:33 -0800)]
anv/gen10: Ignore push constant packets during context restore.

Similar to the GL driver, ignore 3DSTATE_CONSTANT_* packets when doing a
context restore.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Cc: Jason Ekstrand <jason@jlekstrand.net>
Cc: "18.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoi965/gen10: Ignore push constant packets during context restore.
Rafael Antognolli [Thu, 25 Jan 2018 00:33:56 +0000 (16:33 -0800)]
i965/gen10: Ignore push constant packets during context restore.

These packets were causing GPU hangs when the context was restored,
possibly because they were pointing to BO's that were already
unreferenced. So we tell the hardware to ignore such packets after the
batch buffer ends, since we know those BO's are not around anymore.

This change fixes GPU hangs on CNL. The (partial) solution to this
problem so far was to entirely disable push constants on this platform.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Cc: "18.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agomesa: silence MinGW 'may be unused uninitialized' warning in get.c
Brian Paul [Thu, 25 Jan 2018 21:37:34 +0000 (14:37 -0700)]
mesa: silence MinGW 'may be unused uninitialized' warning in get.c

The warning happens on line 2114 for the memcpy(data, p, size) call.
I'm not sure why that generates the warning but not the earlier use
of p in the code.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
6 years agomesa: Fix function pointers initialization in status tracker
Eleni Maria Stea [Thu, 25 Jan 2018 20:09:00 +0000 (13:09 -0700)]
mesa: Fix function pointers initialization in status tracker

We assigned the function that gets the device uuid to the GetDriverUuid
function pointer and the function that gets the driver uuid to the
GetDeviceUuid function pointer inside the state tracker. Exchanged the
pointers.

cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
6 years agoanv/pipeline: remove the pipeline layout field from anv_pipeline
Iago Toral Quiroga [Thu, 25 Jan 2018 11:07:34 +0000 (12:07 +0100)]
anv/pipeline: remove the pipeline layout field from anv_pipeline

It no longer has any users.

Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoanv/cmd_buffer: add the pipeline layout to the pipeline state
Iago Toral Quiroga [Thu, 25 Jan 2018 10:54:35 +0000 (11:54 +0100)]
anv/cmd_buffer: add the pipeline layout to the pipeline state

We need to access the pipeline layout to compute correct dynamic
offsets for dyamic UBO/SSBO descriptors when we emit draw commands.
Instead of taking it from the pipeline object, store the layout
in the command buffer pipeline state.

Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoanv/pipeline: don't take the layout from the pipeline to compile shaders
Iago Toral Quiroga [Thu, 25 Jan 2018 09:25:00 +0000 (10:25 +0100)]
anv/pipeline: don't take the layout from the pipeline to compile shaders

The Vulkan spec states that VkPipelineLayout objects must not be
destroyed while any command buffer that uses them is in the recording
state, but it permits them to be destroyed otherwise. This means that
applications are allowed to free pipeline layouts after command recording
is finished even if there are pipeline objects that still exist and were
created with these layouts.

There are two solutions to this, one is to use reference counting on
pipeline layout objects. The other is to avoid holding references to
pipeline layouts where they are not really needed.

This patch takes a step towards the second option by making the
pipeline shader compile code take pipeline layout from the
VkGraphicsPipelineCreateInfo provided rather than the pipeline
object.

A follow-up patch will remove any remaining uses of the layout field
so we can remove it from the pipeline object and avoid the need
for reference counting.

v2: Use ANV_FROM_HANDLE, remove unnecessary braces (Jason)

Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoanv/descriptor_set: add reference counting for descriptor set layouts
Iago Toral Quiroga [Thu, 25 Jan 2018 08:43:22 +0000 (09:43 +0100)]
anv/descriptor_set: add reference counting for descriptor set layouts

The spec states that descriptor set layouts can be destroyed almost
at any time:

   "VkDescriptorSetLayout objects may be accessed by commands that
    operate on descriptor sets allocated using that layout, and those
    descriptor sets must not be updated with vkUpdateDescriptorSets
    after the descriptor set layout has been destroyed. Otherwise,
    descriptor set layouts can be destroyed any time they are not in
    use by an API command."

v2: allocate off the device allocator with DEVICE scope (Jason)

Fixes the following work-in-progress CTS tests:
dEQP-VK.api.descriptor_set.descriptor_set_layout_lifetime.graphics
dEQP-VK.api.descriptor_set.descriptor_set_layout_lifetime.compute

Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoac/nir: set amdgpu.uniform and invariant.load for SSBOs
Samuel Pitoiset [Wed, 24 Jan 2018 22:26:21 +0000 (23:26 +0100)]
ac/nir: set amdgpu.uniform and invariant.load for SSBOs

For descriptors.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoac/nir: set amdgpu.uniform and invariant.load for UBOs
Samuel Pitoiset [Wed, 24 Jan 2018 22:26:20 +0000 (23:26 +0100)]
ac/nir: set amdgpu.uniform and invariant.load for UBOs

UBOs are constants buffers.

Cc: "18.0" <mesa-stable@lists.freedesktop.org>
Fixes: 41c36c45 ("amd/common: use ac_build_buffer_load() for emitting UBO loads")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Tested-by: Alex Smith <asmith@feralinteractive.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoac/nir: set the noalias attribute on input pointers
Samuel Pitoiset [Wed, 24 Jan 2018 22:26:18 +0000 (23:26 +0100)]
ac/nir: set the noalias attribute on input pointers

This attribute is similar to the definition of restrict in
C99 and it might help LLVM.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoac: only load used channels when sampling buffer views
Samuel Pitoiset [Wed, 10 Jan 2018 19:12:11 +0000 (20:12 +0100)]
ac: only load used channels when sampling buffer views

This allows to reduce the number of dwords that are loaded
with buffer_load_format_xyzw. For example, when the only used
channel is 1, the driver will emit buffer_load_format_x instead.

Shader stats for DOW3 (with some local hacky scripts for SPIRV):

143 shaders in 143 tests
Totals:
SGPRS: 5344 -> 5352 (0.15 %)
VGPRS: 3476 -> 3452 (-0.69 %)
Spilled SGPRs: 30 -> 29 (-3.33 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 269860 -> 269808 (-0.02 %) bytes
LDS: 0 -> 0 (0.00 %) blocks
Max Waves: 1267 -> 1272 (0.39 %)
Wait states: 0 -> 0 (0.00 %)

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoac: pass the number of channels to ac_build_buffer_load_format()
Samuel Pitoiset [Wed, 10 Jan 2018 19:12:10 +0000 (20:12 +0100)]
ac: pass the number of channels to ac_build_buffer_load_format()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoac: add ac_build_buffer_load_common() helper
Samuel Pitoiset [Wed, 10 Jan 2018 19:12:09 +0000 (20:12 +0100)]
ac: add ac_build_buffer_load_common() helper

For both versions of llvm.amdgcn.buffer.load.{format}.*.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoradv: fix RADV_DEBUG=syncshaders on GFX9
Samuel Pitoiset [Thu, 25 Jan 2018 14:46:51 +0000 (15:46 +0100)]
radv: fix RADV_DEBUG=syncshaders on GFX9

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: fix a GPU hang with RADV_DEBUG=syncshaders
Samuel Pitoiset [Thu, 25 Jan 2018 14:46:50 +0000 (15:46 +0100)]
radv: fix a GPU hang with RADV_DEBUG=syncshaders

The GPU hangs when the driver forces a PS_PARTIAL_FLUSH after
a dispatch call (and vice versa for graphics). Something has
changed in the kernel driver because it used to work.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoac/shader: scan if fragment shaders write memory
Samuel Pitoiset [Wed, 24 Jan 2018 16:44:35 +0000 (17:44 +0100)]
ac/shader: scan if fragment shaders write memory

It's better to do that in ac_shader_info.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoac/nir: only canonicalize 32-bit float min/max outputs on pre-GFX9
Samuel Pitoiset [Wed, 24 Jan 2018 11:31:40 +0000 (12:31 +0100)]
ac/nir: only canonicalize 32-bit float min/max outputs on pre-GFX9

According to LLVM, only pre-GFX9 targets do not flush denorms
for fmin/fmax.

All dEQP-VK.glsl.builtin.precision.* still pass.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoanv/pipeline: Don't look at blend state unless we have an attachment
Jason Ekstrand [Thu, 18 Jan 2018 01:10:34 +0000 (17:10 -0800)]
anv/pipeline: Don't look at blend state unless we have an attachment

Without this, we may end up dereferencing blend before we check for
binding->index != UINT32_MAX.  However, Vulkan allows the blend state to
be NULL so long as you don't have any color attachments.  This fixes a
segfault when running The Talos Principal.

Fixes: 12f4e00b69e724a23504b7bd3958fb75dc462950
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Smith <asmith@feralinteractive.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agoanv_icd.py: improve reproducible builds
Maxin B. John [Thu, 18 Jan 2018 11:33:37 +0000 (13:33 +0200)]
anv_icd.py: improve reproducible builds

Sort the output to ensure build reproducibility

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Fixes: 0ab04ba979b ("anv: Use python to generate ICD json files")
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agonouveau: Remove no-op nvgl_logicop_func function
Ian Romanick [Thu, 4 Jan 2018 02:28:57 +0000 (18:28 -0800)]
nouveau: Remove no-op nvgl_logicop_func function

The values that this function returned were always the values passed
in.  The only thing that happened was either an assertion or undefined
results when an unknown value was passed in.  This doesn't seem that
useful.  Most of nouveau_gldefs.h could be removed in this manner.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
6 years agoi915: Silence unused parameter warnings
Ian Romanick [Wed, 3 Jan 2018 21:29:13 +0000 (13:29 -0800)]
i915: Silence unused parameter warnings

../../SOURCE/master/src/mesa/drivers/dri/i915/intel_fbo.c: In function ‘intel_alloc_window_storage’:
../../SOURCE/master/src/mesa/drivers/dri/i915/intel_fbo.c:290:48: warning: unused parameter ‘ctx’ [-Wunused-parameter]
 intel_alloc_window_storage(struct gl_context * ctx, struct gl_renderbuffer *rb,
                                                ^~~
../../SOURCE/master/src/mesa/drivers/dri/i915/intel_fbo.c: In function ‘intel_nop_alloc_storage’:
../../SOURCE/master/src/mesa/drivers/dri/i915/intel_fbo.c:303:74: warning: unused parameter ‘rb’ [-Wunused-parameter]
 intel_nop_alloc_storage(struct gl_context * ctx, struct gl_renderbuffer *rb,
                                                                          ^~
../../SOURCE/master/src/mesa/drivers/dri/i915/intel_fbo.c:304:32: warning: unused parameter ‘internalFormat’ [-Wunused-parameter]
                         GLenum internalFormat, GLuint width, GLuint height)
                                ^~~~~~~~~~~~~~
../../SOURCE/master/src/mesa/drivers/dri/i915/intel_fbo.c:304:55: warning: unused parameter ‘width’ [-Wunused-parameter]
                         GLenum internalFormat, GLuint width, GLuint height)
                                                       ^~~~~
../../SOURCE/master/src/mesa/drivers/dri/i915/intel_fbo.c:304:69: warning: unused parameter ‘height’ [-Wunused-parameter]
                         GLenum internalFormat, GLuint width, GLuint height)
                                                                     ^~~~~~
../../SOURCE/master/src/mesa/drivers/dri/i915/intel_fbo.c: In function ‘intel_bind_framebuffer’:
../../SOURCE/master/src/mesa/drivers/dri/i915/intel_fbo.c:396:47: warning: unused parameter ‘fb’ [-Wunused-parameter]
                        struct gl_framebuffer *fb, struct gl_framebuffer *fbread)
                                               ^~
../../SOURCE/master/src/mesa/drivers/dri/i915/intel_fbo.c:396:74: warning: unused parameter ‘fbread’ [-Wunused-parameter]
                        struct gl_framebuffer *fb, struct gl_framebuffer *fbread)
                                                                          ^~~~~~
../../SOURCE/master/src/mesa/drivers/dri/i915/intel_fbo.c: In function ‘intel_renderbuffer_update_wrapper’:
../../SOURCE/master/src/mesa/drivers/dri/i915/intel_fbo.c:422:57: warning: unused parameter ‘intel’ [-Wunused-parameter]
 intel_renderbuffer_update_wrapper(struct intel_context *intel,
                                                         ^~~~~
../../SOURCE/master/src/mesa/drivers/dri/i915/intel_fbo.c: In function ‘intel_blit_framebuffer_with_blitter’:
../../SOURCE/master/src/mesa/drivers/dri/i915/intel_fbo.c:644:61: warning: unused parameter ‘filter’ [-Wunused-parameter]
                                     GLbitfield mask, GLenum filter)
                                                             ^~~~~~

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
6 years agoi915: Make intelEmitCopyBlit static
Ian Romanick [Wed, 3 Jan 2018 20:43:24 +0000 (12:43 -0800)]
i915: Make intelEmitCopyBlit static

And rename to emit_copy_blit.

v2: sed --in-place -e 's/color_logic_ops/gl_logicop_mode/g' $(grep -lr
color_logic_ops src/) suggested by Brian.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> [v1]
6 years agoi965: Make intelEmitCopyBlit static
Ian Romanick [Wed, 3 Jan 2018 20:40:00 +0000 (12:40 -0800)]
i965: Make intelEmitCopyBlit static

And rename to emit_copy_blit.

v2: sed --in-place -e 's/color_logic_ops/gl_logicop_mode/g' $(grep -lr
color_logic_ops src/) suggested by Brian.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> [v1]
6 years agoi915: Use enum color_logic_ops for blits
Ian Romanick [Wed, 3 Jan 2018 20:33:20 +0000 (12:33 -0800)]
i915: Use enum color_logic_ops for blits

v2: sed --in-place -e 's/color_logic_ops/gl_logicop_mode/g' $(grep -lr
color_logic_ops src/) suggested by Brian.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> [v1]
6 years agoi965: Use enum color_logic_ops for blits
Ian Romanick [Wed, 3 Jan 2018 20:03:58 +0000 (12:03 -0800)]
i965: Use enum color_logic_ops for blits

v2: sed --in-place -e 's/color_logic_ops/gl_logicop_mode/g' $(grep -lr
color_logic_ops src/) suggested by Brian.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> [v1]
6 years agomesa: Pass the translated color logic op dd_function_table::LogicOpcode
Ian Romanick [Wed, 3 Jan 2018 19:45:58 +0000 (11:45 -0800)]
mesa: Pass the translated color logic op dd_function_table::LogicOpcode

And delete the resulting dead code.  This has only been compile-tested.

v2: sed --in-place -e 's/color_logic_ops/gl_logicop_mode/g' $(grep -lr
color_logic_ops src/) suggested by Brian.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agost/mesa: Use the translated color logic op from the context
Ian Romanick [Wed, 3 Jan 2018 19:44:17 +0000 (11:44 -0800)]
st/mesa: Use the translated color logic op from the context

And delete the resulting dead code.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoi965: Use the translated color logic op from the context
Ian Romanick [Wed, 3 Jan 2018 19:43:10 +0000 (11:43 -0800)]
i965: Use the translated color logic op from the context

And delete the resulting dead code.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
6 years agomesa: Also track a remapped version of the color logic op
Ian Romanick [Wed, 3 Jan 2018 19:26:41 +0000 (11:26 -0800)]
mesa: Also track a remapped version of the color logic op

With the exception of NVIDIA hardware, these are is the values that all
hardware and Gallium want.  The remapping is currently implemented in at
least 6 places.  This starts the process of consolidating to a single
place.

v2: sed --in-place -e 's/color_logic_ops/gl_logicop_mode/g' $(grep -lr
color_logic_ops src/) suggested by Brian.  Added some comments about the
selection of bit patterns for gl_logicop_mode and the GLenums.
Suggested by Nicolai.  Folded the GLenum_to_color_logicop macro into its
only users.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com> [v1]
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoradeonsi: Export signalled sync file instead of -1.
Bas Nieuwenhuizen [Thu, 25 Jan 2018 15:48:17 +0000 (16:48 +0100)]
radeonsi: Export signalled sync file instead of -1.

-1 is considered an error for EGL_ANDROID_native_fence_sync, so
we need to actually create a sync file.

Fixes: f536f45250 "radeonsi: implement sync_file import/export"
Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agoi965/fs: Reset the register file to VGRF in lower_integer_multiplication
Jason Ekstrand [Fri, 15 Dec 2017 06:10:10 +0000 (22:10 -0800)]
i965/fs: Reset the register file to VGRF in lower_integer_multiplication

18fde36ced4279f2577097a1a7d31b55f2f5f141 changed the way temporary
registers were allocated in lower_integer_multiplication so that we
allocate regs_written(inst) space and keep the stride of the original
destination register.  This was to ensure that any MUL which originally
followed the CHV/BXT integer multiply regioning restrictions would
continue to follow those restrictions even after lowering.  This works
fine except that I forgot to reset the register file to VGRF so, even
though they were assigned a number from alloc.allocate(), they had the
wrong register file.  This caused some GLES 3.0 CTS tests to start
failing on Sandy Bridge due to attempted reads from the MRF:

    ES3-CTS.functional.shaders.precision.int.highp_mul_fragment.snbm64
    ES3-CTS.functional.shaders.precision.int.mediump_mul_fragment.snbm64
    ES3-CTS.functional.shaders.precision.int.lowp_mul_fragment.snbm64
    ES3-CTS.functional.shaders.precision.uint.highp_mul_fragment.snbm64
    ES3-CTS.functional.shaders.precision.uint.mediump_mul_fragment.snbm64
    ES3-CTS.functional.shaders.precision.uint.lowp_mul_fragment.snbm64

This commit remedies this problem by, instead of copying inst->dst and
overwriting nr, just make a new register and set the region to match
inst->dst.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103626
Fixes: 18fde36ced4279f2577097a1a7d31b55f2f5f141
Cc: "17.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
6 years agovulkan: Update the XML and headers to 1.0.68
Jason Ekstrand [Thu, 25 Jan 2018 03:01:47 +0000 (19:01 -0800)]
vulkan: Update the XML and headers to 1.0.68

Acked-by: Dave Airlie <airlied@redhat.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Chad Versace <chadversary@chromium.org>
6 years agoradv: don't enable tc compat for d32s8 + 4/8 samples (v1.1)
Dave Airlie [Wed, 24 Jan 2018 23:29:55 +0000 (09:29 +1000)]
radv: don't enable tc compat for d32s8 + 4/8 samples (v1.1)

This seems to be broken, at least the cts tests fail.

This fixes:
dEQP-VK.renderpass.suballocation.multisample.d32_sfloat_s8_uint.samples_4
dEQP-VK.renderpass.suballocation.multisample.d32_sfloat_s8_uint.samples_8

2 samples seems to pass fine, amdvlk doesn't appear to enable TC for
possibly some other reasons here.

This is most likely a hack.

v1.1: add a bit of explaination text. (Samuel)
Fixes: ad3d98da9 (radv: enable tc compatible htile for d32s8 also.)
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoconfigure.ac: add missing llvm dependencies to .pc files
Chuck Atkins [Tue, 23 Jan 2018 13:52:46 +0000 (08:52 -0500)]
configure.ac: add missing llvm dependencies to .pc files

v2: Only add as dependencies for gallium-osmesa and gallium-xlib

CC: <mesa-stable@lists.freedesktop.org>
Signed-of-by: Chuck Atkins <chuck.atkins@kitware.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoswr/rast: Optimize DumpToFile output size
George Kyriazis [Wed, 24 Jan 2018 20:15:02 +0000 (14:15 -0600)]
swr/rast: Optimize DumpToFile output size

Modify DumpToFile to only dump the function, not the entire module.
Reduces file sizes and speeds up the dumping.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
6 years agoswr/rast: Updated copyright dates
George Kyriazis [Wed, 24 Jan 2018 01:29:05 +0000 (19:29 -0600)]
swr/rast: Updated copyright dates

on knob-related files.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
6 years agoswr/rast: Move memory-related JIT functions
George Kyriazis [Tue, 23 Jan 2018 01:23:32 +0000 (19:23 -0600)]
swr/rast: Move memory-related JIT functions

Move them to their own file (builder_mem.{h|cpp}).  Add builder_mem.cpp
to the build system.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
6 years agoswr/rast: Add extra (optional) parameter in GATHERPS
George Kyriazis [Tue, 23 Jan 2018 07:51:00 +0000 (01:51 -0600)]
swr/rast: Add extra (optional) parameter in GATHERPS

Now also takes in an additional parameter (draw context) for future
expansion.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
6 years agoswr/rast: Better ExecCmd (i.e. system()) implmentation
George Kyriazis [Sat, 20 Jan 2018 00:03:16 +0000 (18:03 -0600)]
swr/rast: Better ExecCmd (i.e. system()) implmentation

Hides console window creation during JIT linker execution in apps that
don't have a console.  Remove hooking of CreateProcessInternalA - the
MSFT implementation just turns around and calls CreateProcessInternalW
which, we do hook.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
6 years agoswr/rast: Support USE_SIMD16_FRONTEND=0 for EarlyRast
George Kyriazis [Fri, 19 Jan 2018 23:58:33 +0000 (17:58 -0600)]
swr/rast: Support USE_SIMD16_FRONTEND=0 for EarlyRast

Early Rasterization did not initially work with USE_SIMD16_FRONTEND=0.
Fix it so it works there, too.  Please note that the default setting
is USE_SIMD16_FRONTEND=1.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
6 years agomesa: whitespace fixes in attrib.c
Brian Paul [Thu, 25 Jan 2018 16:56:06 +0000 (09:56 -0700)]
mesa: whitespace fixes in attrib.c

Trivial.

6 years agomesa: whitespace fixes in varray.h
Brian Paul [Thu, 25 Jan 2018 16:19:10 +0000 (09:19 -0700)]
mesa: whitespace fixes in varray.h

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
6 years agomesa: include mtypes.h in varray.h
Brian Paul [Thu, 25 Jan 2018 16:16:54 +0000 (09:16 -0700)]
mesa: include mtypes.h in varray.h

We actually use some of the types from mtypes.h so include it directly
instead of relying on indirectly including it via bufferobj.h

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
6 years agomesa: s/gl_vertex_attrib_array/gl_array_attributes/ in comments
Brian Paul [Thu, 25 Jan 2018 16:12:59 +0000 (09:12 -0700)]
mesa: s/gl_vertex_attrib_array/gl_array_attributes/ in comments

The structure type was renamed some time ago, but some comments
were not updated.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
6 years agomesa: simplify _mesa_delete_list() a bit, add some assertions
Brian Paul [Sat, 20 Jan 2018 03:57:24 +0000 (20:57 -0700)]
mesa: simplify _mesa_delete_list() a bit, add some assertions

All but two cases of the switch did the same n += InstSize[n[0].opcode]
instruction.  Just move it after the switch.

Add some sanity check assertions.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
6 years agost/mesa: expand glDrawPixels cache to handle multiple images
Brian Paul [Fri, 12 Jan 2018 16:32:41 +0000 (09:32 -0700)]
st/mesa: expand glDrawPixels cache to handle multiple images

The newest version of WSI Fusion makes several glDrawPixels calls
per frame.  By caching more than one image, we get better performance
when panning/zooming the map.

v2: move pixel unpack param checking out of cache search loop, per Roland
v3: also move unpack->BufferObj check out of loop, per Roland.

6 years agost/mesa: add some debug code in st_choose_format()
Brian Paul [Thu, 11 Jan 2018 18:53:02 +0000 (11:53 -0700)]
st/mesa: add some debug code in st_choose_format()

To aid in debugging gallium surface format selection issues.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
6 years agosvga: s/Bool/SVGA3dBool/ in SVGA3dDevCapResult
Brian Paul [Thu, 25 Jan 2018 18:36:53 +0000 (11:36 -0700)]
svga: s/Bool/SVGA3dBool/ in SVGA3dDevCapResult

And fix whitespace.  To sync up with in-house code.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
6 years agoconfigure.ac: correct driglx-direct help text
Emil Velikov [Wed, 20 Dec 2017 17:34:55 +0000 (17:34 +0000)]
configure.ac: correct driglx-direct help text

The default was toggled a while back, but the text wasn't updated.

Fixes: bd526ec9e1b ("configure: Always default to
--enable-driglx-direct")
Cc: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
6 years agoswrast: remove non-applicable GLX_SWAP_COPY_OML comment
Emil Velikov [Thu, 7 Dec 2017 17:07:39 +0000 (17:07 +0000)]
swrast: remove non-applicable GLX_SWAP_COPY_OML comment

Noticed while skimming for GLX_ instances in the dri codebase.
Comment is completely off and was in such a state since day 1.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
6 years agomapi: remove duplicate GL typedefs
Emil Velikov [Thu, 7 Dec 2017 17:07:38 +0000 (17:07 +0000)]
mapi: remove duplicate GL typedefs

Remove the instances already available in gl.h or glext.h.
Sadly GLclampx is only available in GLES(1) so we need to keep that one.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
6 years agomapi: remove non applicable HAVE_DIX_CONFIG_H hunk
Emil Velikov [Thu, 7 Dec 2017 17:07:37 +0000 (17:07 +0000)]
mapi: remove non applicable HAVE_DIX_CONFIG_H hunk

Seeming artefact from when the xserver build was diving directly into
mesa's tree.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
6 years agomapi: autotools: remove unused MAPI_FILES file list
Emil Velikov [Thu, 7 Dec 2017 17:07:36 +0000 (17:07 +0000)]
mapi: autotools: remove unused MAPI_FILES file list

The sole user was OpenVG, which was removed couple of years ago.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
6 years agoautomake: st/mesa/tests: add st_tests_common.h to the tarball
Emil Velikov [Thu, 25 Jan 2018 15:31:10 +0000 (15:31 +0000)]
automake: st/mesa/tests: add st_tests_common.h to the tarball

Fixes: 6569b33b6ee ("mesa/st/tests: unify MockCodeLine* classes")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoautomake: mesa: include vbo_private.h in the tarball
Emil Velikov [Thu, 25 Jan 2018 15:27:20 +0000 (15:27 +0000)]
automake: mesa: include vbo_private.h in the tarball

Fixes: a7cfec3be0e ("vbo: move VBO-private types, prototypes, etc. into
new vbo_private.h header")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoautomake: small cleanup after the meson.build inclusion
Emil Velikov [Tue, 23 Jan 2018 13:04:57 +0000 (13:04 +0000)]
automake: small cleanup after the meson.build inclusion

Namely extend the EXTRA_DIST list, instead of re-assigning it and bring
back a file dropped by mistake.

Fixes: 436ed65d38d ("autotools: include meson build files in tarball")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
6 years agoautomake: anv: ship anv_extensions_gen.py in the tarball
Emil Velikov [Tue, 23 Jan 2018 13:02:50 +0000 (13:02 +0000)]
automake: anv: ship anv_extensions_gen.py in the tarball

Fixes: dd088d4bec7 ("anv/extensions: Generate a header file with
extension tables")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoautomake: vc5: remove non-applicable v3dx_simulator.h
Emil Velikov [Tue, 23 Jan 2018 11:52:49 +0000 (11:52 +0000)]
automake: vc5: remove non-applicable v3dx_simulator.h

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
6 years agogallivm: fix crash with seamless cube filtering with different min/mag filter
Roland Scheidegger [Thu, 25 Jan 2018 03:30:41 +0000 (04:30 +0100)]
gallivm: fix crash with seamless cube filtering with different min/mag filter

We are not allowed to modify the incoming coords values, or things may
crash (as we may be inside a llvm conditional and the values may be used
in another branch).
I recently broke this when fixing an issue with NaNs and seamless cube
map filtering, and it causes crashes when doing cubemap filtering
if the min and mag filters are different.
Add const to the pointers passed in to prevent this mishap in the future.

Fixes: a485ad0bcd ("gallivm: fix an issue with NaNs with seamless cube filtering")
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
6 years agoegl: keep extension list sorted, per comment at the top
Eric Engestrom [Mon, 8 Jan 2018 15:47:09 +0000 (15:47 +0000)]
egl: keep extension list sorted, per comment at the top

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
6 years agoswr/rast: support llvm 3.9 type declarations
George Kyriazis [Tue, 23 Jan 2018 22:12:42 +0000 (16:12 -0600)]
swr/rast: support llvm 3.9 type declarations

LLVM 3.9 was not taken into account in initial check-in.

Fixes: 01ab218bbc ("swr/rast: Initial work for debugging support.")
cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104749
Acked-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
6 years agoac/nir: add break statements in needs_view_index_sgpr()
Samuel Pitoiset [Thu, 25 Jan 2018 09:49:23 +0000 (10:49 +0100)]
ac/nir: add break statements in needs_view_index_sgpr()

Previous code is correct but as the first case statement uses
a break, keep it consistent.

CID: 1428579
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoloader: let compiler figure out the length of the string
Eric Engestrom [Tue, 19 Dec 2017 14:12:44 +0000 (14:12 +0000)]
loader: let compiler figure out the length of the string

Basically, turn comment into code

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agomeson: simplify dri3 logic
Eric Engestrom [Thu, 7 Dec 2017 16:04:14 +0000 (16:04 +0000)]
meson: simplify dri3 logic

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
6 years agomesa: add missing RGB9_E5 format in _mesa_base_fbo_format
Juan A. Suarez Romero [Mon, 15 Jan 2018 10:58:50 +0000 (10:58 +0000)]
mesa: add missing RGB9_E5 format in _mesa_base_fbo_format

This fixes KHR-GL45.internalformat.renderbuffer.rgb9_e5.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
6 years agoi965: Stop disabling aux during texture preparation
Jason Ekstrand [Wed, 24 Jan 2018 19:51:08 +0000 (11:51 -0800)]
i965: Stop disabling aux during texture preparation

Previously, we were handling self-dependencies by marking the render
buffer and then passing disable_aux=true to prepare_texture so that it
would do a resolve.  This works but ends us up doing to much resolving
in some cases.  Specifically, if we're doing something such as mipmap
generation, this would cause us to resolve all levels of the texture if
even one of them is overlapping.

Instead, this commit makes us wait until we process the framebuffer to
do these resolves and we only resolve the slices needed for rendering.
Doing this resolve puts them into the pass-through state so, even if we
do texture using CCS_E, the CCS data will effectively be ignored and the
real surface contents read.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
6 years agoi965/draw: Set NEW_AUX_STATE when draw aux changes
Jason Ekstrand [Wed, 24 Jan 2018 07:47:26 +0000 (23:47 -0800)]
i965/draw: Set NEW_AUX_STATE when draw aux changes

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104411
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104383
Fixes: ea0d2e98ecb369ab84e78c84709c0930ea8c293a
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
6 years agoi965: Replace draw_aux_buffer_disabled with draw_aux_usage
Jason Ekstrand [Wed, 24 Jan 2018 07:13:10 +0000 (23:13 -0800)]
i965: Replace draw_aux_buffer_disabled with draw_aux_usage

Instead of keeping an array of booleans, we now hang onto an array of
isl_aux_usage enums.  This means that the thing we are passing from
brw_draw.c to surface state setup is the thing that surface state setup
actually needs instead of an input to compute what it needs.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
6 years agoi965/surface_state: Drop brw_aux_surface_disabled
Jason Ekstrand [Wed, 24 Jan 2018 19:43:55 +0000 (11:43 -0800)]
i965/surface_state: Drop brw_aux_surface_disabled

The only purpose of this function is to disable aux on texture surfaces
when the corresponding renderbuffer has aux disabled.  However, the act
of disabling aux on the renderbuffer will cause it to be resolved and
intel_miptree_texture_aux_usage will already check the resolved status
of a texture and return ISL_AUX_USAGE_NONE for it.  Even if we used CCS
for it, that wouldn't really be a problem because the CCS will be in the
pass-through state and so it would effectively be ignored.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
6 years agoi965/miptree: Add an aux_disabled parameter to render_aux_usage
Jason Ekstrand [Tue, 23 Jan 2018 07:40:48 +0000 (23:40 -0800)]
i965/miptree: Add an aux_disabled parameter to render_aux_usage

Only one of the callers of intel_miptree_render_aux_usage actually took
brw->draw_aux_buffer_disabled into account.  This was causing us to
ignore draw_aux_buffer_disabled for the intel_miptree_prepare_render.
This isn't a problem because the draw_aux_buffer_disabled entry was set
during texture preparation and we already did the resolve at that time.
However, this also meant that the aux_usage we were passing to
brw_cache_flush_for_render and brw_render_cache_add_bo was wrong so our
automatic cache flushing around aux_usage changes wasn't happening.
This was causing GPU hangs in Oxenfree.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104711
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104411
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104383
Fixes: ea0d2e98ecb369ab84e78c84709c0930ea8c293a
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
6 years agoi965/miptree: Take an aux_usage in prepare/finish_render
Jason Ekstrand [Tue, 23 Jan 2018 07:33:53 +0000 (23:33 -0800)]
i965/miptree: Take an aux_usage in prepare/finish_render

Both callers of intel_miptree_prepare/finish_render have to call
intel_miptree_render_aux_usage anyway for other reasons.  They may as
well pass the result in instead of us calling it again.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
6 years agoaubinator: Multiply count by 4 to compute buffer sizes
Jason Ekstrand [Tue, 23 Jan 2018 06:45:14 +0000 (22:45 -0800)]
aubinator: Multiply count by 4 to compute buffer sizes

The count field is in terms of dwords and not bytes.

6 years agost/glsl_to_nir: remove reallocation of sampler/image location
Timothy Arceri [Tue, 23 Jan 2018 21:48:49 +0000 (08:48 +1100)]
st/glsl_to_nir: remove reallocation of sampler/image location

As far as I can tell this always just reassigns the same value.

Also as we don't curretly store UniformHash in the shader cache
removing this will help with adding a shader cache to gallium
nir drivers.

Reviewed-by: Rob Clark <robdclark@gmail.com>
6 years agodocs: add 18.1.0-devel release notes template
Jordan Justen [Thu, 25 Jan 2018 01:07:30 +0000 (17:07 -0800)]
docs: add 18.1.0-devel release notes template

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
6 years agomesa: bump version to 18.1.0-devel
Jordan Justen [Thu, 25 Jan 2018 01:02:55 +0000 (17:02 -0800)]
mesa: bump version to 18.1.0-devel

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
6 years agomeson: handle LLVM 'x.x.xgit-revision' versions
Greg V [Wed, 24 Jan 2018 18:02:43 +0000 (21:02 +0300)]
meson: handle LLVM 'x.x.xgit-revision' versions

When LLVM is built inside of a git repo (even way below, e.g. /usr/ports/.git
exists, and LLVM is built in /usr/ports/devel/llvm50/work), its version
becomes something like 5.0.0git-f8ab206b2176.

New meson versions already handle this, but we support older versions too.

Fixes: 673dda8330769 ("meson: build "radv" vulkan driver for radeon hardware")
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
6 years agomeson: fix getting cflags from pkg-config
Greg V [Wed, 24 Jan 2018 18:02:42 +0000 (21:02 +0300)]
meson: fix getting cflags from pkg-config

get_pkgconfig_variable('cflags') always returns an empty list, it's a
function for getting *custom* variables.

Meson does not yet support asking for cflags, so explicitly invoke
pkg-config for now.

Fixes: 68076b87474e ("meson: build gallium vdpau state tracker")
Fixes: a817af8a89eb ("meson: build gallium xvmc state tracker")
Fixes: 1d36dc674d52 ("meson: build gallium omx state tracker")
Fixes: 5a785d51a6d6 ("meson: build gallium va state tracker")
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
6 years agomeson: fix BSD build
Greg V [Wed, 24 Jan 2018 18:02:40 +0000 (21:02 +0300)]
meson: fix BSD build

CC: 18.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
6 years agomeson: fix missing dependencies
Greg V [Wed, 24 Jan 2018 18:02:39 +0000 (21:02 +0300)]
meson: fix missing dependencies

Fixes: 66f97f6640f5 ("meson: build radeonsi")
Reviewed-by: Emil Velikov <emil.velikov@colalbora.com>
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
6 years agoanv: correct a duplicate check in an assert
Grazvydas Ignotas [Mon, 22 Jan 2018 22:44:36 +0000 (00:44 +0200)]
anv: correct a duplicate check in an assert

Looks like checking both sources was intended, instead of the first one
twice. Found with Coccinelle, coccinellery/xand/xand.cocci semantic patch.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
6 years agomeson: fix HAVE_LLVM version define in meson build
Marc Dietrich [Wed, 24 Jan 2018 21:03:51 +0000 (22:03 +0100)]
meson: fix HAVE_LLVM version define in meson build

LLVM patch level is not included in HAVE_LLVM.

Fixes: e6418ab1566d ("meson: build "radv" vulkan driver for radeon hardware")
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Dylan Baker <dylan.c.baker@intel.com>
Signed-off-by: Marc Dietrich <marvin24@gmx.de>