platform/upstream/mesa.git
7 years agomesa/bufferobj: don't double negate the range
Dave Airlie [Mon, 23 Oct 2017 00:34:54 +0000 (10:34 +1000)]
mesa/bufferobj: don't double negate the range

This fixes a regression I introduced refactoring this code,
I managed to invert range twice, I moved the inversion into
the common code, but forgot to stop doing it in the callee.

Fixes: GL45-CTS.multi_bind.dispatch_bind_buffers_base

Fixes: 35ac13ed3 (mesa/bufferobj: consolidate some codepaths between ubo/ssbo/atomics.)
Reported-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: clone meta shaders before linking
Timothy Arceri [Mon, 23 Oct 2017 00:10:47 +0000 (11:10 +1100)]
radv: clone meta shaders before linking

The IR is reused in different pipeline combinations so we need
to clone it to avoid link time optimistaions messing up the
original copy.

Fixes: 06f05040eb73 (radv: Link shaders)

Reviewed-by: Dave Airlie <airlied@redhat.com>
7 years agogallium/util: don't call close() on Windows in u_tests.c
Brian Paul [Tue, 17 Oct 2017 19:59:28 +0000 (13:59 -0600)]
gallium/util: don't call close() on Windows in u_tests.c

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agomesa: use util_strdup() macro in u_debug_symbol.c
Brian Paul [Tue, 17 Oct 2017 19:59:03 +0000 (13:59 -0600)]
mesa: use util_strdup() macro in u_debug_symbol.c

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agomesa: use util_strdup() macro in symbol_table.c
Brian Paul [Tue, 17 Oct 2017 19:58:47 +0000 (13:58 -0600)]
mesa: use util_strdup() macro in symbol_table.c

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoutil: add util_strdup() wrapper macro
Brian Paul [Tue, 17 Oct 2017 19:57:45 +0000 (13:57 -0600)]
util: add util_strdup() wrapper macro

To work around MSVC warning that strdup() is a deprecated POSIX function.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agogallium/util: replace gethostbyname() with getaddrinfo()
Brian Paul [Tue, 17 Oct 2017 19:11:03 +0000 (13:11 -0600)]
gallium/util: replace gethostbyname() with getaddrinfo()

Compiling with MSVC options /we4995 /we4996 (a subset of /sdl) generates
a warning that the gethostbyname() function is deprecated in favor of
getaddrinfo() or GetAddrInfoW().  Replace the call with getaddrinfo().

Untested.  There are no callers to u_socket_connect() in Gallium.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradv: Update code pointer correctly if a variant is already created
Alex Smith [Mon, 23 Oct 2017 09:37:42 +0000 (10:37 +0100)]
radv: Update code pointer correctly if a variant is already created

This was the actual cause of GPU hangs fixed by 0fdd531457ec ("radv:
Fix pipeline cache locking issues"), since multiple threads would end
up trying to create the variants for a single entry.

Now that we're locking around the whole of this function, this isn't
really necessary (we either create all or none of the variants), but
fix this anyway in case things change later.

Signed-off-by: Alex Smith <asmith@feralinteractive.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
CC: 17.3 <mesa-stable@lists.freedesktop.org>
7 years agoi965: Revert absolute mode for constant buffer pointers.
Kenneth Graunke [Thu, 19 Oct 2017 21:38:30 +0000 (14:38 -0700)]
i965: Revert absolute mode for constant buffer pointers.

The kernel doesn't initialize the value of the INSTPM or CS_DEBUG_MODE2
registers at context initialization time.  Instead, they're inherited
from whatever happened to be running on the GPU prior to first run of a
new context.  So, when we started setting these, other contexts in the
system started inheriting our values.  Since this controls whether
3DSTATE_CONSTANT_* takes a pointer or an offset, getting the wrong
setting is fatal for almost any process which isn't expecting this.

Unfortunately, VA-API and Beignet don't initialize this (nor does older
Mesa), so they will die horribly if we start doing this.  UXA and SNA
don't use any push constants, so they are unaffected.

Until we have some kind of solution to this problem, I'm going to revert
this patch and abandon using the feature for now.  It will lead to fewer
pushed UBO ranges on Broadwell+, which may lead to lower performance,
though I don't have any data on the impact.

Cc: "17.3 17.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102774

7 years agomeson: build imx driver
Dylan Baker [Fri, 20 Oct 2017 22:57:15 +0000 (15:57 -0700)]
meson: build imx driver

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agomeson: build etnaviv driver + winsys
Dylan Baker [Fri, 20 Oct 2017 22:45:22 +0000 (15:45 -0700)]
meson: build etnaviv driver + winsys

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agoac: Silence a compiler warning about results[0].
Eric Anholt [Tue, 17 Oct 2017 20:46:50 +0000 (13:46 -0700)]
ac: Silence a compiler warning about results[0].

We know that num_components will be > 0, but it doesn't.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoac: Fix a compiler warning for possibly undefined "name"
Eric Anholt [Tue, 17 Oct 2017 20:45:09 +0000 (13:45 -0700)]
ac: Fix a compiler warning for possibly undefined "name"

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agomeson: fix egl build for meson version < 0.43
Dylan Baker [Sat, 21 Oct 2017 00:34:51 +0000 (17:34 -0700)]
meson: fix egl build for meson version < 0.43

Meson 0.43 added the ability to pass nested lists to
include_directories, so the code that we have works for 0.43, but not
for 0.42. This patch changes the include_directories list to be flat so
it works with 0.42

fixes: 108d257a16859898f5c ("meson: build libEGL")
Tested-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Rhys Kidd <rhyskidd@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
7 years agoamd/common/gfx9: workaround DCC corruption more conservatively
Nicolai Hähnle [Thu, 12 Oct 2017 09:21:26 +0000 (11:21 +0200)]
amd/common/gfx9: workaround DCC corruption more conservatively

Fixes KHR-GL45.texture_swizzle.smoke and others on Vega.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102809
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agodocs/release-calendar: update - 17.3.0-rc1 is out
Emil Velikov [Mon, 23 Oct 2017 13:30:37 +0000 (14:30 +0100)]
docs/release-calendar: update - 17.3.0-rc1 is out

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoglsl: fix derived cs variables
Ilia Mirkin [Sat, 21 Oct 2017 19:15:41 +0000 (15:15 -0400)]
glsl: fix derived cs variables

There are two issues with the current implementation. First, it relies
on the layout(local_size_*) happening in the same shader as the main
function, and secondly it doesn't work for variable group sizes.

In both cases, the simplest fix is to move the setup of these derived
values to a later time, similar to how the gl_VertexID workarounds are
done. There already exist system values defined for both of the derived
values, so we use them unconditionally, and lower them after linking is
performed.

While we're at it, we move to using gl_LocalGroupSizeARB instead of
gl_WorkGroupSize for variable group sizes.

Also the dead code elimination avoidance can be removed, since there
can be situations where gl_LocalGroupSizeARB is needed but has not been
inserted for the shader with main function. As a result, the lowering
code has to insert its own copies of the system values if needed.

Reported-by: Stephane Chevigny <stephane.chevigny@polymtl.ca>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103393
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
7 years agodocs: add 17.4.0-devel release notes template
Emil Velikov [Mon, 23 Oct 2017 12:07:06 +0000 (13:07 +0100)]
docs: add 17.4.0-devel release notes template

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agomesa: bump version to 17.4.0-devel
Emil Velikov [Mon, 23 Oct 2017 12:00:43 +0000 (13:00 +0100)]
mesa: bump version to 17.4.0-devel

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoradv: automake: include radv_extensions.py in the tarball
Juan A. Suarez Romero [Thu, 19 Oct 2017 10:46:02 +0000 (12:46 +0200)]
radv: automake: include radv_extensions.py in the tarball

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
7 years agoac/nir: Only clamp shadow reference on radeonsi.
Bas Nieuwenhuizen [Mon, 23 Oct 2017 01:27:28 +0000 (03:27 +0200)]
ac/nir: Only clamp shadow reference on radeonsi.

Vulkan CTS does not expect the value to be clamped (at least for D32),
and it makes a differences even though depth is in [0,1], due
to strict inequalities.

I couldn't find anything in the Vulkan spec about this, but the test
seemed to be copied from GL tests and the GL spec only specifies
clamping for fixed point formats. Hence I expect radeonsi to run into
this at some point as well, but given that they still have a usecase
with the Z16->Z32 promotion, I'll leave that for someone else to clean
up.

This at least fixes radv dEQP-VK.texture.shadow.* on VI.

Fixes: 0f9e32519bb 'ac/nir: clamp shadow texture comparison value on VI'
Reviewed-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: Disallow indirect outputs for GS on GFX9 as well.
Bas Nieuwenhuizen [Sun, 22 Oct 2017 16:43:14 +0000 (18:43 +0200)]
radv: Disallow indirect outputs for GS on GFX9 as well.

Since it also uses the output vector before writing to memory.

Fixes: e38685cc62e 'Revert "radv: disable support for VEGA for now."'
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agoac/nir: Fix nir_texop_lod on GFX for 1D arrays.
Bas Nieuwenhuizen [Sun, 22 Oct 2017 16:32:14 +0000 (18:32 +0200)]
ac/nir: Fix nir_texop_lod on GFX for 1D arrays.

Fixes: 1bcb953e166 'radv: handle GFX9 1D textures'
Reviewed-by: Dave Airlie <airlied@redhat.com>
7 years agoradv/ac/nir: only emit tess factors to storage if tes reads them
Dave Airlie [Sun, 22 Oct 2017 20:23:29 +0000 (06:23 +1000)]
radv/ac/nir: only emit tess factors to storage if tes reads them

Otherwise we just need to write them to the tf ring.

this seems to improve the tessellation demo on Bonarie
~2190->~2230 fps

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: Don't use vgpr indexing for outputs on GFX9.
Bas Nieuwenhuizen [Sat, 21 Oct 2017 22:56:09 +0000 (00:56 +0200)]
radv: Don't use vgpr indexing for outputs on GFX9.

Due to LLVM bugs. Fixes a bunch of dEQP-VK.glsl.indexing.*
tests.

Fixes: e38685cc62e 'Revert "radv: disable support for VEGA for now."'
Reviewed-by: Dave Airlie <airlied@redhat.com>
7 years agoac/nir: Account for compact array index in GS input load from LDS.
Bas Nieuwenhuizen [Sat, 21 Oct 2017 20:00:37 +0000 (22:00 +0200)]
ac/nir: Account for compact array index in GS input load from LDS.

Mirrors the vram path.

Fixes: d4ecc3c9299 'ac/nir: Add loading from LDS for merged GS.'
Reviewed-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: Don't compile shaders when they are cached already.
Bas Nieuwenhuizen [Sat, 21 Oct 2017 19:14:13 +0000 (21:14 +0200)]
radv: Don't compile shaders when they are cached already.

When the gs_copy_shader is NULL (due to an incomplete cache), but
the main shaders are found, we still do the nir, but we shouldn't
compile the shaders again. For merged shaders we should also account
for the missing shaders.

Fixes: ce03c119ce0 'radv: Add code to compile merged shaders.'
Reviewed-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: Don't check for max GL GS invocations.
Bas Nieuwenhuizen [Sat, 21 Oct 2017 18:16:57 +0000 (20:16 +0200)]
radv: Don't check for max GL GS invocations.

We specify 127 instead of 32 as the limit in vulkan.

Fixes: 6bc42855f92 'radv: enable GS on GFX9'
Reviewed-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: Don't explicitly reference vertex shader for draw_id.
Bas Nieuwenhuizen [Sat, 21 Oct 2017 16:23:47 +0000 (18:23 +0200)]
radv: Don't explicitly reference vertex shader for draw_id.

With merged shaders the vertex shader may not exist. This got in
because the offending patch was written before merged shaders were
upstream, but committed after.

Fixes: 75dfab24a2c 'radv: refactor indirect draws with radv_draw_info'
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
7 years agoradv: Don't reset cmd_buffer->state.dirty.
Bas Nieuwenhuizen [Sat, 21 Oct 2017 16:20:24 +0000 (18:20 +0200)]
radv: Don't reset cmd_buffer->state.dirty.

Otherwise for non-indexed draws we set and immediately unset
RADV_CMD_DIRTY_INDEX_BUFFER. As all the set functions should
clear their own bit, this is unnecessary.

Fixes: 341529dbee5 'radv: use optimal packet order for draws'
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
7 years agoradv: Correctly detect changed shaders for vertex descriptors.
Bas Nieuwenhuizen [Sat, 21 Oct 2017 16:16:15 +0000 (18:16 +0200)]
radv: Correctly detect changed shaders for vertex descriptors.

As they were emitted after the new pipeline, the changed pipeline
detection was not working anymore.

Fixes: 341529dbee5 'radv: use optimal packet order for draws'
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
7 years agoac/nir: Set larged wrokgroup size for GS on GFX9.
Bas Nieuwenhuizen [Sat, 21 Oct 2017 01:07:43 +0000 (03:07 +0200)]
ac/nir: Set larged wrokgroup size for GS on GFX9.

They don't take a single wave anymore and we need the barriers.

Fixes: 6bc42855f92 'radv: enable GS on GFX9'
Reviewed-by: Dave Airlie <airlied@redhat.com>
7 years agoac/nir: Take the max workgroup size of all provided shaders.
Bas Nieuwenhuizen [Sat, 21 Oct 2017 01:04:35 +0000 (03:04 +0200)]
ac/nir: Take the max workgroup size of all provided shaders.

Fixes: ffaf4d608a1 'radv: Enable tessellation shaders for  GFX9.'
Reviewed-by: Dave Airlie <airlied@redhat.com>
7 years agoradv: Fix pipeline cache locking issues
Alex Smith [Thu, 19 Oct 2017 10:49:39 +0000 (11:49 +0100)]
radv: Fix pipeline cache locking issues

Need to lock around the whole process of retrieving cached shaders, and
around GetPipelineCacheData.

This fixes GPU hangs observed when creating multiple pipelines in
parallel, which appeared to be due to invalid shader code being pulled
from the cache.

Signed-off-by: Alex Smith <asmith@feralinteractive.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agoanv: don't assert on device init on Cannonlake
Lionel Landwerlin [Fri, 20 Oct 2017 17:49:30 +0000 (18:49 +0100)]
anv: don't assert on device init on Cannonlake

v2: Warn that support is still in alpha (Jason)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agoanv: disable stencil pma fix on Gen > 9
Lionel Landwerlin [Fri, 20 Oct 2017 17:28:48 +0000 (18:28 +0100)]
anv: disable stencil pma fix on Gen > 9

This workaround isn't listed on Gen10.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agoblorp: enable R32G32B32X32 blorp ccs copies
Lionel Landwerlin [Fri, 20 Oct 2017 14:46:48 +0000 (15:46 +0100)]
blorp: enable R32G32B32X32 blorp ccs copies

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agomeson: Fix vc5 deps on the XML-generated headers.
Eric Anholt [Sat, 21 Oct 2017 00:14:52 +0000 (17:14 -0700)]
meson: Fix vc5 deps on the XML-generated headers.

I typoed and was depending on v3d_xml.h (the gzipped xml)_, not on the
v3d_packet_v33_pack.h that the compiler and QPU packing actually use.

7 years agobroadcom/vc5: Propagate vc4 aliasing fix to vc5.
Eric Anholt [Sat, 21 Oct 2017 00:05:54 +0000 (17:05 -0700)]
broadcom/vc5: Propagate vc4 aliasing fix to vc5.

See e5fea0d621af2b14cf6c5e364eeaf293db460f2a

7 years agobroadcom/vc4: Fix aliasing issue
Stefan Schake [Fri, 20 Oct 2017 14:16:44 +0000 (16:16 +0200)]
broadcom/vc4: Fix aliasing issue

This was causing Android clang version 3.8.256229 to miscompile,
presumably due to strict aliasing.

Fixes: 14dc281c1332 ("vc4: Enforce one-uniform-per-instruction after optimization.")

7 years agomeson: Add support for EGL glvnd
Dylan Baker [Wed, 18 Oct 2017 22:11:39 +0000 (15:11 -0700)]
meson: Add support for EGL glvnd

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Tested-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
7 years agomeson: build libEGL
Dylan Baker [Wed, 18 Oct 2017 19:20:43 +0000 (12:20 -0700)]
meson: build libEGL

This is based heavily on Daniel Stone's work for the same, rebased on
master and with a number of TODO's fixed.

This does not implement glvnd (which is coming in a later patch)

Meson builds egl slightly differently than autotools, namely it doesn't
build an intermediate shared library. It doesn't do this because meson
doesn't have problems with the name of the library being dynamically
generated, so the glvnd and non-glvnd code can follow the same path.

v2: - Don't reuse variable (Eric E.)

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Tested-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agomeson: move wayland_drm_protocol generation to wayland-drm
Dylan Baker [Tue, 17 Oct 2017 22:02:58 +0000 (15:02 -0700)]
meson: move wayland_drm_protocol generation to wayland-drm

These files are needed by both vulkan wayland-wsi and by egl
wayland-wsi, since the XML file is in src/egl/wayland/wayland-drm and we
can include this directory in such a way that it will be loaded before
egl and vulkan this allows us to avoid multiple calls to the same
generator.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-and-Tested-by: Eric Engestrom <eric@engestrom.ch>
7 years agomeson: Don't allow glx to be built without platform_x11
Dylan Baker [Wed, 18 Oct 2017 22:47:11 +0000 (15:47 -0700)]
meson: Don't allow glx to be built without platform_x11

Previously this failed to change with_glx to disabled from auto if
platform_x11 was unset or if no opengl apis were being built.

v2: - swap conditional positions

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-and-Tested-by: Eric Engestrom <eric@engestrom.ch>
7 years agomeson: bump libdrm_amdgpu requirement to 2.4.85
Dylan Baker [Fri, 20 Oct 2017 23:28:32 +0000 (16:28 -0700)]
meson: bump libdrm_amdgpu requirement to 2.4.85

fixes: b60372570323243ec73 ("configure.ac: Bump libdrm_amdgpu version to 2.4.85.")
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agonir: Print the components referenced for split or packed shader in/outs.
Eric Anholt [Tue, 17 Oct 2017 17:41:55 +0000 (10:41 -0700)]
nir: Print the components referenced for split or packed shader in/outs.

Having 4 variables all called "gl_in_TexCoord0@n" isn't very informative,
much better to see:

decl_var shader_in INTERP_MODE_NONE float gl_in_TexCoord0 (VARYING_SLOT_VAR0.x, 1, 0)
decl_var shader_in INTERP_MODE_NONE float gl_in_TexCoord0@0 (VARYING_SLOT_VAR0.y, 1, 0)
decl_var shader_in INTERP_MODE_NONE float gl_in_TexCoord0@1 (VARYING_SLOT_VAR0.z, 1, 0)
decl_var shader_in INTERP_MODE_NONE float gl_in_TexCoord0@2 (VARYING_SLOT_VAR0.w, 1, 0)

v2: Handle arrays and structs better (by Timothy)

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agonir: Add a safety check that we don't remove dead I/O vars after lowering.
Eric Anholt [Mon, 16 Oct 2017 22:32:30 +0000 (15:32 -0700)]
nir: Add a safety check that we don't remove dead I/O vars after lowering.

The pass only looks at var load/store intrinsics, not input load/store
intrinsics, so assert that we don't see the other type.

v2: Adjust comment indentation.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
7 years agoradv: disable implicit sync for radv allocated bos v3
Andres Rodriguez [Fri, 20 Oct 2017 22:42:13 +0000 (18:42 -0400)]
radv: disable implicit sync for radv allocated bos v3

Implicit sync kicks in when a buffer is used by two different amdgpu
contexts simultaneously. Jobs that use explicit synchronization
mechanisms end up needlessly waiting to be scheduled for long periods
of time in order to achieve serialized execution.

This patch disables implicit synchronization for all radv allocations
except for wsi bos. The only systems that require implicit
synchronization are DRI2/3 and PRIME.

v2: mark wsi bos as RADV_MEM_IMPLICIT_SYNC
v3: Add drm version check (Bas)

Signed-off-by: Andres Rodriguez <andresx7@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agoradv: factor out radv_alloc_memory
Andres Rodriguez [Fri, 20 Oct 2017 22:42:12 +0000 (18:42 -0400)]
radv: factor out radv_alloc_memory

This allows us to pass extra parameters to the memory allocation
operation that are not defined in the vulkan spec. This is useful for
internal usage.

Signed-off-by: Andres Rodriguez <andresx7@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agoradv: Expose VK_EXT_global_priority
Andres Rodriguez [Fri, 20 Oct 2017 22:02:16 +0000 (18:02 -0400)]
radv: Expose VK_EXT_global_priority

Expose the extension string as supported

Signed-off-by: Andres Rodriguez <andresx7@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agoradv: don't skip PS/VS partial flush
Andres Rodriguez [Fri, 20 Oct 2017 22:02:15 +0000 (18:02 -0400)]
radv: don't skip PS/VS partial flush

This patch helps lower high priority compute latency. Found by
bisecting a perf regression on computeparticles with high priority
compute queues enabled.

Reverting this micro-optimization doesn't seem to have any negative
effect on performance on Dota2 or ssao.

Signed-off-by: Andres Rodriguez <andresx7@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agoradv: Implement VK_EXT_global_priority
Andres Rodriguez [Fri, 20 Oct 2017 22:02:14 +0000 (18:02 -0400)]
radv: Implement VK_EXT_global_priority

This extension allows the caller to change a queue's system wide
priority. This is useful for applications with specific
latency constraints.

Signed-off-by: Andres Rodriguez <andresx7@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agoradeonsi: hardcode shader WAVE_LIMIT to the maximum value
Andres Rodriguez [Fri, 20 Oct 2017 22:02:13 +0000 (18:02 -0400)]
radeonsi: hardcode shader WAVE_LIMIT to the maximum value

This is part of a cooperative scheduling approach used by radv. All
drivers in the stack must opt-in to resource arbitration, otherwise GL
based apps will be able to ignore system priorities.

We always hardcode the field to its maximum value, instead of attempting
to calculate an approximate usage. In testing, there were no benefits to
using anything other than the maximum.

Signed-off-by: Andres Rodriguez <andresx7@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agoradv: hardcode shader WAVE_LIMIT to the maximum value
Andres Rodriguez [Fri, 20 Oct 2017 22:02:12 +0000 (18:02 -0400)]
radv: hardcode shader WAVE_LIMIT to the maximum value

When WAVE_LIMIT is set, a submission will opt-in for SPI based resource
scheduling. Because this mechanism is cooperative, we must ensure that
all submissions have this field set, otherwise they will bypass resource
arbitration.

We always hardcode the field to its maximum value, instead of attempting
to calculate an approximate usage. In testing, there were no benefits to
using anything other than the maximum.

Signed-off-by: Andres Rodriguez <andresx7@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agovulkan: update headers & registry to VK 1.0.63
Andres Rodriguez [Fri, 20 Oct 2017 22:02:11 +0000 (18:02 -0400)]
vulkan: update headers & registry to VK 1.0.63

Signed-off-by: Andres Rodriguez <andresx7@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agoconfigure.ac: Bump libdrm_amdgpu version to 2.4.85.
Bas Nieuwenhuizen [Fri, 20 Oct 2017 22:22:48 +0000 (00:22 +0200)]
configure.ac: Bump libdrm_amdgpu version to 2.4.85.

For VK_EXT_global_priority in radv.

Acked-by: Andres Rodriguez <andresx7@gmail.com>
7 years agobroadcom/vc5: Use SETMSF to handle discards.
Eric Anholt [Fri, 20 Oct 2017 21:00:11 +0000 (14:00 -0700)]
broadcom/vc5: Use SETMSF to handle discards.

A bit of spec text suggested that (like vc4) condition codes should be
used for discards, and the simulator was fine with it, but the 7268
disagrees and you have to use SETMSF instead or the color comes through.
Fixes glsl-fs-discard-01 and many of the interpolation-with-clipping
tests.

7 years agobroadcom/vc5: Set the snorm/unorm packing functions to be lowered.
Eric Anholt [Fri, 20 Oct 2017 19:43:11 +0000 (12:43 -0700)]
broadcom/vc5: Set the snorm/unorm packing functions to be lowered.

We don't have native instructions for them, so set up the lowering.  Once
we support the bfi instructions that get generated, they should start
actually working.

7 years agobroadcom/vc5: Fix pasteo that broke vertex texturing.
Eric Anholt [Fri, 20 Oct 2017 19:32:36 +0000 (12:32 -0700)]
broadcom/vc5: Fix pasteo that broke vertex texturing.

We weren't ever filling in the texture state record, so we'd dereference
NULL from the shader.

7 years agobroadcom/vc5: Move default attribute value setup to the CSO and fix them.
Eric Anholt [Thu, 19 Oct 2017 22:22:13 +0000 (15:22 -0700)]
broadcom/vc5: Move default attribute value setup to the CSO and fix them.

I was generating some stub values to bring the driver up, but fill them in
properly now.  We now set 1.0 or 1u as appropriate, and thanks to being in
their own BO it fixes piglit failures on the 7268 (where our 4-byte
alignment was insufficient).

Fixes const-packHalf2x16.shader_test

7 years agobroadcom/vc5: Move most of the shader state attribute record to the CSO.
Eric Anholt [Thu, 19 Oct 2017 22:17:41 +0000 (15:17 -0700)]
broadcom/vc5: Move most of the shader state attribute record to the CSO.

This should reduce our draw-time overhead, and puts the code where it
should go long term.

7 years agobroadcom/vc5: Fix build failure frm nir_shader::stage removal.
Eric Anholt [Fri, 20 Oct 2017 22:53:18 +0000 (15:53 -0700)]
broadcom/vc5: Fix build failure frm nir_shader::stage removal.

Fixes: 59fb59ad54d3 ("nir: Get rid of nir_shader::stage")

7 years agoi965/fs: Use align1 mode on ternary instructions on Gen10+
Matt Turner [Wed, 14 Jun 2017 21:48:11 +0000 (14:48 -0700)]
i965/fs: Use align1 mode on ternary instructions on Gen10+

Align1 mode offers some nice features over align16, like access to more
data types and the ability to use a 16-bit immediate. This patch does
not start using any new features. It just emits ternary instructions in
align1 mode.

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agoi965: Add align1 ternary instruction emission support
Matt Turner [Wed, 14 Jun 2017 21:49:52 +0000 (14:49 -0700)]
i965: Add align1 ternary instruction emission support

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agoi965: Add align1 ternary instruction disassembler support
Matt Turner [Wed, 14 Jun 2017 23:04:07 +0000 (16:04 -0700)]
i965: Add align1 ternary instruction disassembler support

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agoi965: Add align1 ternary instruction-word support
Matt Turner [Tue, 6 Jun 2017 23:15:21 +0000 (16:15 -0700)]
i965: Add align1 ternary instruction-word support

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agoi965: Add align1 ternary instruction support to conversion functions
Matt Turner [Wed, 14 Jun 2017 21:49:31 +0000 (14:49 -0700)]
i965: Add align1 ternary instruction support to conversion functions

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agoi965: Add align1 ternary instruction field encodings
Matt Turner [Thu, 17 Dec 2015 17:33:38 +0000 (12:33 -0500)]
i965: Add align1 ternary instruction field encodings

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agoi965: Add functions to abstract access to 3src register types
Matt Turner [Thu, 24 Aug 2017 23:14:35 +0000 (16:14 -0700)]
i965: Add functions to abstract access to 3src register types

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agoi965: Rename brw_inst's functions that access the 3src register type
Matt Turner [Fri, 25 Aug 2017 17:43:38 +0000 (10:43 -0700)]
i965: Rename brw_inst's functions that access the 3src register type

Put hw_ in the name so that it's clear these are the hardware encodings.

Similar to commit 9fb832332868 ("i965: Rename brw_inst's functions that
access the register type")

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agoi965: Rename brw_inst 3src functions in preparation for align1
Matt Turner [Tue, 6 Jun 2017 22:43:23 +0000 (15:43 -0700)]
i965: Rename brw_inst 3src functions in preparation for align1

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agoi965: Print subreg in units of type-size on ternary instructions
Matt Turner [Wed, 14 Jun 2017 22:05:39 +0000 (15:05 -0700)]
i965: Print subreg in units of type-size on ternary instructions

The instruction word contains SubRegNum[4:2] so it's in units of dwords
(hence the * 4 to get it in terms of bytes). Before this patch, the
subreg would have been wrong for DF arguments.

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agoi965: Add functions for brw_reg_type <-> hw 3src type
Matt Turner [Wed, 14 Jun 2017 21:08:32 +0000 (14:08 -0700)]
i965: Add functions for brw_reg_type <-> hw 3src type

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agoi965: Move brw_reg_type_is_floating_point to brw_reg_type.h
Matt Turner [Thu, 24 Aug 2017 23:04:26 +0000 (16:04 -0700)]
i965: Move brw_reg_type_is_floating_point to brw_reg_type.h

I'm going to call this from brw_inst.h, and I don't want to have to
include all of brw_reg.h.

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agonir: Get rid of nir_shader::stage
Jason Ekstrand [Fri, 15 Sep 2017 02:52:38 +0000 (19:52 -0700)]
nir: Get rid of nir_shader::stage

It's redundant with nir_shader::info::stage.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
7 years agoradv: use optimal packet order for draws
Samuel Pitoiset [Tue, 17 Oct 2017 07:47:53 +0000 (09:47 +0200)]
radv: use optimal packet order for draws

Ported from RadeonSI. The time where shaders are idle should
be shorter now. This can give a little boost, like +6% with
the dynamicubo Vulkan demo.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agoradv: add radv_emit_shaders_prefetch()
Samuel Pitoiset [Mon, 16 Oct 2017 15:48:42 +0000 (17:48 +0200)]
radv: add radv_emit_shaders_prefetch()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agoradv: add radv_emit_shader_prefetch()
Samuel Pitoiset [Mon, 16 Oct 2017 15:34:42 +0000 (17:34 +0200)]
radv: add radv_emit_shader_prefetch()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agost/mesa: correct a u_vbuf comment
Marek Olšák [Fri, 20 Oct 2017 16:55:48 +0000 (18:55 +0200)]
st/mesa: correct a u_vbuf comment

trivial.

7 years agoetnaviv: fix implicit conversion warning
Christian Gmeiner [Thu, 19 Oct 2017 21:12:48 +0000 (23:12 +0200)]
etnaviv: fix implicit conversion warning

Galliums query_type used in APIs is unsigned.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
7 years agoetnaviv: enable occlusion query if GPU supports it
Christian Gmeiner [Thu, 19 Oct 2017 21:12:47 +0000 (23:12 +0200)]
etnaviv: enable occlusion query if GPU supports it

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
7 years agoetnaviv: add support for occlusion queries
Christian Gmeiner [Thu, 19 Oct 2017 21:12:46 +0000 (23:12 +0200)]
etnaviv: add support for occlusion queries

Passes most occlusion query piglits. The following piglits are broken:
- spec@arb_occlusion_query@occlusion_query_meta_fragments
- spec@arb_occlusion_query@occlusion_query_meta_save
- spec@arb_occlusion_query2@render

v1 -> v2:
 - use one sample provider for all occlusion queries tyes
 - add comment about 'magic' value 0x1DF5E76

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
7 years agoetnaviv: add basic infrastructure for hw queries
Christian Gmeiner [Thu, 19 Oct 2017 21:12:45 +0000 (23:12 +0200)]
etnaviv: add basic infrastructure for hw queries

No hardware query is supported yet.

v1 -> v2
 - removed query_type from strcut etna_hw_sample_provider

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
7 years agoetnaviv: update headers from rnndb
Christian Gmeiner [Thu, 19 Oct 2017 21:12:44 +0000 (23:12 +0200)]
etnaviv: update headers from rnndb

Update to etna_viv commit 6c9c706.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
7 years agorelnotes/17.3: EGL_IMG_context_priority is now implemented
Chris Wilson [Wed, 3 May 2017 14:42:35 +0000 (15:42 +0100)]
relnotes/17.3: EGL_IMG_context_priority is now implemented

Suggested-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Report supported context priorities to EGL/DRI
Chris Wilson [Tue, 11 Apr 2017 15:17:36 +0000 (16:17 +0100)]
i965: Report supported context priorities to EGL/DRI

Hook up the RendererQuery for __DRI2_RENDERER_HAS_CONTEXT_PRIORITY to
report the available DRM_I915_GEM_CONTEXT_SETPARAM options based on the
per-client default context. The kernel will validate the request to change
the property, so we get an accurate reflection of available support
(based on kernel version and privilege) and we should only have to do it
once during screen setup -- although the SETPARAM should be fast, they
are still an ioctl each.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Pass the EGL/DRI context priority through to the kernel
Chris Wilson [Tue, 11 Apr 2017 14:24:54 +0000 (15:24 +0100)]
i965: Pass the EGL/DRI context priority through to the kernel

Decode the EGL/DRI priority enum into the [-1023, 1023] range as
interpreted by the kernel and call DRM_I915_GEM_CONTEXT_SETPARAM to
adjust the priority. We use 0 as the default medium priority (also the
kernel default) and so only need adjust up or down. By only doing the
adjustment if not setting to medium, we can faithfully report any error
whilst setting without worrying about kernel version.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Record the presence of the kernel scheduler
Chris Wilson [Wed, 27 Sep 2017 15:14:33 +0000 (16:14 +0100)]
i965: Record the presence of the kernel scheduler

Mention to the debug log if the kernel scheduler is enabled; and in
particular if it has preemption enabled.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965: Sync i915_drm.h from kernel for IMG_context_priority
Chris Wilson [Wed, 27 Sep 2017 17:37:07 +0000 (18:37 +0100)]
i965: Sync i915_drm.h from kernel for IMG_context_priority

Pulling in changes up to

    kernel commit ac14fbd460d0ec16e7750e40dcd8199b0ff83d0a
    Author: Chris Wilson <chris@chris-wilson.co.uk>
    Date:   Tue Oct 3 21:34:53 2017 +0100

drm/i915/scheduler: Support user-defined priorities

and including the fixup from

    kernel commit 822a4b673284672af697ccd66e8795f8a712a90d
    Author: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
    Date:   Fri Oct 6 13:45:59 2017 +0300

drm/i915: Don't use BIT() in UAPI section

for implementing IMG_context_priority.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoegl,dri: Propagate context priority hint to driver->CreateContext
Chris Wilson [Thu, 27 Oct 2016 18:54:49 +0000 (19:54 +0100)]
egl,dri: Propagate context priority hint to driver->CreateContext

Jump through the layers of abstraction between egl and dri in order to
feed the context priority attribute through to the backend. This
requires us to read the value from the base _egl_context, convert it to
a DRI attribute, parse it again in the generic context creator before
passing it to the driver as a function parameter.

In order to not require us to pass back the actual value of the context
priority after creation, we impose that drivers should report the
available set of priorities during screen setup (and then they may chose
to fail if given an invalid value as that should have been checked at
the user boundary.)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Ben Widawsky <ben@bwidawsk.net> # i915/i965
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoegl: Support IMG_context_priority
Chris Wilson [Thu, 27 Oct 2016 18:34:46 +0000 (19:34 +0100)]
egl: Support IMG_context_priority

IMG_context_priority
https://www.khronos.org/registry/egl/extensions/IMG/EGL_IMG_context_priority.txt

    "This extension allows an EGLContext to be created with a priority
    hint. It is possible that an implementation will not honour the
    hint, especially if there are constraints on the number of high
    priority contexts available in the system, or system policy limits
    access to high priority contexts to appropriate system privilege
    level. A query is provided to find the real priority level assigned
    to the context after creation."

The extension adds a new eglCreateContext attribute for choosing a
priority hint. This stub parses the attribute and copies into the base
struct _egl_context, and hooks up the query similarly.

Since the attribute is purely a hint, I have no qualms about the lack of
implementation before reporting back the value the user gave!

v2: Remember to set the default ContextPriority value to medium.
v3: Use the driRendererQuery interface to probe the backend for
supported priority values and use those to mask the EGL interface.
v4: Treat the priority attrib as a hint and gracefully mask any requests
not supported by the driver, the EGLContext will remain at medium
priority.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Rob Clark <robdclark@gmail.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Emil Velikov <emli.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoradv: don't flush the VS when srcStageMask == TOP_OF_PIPE_BIT
Fredrik Höglund [Thu, 19 Oct 2017 18:54:50 +0000 (20:54 +0200)]
radv: don't flush the VS when srcStageMask == TOP_OF_PIPE_BIT

The Vulkan specification says:

   "... an execution dependency with only VK_PIPELINE_STAGE_TOP_OF_-
    PIPE_BIT in the source stage mask will effectively not wait for
    any prior commands to complete."

Signed-off-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
7 years agoradv: mark total_count as MAYBE_UNUSED in CmdSet{Viewport,Scissor}
Samuel Pitoiset [Fri, 20 Oct 2017 09:21:27 +0000 (11:21 +0200)]
radv: mark total_count as MAYBE_UNUSED in CmdSet{Viewport,Scissor}

Fixes two compilation warnings in release build. Trivial.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
7 years agoradv: rename radv_cmd_buffer_flush_state() to radv_draw()
Samuel Pitoiset [Mon, 16 Oct 2017 18:59:43 +0000 (20:59 +0200)]
radv: rename radv_cmd_buffer_flush_state() to radv_draw()

Similar to the dispatch codepath.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agoradv: emit primitive restart from radv_emit_draw_registers()
Samuel Pitoiset [Tue, 10 Oct 2017 11:36:23 +0000 (13:36 +0200)]
radv: emit primitive restart from radv_emit_draw_registers()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agoradv: add radv_emit_draw_registers()
Samuel Pitoiset [Tue, 10 Oct 2017 11:29:58 +0000 (13:29 +0200)]
radv: add radv_emit_draw_registers()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agoradv: refactor indirect draws (+count buffer) with radv_draw_info
Samuel Pitoiset [Fri, 13 Oct 2017 17:06:11 +0000 (19:06 +0200)]
radv: refactor indirect draws (+count buffer) with radv_draw_info

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agoradv: refactor indirect draws with radv_draw_info
Samuel Pitoiset [Fri, 13 Oct 2017 16:56:48 +0000 (18:56 +0200)]
radv: refactor indirect draws with radv_draw_info

Indirect draws with a count buffer will be refactored in a
separate patch.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agoradv: refactor simple and indexed draws with radv_draw_info
Samuel Pitoiset [Fri, 13 Oct 2017 15:34:35 +0000 (17:34 +0200)]
radv: refactor simple and indexed draws with radv_draw_info

Similar to the dispatch compute logic but for draw calls. For
convenience, indirect draws will be converted in a separate
patch.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
7 years agoradv: re-emit VGT_INDEX_TYPE because non-indexed draws overwrite it
Samuel Pitoiset [Thu, 19 Oct 2017 10:35:46 +0000 (12:35 +0200)]
radv: re-emit VGT_INDEX_TYPE because non-indexed draws overwrite it

Only on CIK and later. We should only update VGT_INDEX_TYPE but
it seems easier to re-emit all the index buffer packets.

Fixes: 966d66f28f (radv: do not re-emit the index buffer for every draw call)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>