mesa.git
2 years agowsi/wayland: fix pointer casting warning on 32bit
Eric Engestrom [Sun, 28 Oct 2018 13:40:12 +0000 (13:40 +0000)]
wsi/wayland: fix pointer casting warning on 32bit

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2 years agowsi/display: s/#if/#ifdef/ to fix -Wundef
Eric Engestrom [Sun, 28 Oct 2018 13:39:30 +0000 (13:39 +0000)]
wsi/display: s/#if/#ifdef/ to fix -Wundef

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2 years agowsi: deduplicate get_current_time() functions between display and x11
Eric Engestrom [Sun, 28 Oct 2018 13:37:26 +0000 (13:37 +0000)]
wsi: deduplicate get_current_time() functions between display and x11

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2 years agoanv: release memory allocated by bo_heap when descriptor pool is destroyed
Tapani Pälli [Fri, 8 Mar 2019 08:29:26 +0000 (10:29 +0200)]
anv: release memory allocated by bo_heap when descriptor pool is destroyed

Fixes following leak:

   ==21853== 32 bytes in 1 blocks are definitely lost in loss record 2 of 20
   ==21853==    at 0x483AB1A: calloc (vg_replace_malloc.c:762)
   ==21853==    by 0x4C4DD7F: util_vma_heap_free (vma.c:221)
   ==21853==    by 0x4C4D647: util_vma_heap_init (vma.c:46)
   ==21853==    by 0x4957B9F: anv_CreateDescriptorPool (anv_descriptor_set.c:578)

Fixes: c520f4dec9cb ("anv: Add a concept of a descriptor buffer")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2 years agoanv: destroy descriptor sets when pool gets destroyed
Tapani Pälli [Mon, 4 Mar 2019 12:22:36 +0000 (14:22 +0200)]
anv: destroy descriptor sets when pool gets destroyed

Patch maintains a list of sets in the pool and destroys possible
remaining sets when pool is destroyed.

As stated in Vulkan spec:
   "When a pool is destroyed, all descriptor sets allocated from
    the pool are implicitly freed and become invalid."

This fixes memory leaks spotted with valgrind:

   ==19622== 96 bytes in 1 blocks are definitely lost in loss record 2 of 3
   ==19622==    at 0x483880B: malloc (vg_replace_malloc.c:309)
   ==19622==    by 0x495B67E: default_alloc_func (anv_device.c:547)
   ==19622==    by 0x4955E05: vk_alloc (vk_alloc.h:36)
   ==19622==    by 0x4956A8F: anv_multialloc_alloc (anv_private.h:538)
   ==19622==    by 0x4956A8F: anv_CreateDescriptorSetLayout (anv_descriptor_set.c:217)

Fixes: 14f6275c92f1 ("anv/descriptor_set: add reference counting for descriptor set layouts")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2 years agoanv: add support for dumping shader info via VK_EXT_debug_report
Timothy Arceri [Mon, 18 Feb 2019 04:40:49 +0000 (15:40 +1100)]
anv: add support for dumping shader info via VK_EXT_debug_report

This information will be used by the vkpipeline-db tool.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2 years agoiris: Fix backface stencil write condition
Kenneth Graunke [Sat, 9 Mar 2019 08:25:30 +0000 (00:25 -0800)]
iris: Fix backface stencil write condition

A bit too much search and replace here.

2 years agopanfrost/drm: Cast pointer to u64 to fix warning
Alyssa Rosenzweig [Sun, 10 Mar 2019 19:16:56 +0000 (19:16 +0000)]
panfrost/drm: Cast pointer to u64 to fix warning

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2 years agopanfrost: Add backend targeting the DRM driver
Tomeu Vizoso [Fri, 8 Mar 2019 09:27:07 +0000 (10:27 +0100)]
panfrost: Add backend targeting the DRM driver

This backend interacts with the new DRM driver for Midgard GPUs which is
currently in development.

When using this backend, Panfrost has roughly on-par functionality as
when using the non-DRM driver from Arm.

Alyssa Rosenzweig: To do so, we implement additional routines for
runtime GPU version detection and fencing. We cleanup some duplicate
code interfering with the new driver. We fix a long-standing memory leak
which is aggravated on the new driver. Finally, we implement BO
import/export in a way compatible with the new driver. These changes are
squashed to preserve bisectability given the hard-to-track ABI shifts in
the nondrm module

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2 years agopanfrost: Add gem_handle to panfrost_memory and panfrost_bo
Tomeu Vizoso [Fri, 8 Mar 2019 09:27:06 +0000 (10:27 +0100)]
panfrost: Add gem_handle to panfrost_memory and panfrost_bo

It will be used by the DRM backend to store GEM handles from the kernel.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2 years agofreedreno/a6xx: more bcolor fixes
Rob Clark [Sun, 10 Mar 2019 15:08:10 +0000 (11:08 -0400)]
freedreno/a6xx: more bcolor fixes

Non-zero offset wasn't working, which breaks a bunch of
dEQP-GLES31.functional.texture.border_clamp.formats.* when doing sharded
deqp runs (because order of tests changes, resulting in different
texture state bound.. deqp doesn't really clean up it's gl state between
tests very well)

Previously, if additional textures were bound, due to using too small of
a bcolor_entry size, the last 32bytes of the bcolor_entry would be
overwritten.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2 years agogitlab-ci: add panfrost to the gallium drivers build
Eric Engestrom [Sat, 9 Mar 2019 22:53:27 +0000 (22:53 +0000)]
gitlab-ci: add panfrost to the gallium drivers build

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2 years agopanfrost: move #include to fix compilation
Eric Engestrom [Sat, 9 Mar 2019 22:27:51 +0000 (22:27 +0000)]
panfrost: move #include to fix compilation

In standalone.h, the struct gl_context type is not declared by #includ'ing
mtypes.h:

In file included from src/gallium/drivers/panfrost/midgard/cmdline.c:24:
src/compiler/glsl/standalone.h:46:14: warning: ‘struct gl_context’ declared inside parameter list will not be visible outside of this definition or declaration
       struct gl_context *ctx);
              ^~~~~~~~~~

This causes the following compilation failure:

src/gallium/drivers/panfrost/midgard/cmdline.c: In function ‘compile_shader’:
src/gallium/drivers/panfrost/midgard/cmdline.c:58:61: error: passing argument 4 of ‘standalone_compile_shader’ from incompatible pointer type [-Werror=incompatible-pointer-types]
         prog = standalone_compile_shader(&options, 2, argv, &local_ctx);
                                                             ^~~~~~~~~~
In file included from src/gallium/drivers/panfrost/midgard/cmdline.c:24:
src/compiler/glsl/standalone.h:43:28: note: expected ‘struct gl_context *’ but argument is of type ‘struct gl_context *’
 struct gl_shader_program * standalone_compile_shader(
                            ^~~~~~~~~~~~~~~~~~~~~~~~~

Fixes: e67e0726372ab65f4104 "panfrost: Implement Midgard shader toolchain"
Cc: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2 years agopanfrost: fix tgsi_to_nir() call
Eric Engestrom [Sat, 9 Mar 2019 22:04:21 +0000 (22:04 +0000)]
panfrost: fix tgsi_to_nir() call

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=109945
Fixes: 7da251fc721360fc28b9 "panfrost: Check in sources for command stream"
Cc: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2 years agoRevert "d3dadapter9: Support software renderer on any DRI device"
Axel Davy [Sat, 9 Mar 2019 13:29:07 +0000 (14:29 +0100)]
Revert "d3dadapter9: Support software renderer on any DRI device"

This reverts commit 0d0847659385e298badd6ef6ca4d0a9e537ae288.

It makes gitlab's travis fail. Revert until patch is fixed.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2 years agost/nine: Change a few advertised caps
Axel Davy [Mon, 4 Feb 2019 23:11:46 +0000 (00:11 +0100)]
st/nine: Change a few advertised caps

Most hw on the native platform advertise these
caps this way.

D3DCAPS_READ_SCANLINE: We don't really have hardware
support for that, but many games don't even check the
flag, and expect GetRasterStatus to work, which is
why we emulated it with a timer (like wine). So we
may as well advertise the cap.
D3DCURSORCAPS_LOWRES: I don't know what is the status
of this on X11, but I don't know of any dx9 game
running at height < 400 either.
D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE: The cap should
correspond to what the current generation of hw is doing.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
2 years agost/nine: Do not advertise CANMANAGERESOURCE
Axel Davy [Mon, 4 Feb 2019 22:42:06 +0000 (23:42 +0100)]
st/nine: Do not advertise CANMANAGERESOURCE

It doesn't seem the main vendors advertise it.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
2 years agost/nine: Do not advertise support for D15S1 and D24X4S4
Axel Davy [Mon, 4 Feb 2019 21:32:45 +0000 (22:32 +0100)]
st/nine: Do not advertise support for D15S1 and D24X4S4

The former is supported on Matrox cards but no other hw.
The latter isn't supported anywhere.

It is fine to not advertise them as supported,
and it could prevent apps to trigger weird rendering paths.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2 years agod3dadapter9: Support software renderer on any DRI device
Patrick Rudolph [Thu, 28 Feb 2019 17:13:39 +0000 (18:13 +0100)]
d3dadapter9: Support software renderer on any DRI device

If D3D_ALWAYS_SOFTWARE is set for debugging purposes,
run on any DRI enabled platform.
Instead of probing for a compatible gallium driver (which might
fail if there's none) always use the KMS DRI software renderer.

Allows to run nine on i915 when D3D_ALWAYS_SOFTWARE=1.

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-by: Axel Davy <davyaxel0@gmail.com>
2 years agost/nine: Disable depth write when nothing gets updated
Axel Davy [Mon, 25 Feb 2019 20:02:14 +0000 (21:02 +0100)]
st/nine: Disable depth write when nothing gets updated

I do not see any perf impact on radeonsi, but it
seems iris needs this.
It seems something sensible to do.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Andre Heider <a.heider@gmail.com>
2 years agovirgl: Return an error if we use fp64 on top of GLES
Elie Tournier [Fri, 15 Feb 2019 16:21:42 +0000 (16:21 +0000)]
virgl: Return an error if we use fp64 on top of GLES

Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: <Gurchetan Singh gurchetansingh@chromium.org>
2 years agovirgl: Set PIPE_CAP_DOUBLES when running on GLES This is a lie but no known app use...
Elie Tournier [Fri, 15 Feb 2019 16:18:25 +0000 (16:18 +0000)]
virgl: Set PIPE_CAP_DOUBLES when running on GLES This is a lie but no known app use fp64.

Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: <Gurchetan Singh gurchetansingh@chromium.org>
2 years agovirgl: Add a caps to advertise GLES backend
Elie Tournier [Fri, 15 Feb 2019 16:14:10 +0000 (16:14 +0000)]
virgl: Add a caps to advertise GLES backend

Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: <Gurchetan Singh gurchetansingh@chromium.org>
2 years agoRevert MR 369 (Fix extract_i8 and extract_u8 for 64-bit integers)
Kenneth Graunke [Sat, 9 Mar 2019 09:39:20 +0000 (01:39 -0800)]
Revert MR 369 (Fix extract_i8 and extract_u8 for 64-bit integers)

This broke piles of image load store tests (179 failures on CI,
mesa_master build #15546, previous build right before this landed
was green).  I'd rather not leave the tree on fire over the weekend,
so let's revert for now, and we can figure out what happened next week.

2 years agonir/algebraic: Add missing 16-bit extract_[iu]8 patterns
Ian Romanick [Thu, 28 Feb 2019 04:15:32 +0000 (20:15 -0800)]
nir/algebraic: Add missing 16-bit extract_[iu]8 patterns

No shader-db changes on any Intel platform.

v2: Use a loop to generate patterns.  Suggested by Jason.

Reviewed-by: Matt Turner <mattst88@gmail.com> [v1]
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
2 years agonir/algebraic: Add missing 64-bit extract_[iu]8 patterns
Ian Romanick [Thu, 28 Feb 2019 04:12:46 +0000 (20:12 -0800)]
nir/algebraic: Add missing 64-bit extract_[iu]8 patterns

No shader-db changes on any Intel platform.

v2: Use a loop to generate patterns.  Suggested by Jason.

Reviewed-by: Matt Turner <mattst88@gmail.com> [v1]
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
2 years agonir/algebraic: Remove redundant extract_[iu]8 patterns
Ian Romanick [Thu, 28 Feb 2019 04:08:38 +0000 (20:08 -0800)]
nir/algebraic: Remove redundant extract_[iu]8 patterns

No shader-db changes on any Intel platform.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
2 years agonir/algebraic: Fix up extract_[iu]8 after loop unrolling
Ian Romanick [Thu, 28 Feb 2019 03:52:12 +0000 (19:52 -0800)]
nir/algebraic: Fix up extract_[iu]8 after loop unrolling

Skylake, Broadwell, and Haswell had similar results. (Skylake shown)
total instructions in shared programs: 15256840 -> 15256837 (<.01%)
instructions in affected programs: 4713 -> 4710 (-0.06%)
helped: 3
HURT: 0
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 0.06% max: 0.08% x̄: 0.06% x̃: 0.06%

total cycles in shared programs: 372286583 -> 372286583 (0.00%)
cycles in affected programs: 198516 -> 198516 (0.00%)
helped: 1
HURT: 1
helped stats (abs) min: 10 max: 10 x̄: 10.00 x̃: 10
helped stats (rel) min: <.01% max: <.01% x̄: <.01% x̃: <.01%
HURT stats (abs)   min: 10 max: 10 x̄: 10.00 x̃: 10
HURT stats (rel)   min: 0.01% max: 0.01% x̄: 0.01% x̃: 0.01%

No changes on any other Intel platform.

v2: Use a loop to generate patterns.  Suggested by Jason.

Reviewed-by: Matt Turner <mattst88@gmail.com> [v1]
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
2 years agoanv/pipeline: Move lower_explicit_io much later
Jason Ekstrand [Thu, 10 Jan 2019 19:39:05 +0000 (13:39 -0600)]
anv/pipeline: Move lower_explicit_io much later

Now that nir_opt_copy_prop_vars can properly handle array derefs on
vectors, it's safe to move UBO and SSBO lowering to late in the
pipeline.  This should allow NIR to actually start optimizing SSBO
access.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
2 years agointel/nir: Move lower_mem_access_bit_sizes to postprocess_nir
Jason Ekstrand [Sat, 12 Jan 2019 02:19:18 +0000 (20:19 -0600)]
intel/nir: Move lower_mem_access_bit_sizes to postprocess_nir

It doesn't really matter where this pass goes as long as it's after we
call nir_lower_explicit_io and before we go into the back-end.  Putting
it brw_postprocess_nir lets us move nir_lower_explicit_io significantly
later in the pipeline.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
2 years agofreedreno/ir3: turn on [iu]mul_high
Rob Clark [Fri, 8 Mar 2019 23:42:22 +0000 (18:42 -0500)]
freedreno/ir3: turn on [iu]mul_high

Which also requires uadd_carry lowering

Until recently this was lowered in glsl ir so it went unnoticed that we
weren't lowering it.

Fixes: 1d8994a63b5 glsl: [u/i]mulExtended optimization for GLSL
Signed-off-by: Rob Clark <robdclark@gmail.com>
2 years agofreedreno/ir3: fix ir3_cmdline harder
Rob Clark [Fri, 8 Mar 2019 22:48:13 +0000 (17:48 -0500)]
freedreno/ir3: fix ir3_cmdline harder

Fixes: 45271702ec9 freedreno: fix ir3_cmdline build
Fixes: 7530d4abfcf glsl/freedreno/panfrost: pass gl_context to the standalone compiler
Signed-off-by: Rob Clark <robdclark@gmail.com>
2 years agost/dri: Set the PIPE_BIND_SHARED flag on create_image_with_modifiers.
Eric Anholt [Wed, 6 Mar 2019 19:08:43 +0000 (11:08 -0800)]
st/dri: Set the PIPE_BIND_SHARED flag on create_image_with_modifiers.

With createImage(), the caller was expected to set a SHARED flag if they
needed the ability to get a GEM handle.  DRI3, wayland, and gbm all set
it, EGL_MESA_drm_image passes it through, and surfaceless doesn't need it
because there's no way to request a handle.

With the new createImageWithModifiers() DRI method to replace it, the
expectation is that you'll always be able to share the buffer, so the flag
is unnecessary in its arguments.  However, we do need to tell gallium
about this expectation.

Without this, kmscube's modifiers path using
gbm_bo_create_with_modifiers(&modifier, 1) instead of
gbm_bo_create(SCANOUT | SHARED) will call the driver's resource_create()
function wtih PIPE_BIND_SHARED unset, so the driver (particularly
renderonly drivers) may allocate in such a way that it can't return an
answer from gbm_bo_get_handle().  I used to have a hack in v3d using
count==1 && modifier==LINEAR to indicate that you wanted SHARED anyway,
but that was dropped recently.

Fixes: 59527a36e975 ("v3d: Restructure RO allocations using
resource_from_handle.")
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
2 years agoiris: Use copy_region and staging resources to avoid transfer stalls
Kenneth Graunke [Fri, 21 Dec 2018 11:04:18 +0000 (03:04 -0800)]
iris: Use copy_region and staging resources to avoid transfer stalls

This is similar to intel_miptree_map_blit and intel_buffer_object.c's
temporary blits in i965.

Improves performance of DiRT Rally by 20-25% by eliminating stalls.

Breaks piglit's spec/arb_shader_image_load_store/host-mem-barrier,
by using the GPU to do uploads, exposing a st/mesa issue where it
doesn't give us memory_barrier() calls.  This is a pre-existing issue
and will be fixed by a later patch (currently out for review).

2 years agoandroid: fix missing backspace for line continuation
Eric Engestrom [Fri, 8 Mar 2019 20:56:38 +0000 (20:56 +0000)]
android: fix missing backspace for line continuation

Reported-by: Clayton Craft <clayton.a.craft@intel.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=109944
Fixes: e1d81decf7a093867f05 "build: make passing an incorrect pointer type a hard error"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2 years agoprog_to_nir: fix write from vps to FOG
Karol Herbst [Tue, 26 Feb 2019 10:58:11 +0000 (11:58 +0100)]
prog_to_nir: fix write from vps to FOG

for fragment programs we already treat fog as a single component value,
but for vp we didn't.

Fixes fog related piglit tests with my out of tree Nouveau nir patches.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2 years agoiris: Track last VS URB entry size
Sagar Ghuge [Thu, 7 Mar 2019 01:05:23 +0000 (17:05 -0800)]
iris: Track last VS URB entry size

Return immediately if last VS URB entry size is good enough for BLORP
operation

v2: Fix comments (Caio)

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Suggested-by: Kenneth Graunke<kenneth@whitecape.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2 years agoiris: Refactor code to share 3DSTATE_URB_* packet
Sagar Ghuge [Wed, 6 Mar 2019 21:27:28 +0000 (13:27 -0800)]
iris: Refactor code to share 3DSTATE_URB_* packet

v2: 1) Set IRIS_DIRTY_URB bit (Caio)
    2) Get rid of unnecessary function (Caio)

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Suggested-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2 years agoglx/meson: use full include path for dri_interface.h
Eric Engestrom [Tue, 5 Mar 2019 11:09:13 +0000 (11:09 +0000)]
glx/meson: use full include path for dri_interface.h

Everything else uses `#include "GL/internal/dri_interface.h"` instead,
and this full path was even already used in other parts of GLX.

While at it, nothing uses `inc_gl_internal` anymore so let's remove it
as well.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Tested-by: Clayton Craft <clayton.a.craft@intel.com>
2 years agohgl/meson: drop unused include directory
Eric Engestrom [Tue, 5 Mar 2019 11:07:35 +0000 (11:07 +0000)]
hgl/meson: drop unused include directory

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Tested-by: Clayton Craft <clayton.a.craft@intel.com>
2 years agointel/compiler: silence unitialized variable warning in opt_vector_float()
Brian Paul [Fri, 8 Mar 2019 15:50:13 +0000 (08:50 -0700)]
intel/compiler: silence unitialized variable warning in opt_vector_float()

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2 years agointel/decoders: silence uninitialized variable warnings in gen_print_batch()
Brian Paul [Fri, 8 Mar 2019 15:49:44 +0000 (08:49 -0700)]
intel/decoders: silence uninitialized variable warnings in gen_print_batch()

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2 years agost/mesa: init hash keys with memset(), not designated initializers
Brian Paul [Fri, 8 Mar 2019 17:09:15 +0000 (10:09 -0700)]
st/mesa: init hash keys with memset(), not designated initializers

Since the compiler may not zero-out padding in the object.
Add a couple comments about this to prevent misunderstandings in
the future.

Fixes: 67d96816ff5 ("st/mesa: move, clean-up shader variant key decls/inits")
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2 years agogitlab-ci: fix llvm version (7 doesn't have a ".0")
Eric Engestrom [Fri, 8 Mar 2019 17:02:59 +0000 (17:02 +0000)]
gitlab-ci: fix llvm version (7 doesn't have a ".0")

Fixes: 85ee157283c667372baf "gitlab-ci: autotools needs to be told which llvm version to use"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2 years agobuild: make passing an incorrect pointer type a hard error
Eric Engestrom [Tue, 20 Nov 2018 12:32:18 +0000 (12:32 +0000)]
build: make passing an incorrect pointer type a hard error

More or less any of this issue pointed out by the compiler is
a coding error. Make sure we flag it and bail loudly.

v2: - apply the change to autotools and scons as well (Emil)
    - C++ doesn't need this, it's already an error and the flag
      doesn't exist (Gert)
v3: - drop scons, flags are not checked so until someone adds that
      functionality we can't have this.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com> # v1
Reviewed-by: Emil Velikov <emil.velikov@collabora.com> # v1
[Emil: apply the same change to autotools and scons]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2 years agor600: cast pointer to expected type
Eric Engestrom [Thu, 7 Mar 2019 15:09:42 +0000 (15:09 +0000)]
r600: cast pointer to expected type

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
2 years agogitlab-ci: autotools needs to be told which llvm version to use
Eric Engestrom [Fri, 8 Mar 2019 16:02:11 +0000 (16:02 +0000)]
gitlab-ci: autotools needs to be told which llvm version to use

Fixes: 45d58cd91567b39f51af "gitlab-ci: only build the default (=latest) and oldest llvm versions"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2 years agogitlab-ci: only build the default (=latest) and oldest llvm versions
Eric Engestrom [Wed, 6 Mar 2019 17:59:03 +0000 (17:59 +0000)]
gitlab-ci: only build the default (=latest) and oldest llvm versions

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2 years agotravis: clean up
Eric Engestrom [Fri, 8 Mar 2019 15:33:39 +0000 (15:33 +0000)]
travis: clean up

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2 years agotravis: drop unused vars
Eric Engestrom [Fri, 8 Mar 2019 15:05:15 +0000 (15:05 +0000)]
travis: drop unused vars

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2 years agotravis: fix meson build by letting `auto` do its job
Eric Engestrom [Fri, 8 Mar 2019 15:04:54 +0000 (15:04 +0000)]
travis: fix meson build by letting `auto` do its job

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2 years agoautotools: don't build libGLES*.so with GLVND
Eric Engestrom [Tue, 5 Mar 2019 11:49:33 +0000 (11:49 +0000)]
autotools: don't build libGLES*.so with GLVND

GLVND already provides these, so distro packagers have been deleting
them all along. Let's save ourselves the trouble and not build them in
the first place.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2 years agomeson: don't build libGLES*.so with GLVND
Eric Engestrom [Tue, 5 Mar 2019 11:46:38 +0000 (11:46 +0000)]
meson: don't build libGLES*.so with GLVND

GLVND already provides these, so distro packagers have been deleting
them all along. Let's save ourselves the trouble and not build them in
the first place.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2 years agopipebuffer: s/PB_ALL_USAGE_FLAGS/PB_USAGE_ALL/
Brian Paul [Fri, 8 Mar 2019 15:07:23 +0000 (08:07 -0700)]
pipebuffer: s/PB_ALL_USAGE_FLAGS/PB_USAGE_ALL/

To fix build failure.  I guess my meson configuration has assertions
disabled for some reason.

Trivial fix.

2 years agosvga: remove SVGA_RELOC_READ flag in SVGA3D_BindGBSurface()
Brian Paul [Thu, 7 Mar 2019 23:14:32 +0000 (16:14 -0700)]
svga: remove SVGA_RELOC_READ flag in SVGA3D_BindGBSurface()

This fixes a rendering issue where UBO updates aren't always picked
up by drawing calls.  This issue effected the Webots robotics
simulator.  VMware bug 2175527.

Testing Done: Webots replay, piglit, misc Linux games

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
2 years agosvga: refactor draw_vgpu10() function
Brian Paul [Wed, 6 Mar 2019 17:16:57 +0000 (10:16 -0700)]
svga: refactor draw_vgpu10() function

The draw_vgpu10() function was huge.  Move the code for preparing the
vertex buffers and the index buffer into separate functions.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
2 years agost/mesa: whitespace, formatting fixes in st_cb_flush.c
Brian Paul [Thu, 7 Mar 2019 23:44:06 +0000 (16:44 -0700)]
st/mesa: whitespace, formatting fixes in st_cb_flush.c

Trivial.

2 years agost/mesa: move, clean-up shader variant key decls/inits
Brian Paul [Wed, 6 Mar 2019 17:23:59 +0000 (10:23 -0700)]
st/mesa: move, clean-up shader variant key decls/inits

Move the variant key declarations inside the scope they're used.
Use designated initializers instead of memset() calls.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
2 years agowinsys/svga: use new pb_usage_flags enum type
Brian Paul [Tue, 5 Mar 2019 21:20:29 +0000 (14:20 -0700)]
winsys/svga: use new pb_usage_flags enum type

And add a comment that we're implicitly converting PIPE_TRANSFER_
flags to PB_USAGE_ flags in one place.  And statically assert that
the enum values match.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
2 years agopipebuffer: whitespace fixes in pb_buffer.h
Brian Paul [Wed, 6 Mar 2019 02:47:25 +0000 (19:47 -0700)]
pipebuffer: whitespace fixes in pb_buffer.h

Reviewed-by: Neha Bhende <bhenden@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
2 years agopipebuffer: use new pb_usage_flags enum type
Brian Paul [Tue, 5 Mar 2019 21:08:35 +0000 (14:08 -0700)]
pipebuffer: use new pb_usage_flags enum type

Use a new enum type instead of 'unsigned' to make things a bit more
understandable.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
2 years agosvga: add svga shader type in the shader variant
Charmaine Lee [Wed, 6 Mar 2019 02:36:48 +0000 (19:36 -0700)]
svga: add svga shader type in the shader variant

With this patch, the svga shader type will be saved in the shader variant,
and there is no need to pass in the shader type to the define/destroy
variant functions.

Reviewed-by: Brian Paul <brianp@vmware.com>
2 years agogallium/util: add some const qualifiers in u_bitmask.c
Brian Paul [Tue, 5 Mar 2019 17:06:43 +0000 (10:06 -0700)]
gallium/util: add some const qualifiers in u_bitmask.c

And add/update comments.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2 years agogallium/util: whitespace cleanups in u_bitmask.[ch]
Brian Paul [Tue, 5 Mar 2019 17:05:18 +0000 (10:05 -0700)]
gallium/util: whitespace cleanups in u_bitmask.[ch]

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2 years agonir/linker: fix ARRAY_SIZE query with xfb varyings
Alejandro Piñeiro [Thu, 7 Mar 2019 15:57:10 +0000 (16:57 +0100)]
nir/linker: fix ARRAY_SIZE query with xfb varyings

For a non-array varying, it is expecting ARRAY_SIZE as 1, instead of 0.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2 years agonir/linker: Fix TRANSFORM_FEEDBACK_BUFFER_INDEX
Antia Puentes [Sat, 22 Dec 2018 17:40:29 +0000 (18:40 +0100)]
nir/linker: Fix TRANSFORM_FEEDBACK_BUFFER_INDEX

From the ARB_enhanced_layouts specification:

  "For the property TRANSFORM_FEEDBACK_BUFFER_INDEX, a single integer
   identifying the index of the active transform feedback buffer
   associated with an active variable is written to <params>.  For
   variables corresponding to the special names "gl_NextBuffer",
   "gl_SkipComponents1", "gl_SkipComponents2", "gl_SkipComponents3",
   and "gl_SkipComponents4", -1 is written to <params>."

We were storing the xfb_buffer value, instead of the value
corresponding to GL_TRANSFORM_FEEDBACK_BUFFER_INDEX.

Note that the implementation assumes that varyings would be sorted by
offset and buffer.

Signed-off-by: Antia Puentes <apuentes@igalia.com>
Signed-off-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2 years agonir/linker: use nir_gather_xfb_info
Alejandro Piñeiro [Wed, 7 Nov 2018 09:11:20 +0000 (10:11 +0100)]
nir/linker: use nir_gather_xfb_info

Instead of a custom ARB_gl_spirv xfb gather info pass.

In fact, this is not only about reusing code, but the current custom
code was not handling properly how many varyings are enumerated from
some complex types. So this change is also about fixing some corner
cases.

v2: Use util_bitcount, simplify current stage check (Kenneth)

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2 years agonir/xfb: handle arrays and AoA of basic types
Alejandro Piñeiro [Thu, 10 Jan 2019 14:04:37 +0000 (15:04 +0100)]
nir/xfb: handle arrays and AoA of basic types

On OpenGL, a array of a simple type adds just one varying. So
gl_transform_feedback_varying_info struct defined at mtypes.h includes
the parameters Type (base_type) and Size (number of elements).

This commit checks this when the recursive add_var_xfb_outputs call
handles arrays, to ensure that just one is addded.

We also need to take into account AoA here

v2: use glsl_type_is_leaf from nir_types (Timothy Arceri)

v3: simplified aoa check, without the need ot using glsl_type_is_leaf,
    using glsl_types_is_struct (Timothy Arceri)

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2 years agonir_types: add glsl_type_is_struct helper
Alejandro Piñeiro [Thu, 7 Mar 2019 10:33:03 +0000 (11:33 +0100)]
nir_types: add glsl_type_is_struct helper

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2 years agonir/xfb: sort varyings too
Alejandro Piñeiro [Thu, 7 Mar 2019 16:42:49 +0000 (17:42 +0100)]
nir/xfb: sort varyings too

Right now we are only re-sorting outputs. But it is better to sort too
varyings, as linker expect them to be sorted out (as it was done on
GLSL). For varyings, and to make easier to compute buffer_index, we
sort also by buffer. We could do the same for outputs, but we lack a
reason for that, so we left it as it is (just offset).

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2 years agonir/xfb: adding varyings on nir_xfb_info and gather_info
Alejandro Piñeiro [Wed, 9 Jan 2019 17:19:45 +0000 (18:19 +0100)]
nir/xfb: adding varyings on nir_xfb_info and gather_info

In order to be used for OpenGL (right now for ARB_gl_spirv).

This commit adds two new structures:

  * nir_xfb_varying_info: that identifies each individual varying. For
    each one, we need to know the type, buffer and xfb_offset

  * nir_xfb_buffer_info: as now for each buffer, in addition to the
    stride, we need to know how many varyings are assigned to it.

For this patch, the only case where num_outputs != num_varyings is
with the case of doubles, that for dvec3/4 could require more than one
output. There are more cases though (like aoa), that will be handled
on following patches.

v2: updated after new nir general XFB support introduced for "anv: Add
    support for VK_EXT_transform_feedback"

v3: compute num_varyings beforehand for allocating, instead of relying
    on num_outputs as approximate value (Timothy Arceri)

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2 years agonir_types: add glsl_varying_count helper
Alejandro Piñeiro [Wed, 6 Mar 2019 14:15:54 +0000 (15:15 +0100)]
nir_types: add glsl_varying_count helper

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2 years agonir/xfb: add component_offset at nir_xfb_info
Alejandro Piñeiro [Tue, 6 Nov 2018 17:10:01 +0000 (18:10 +0100)]
nir/xfb: add component_offset at nir_xfb_info

Where component_offset here is the offset when accessing components of
a packed variable. Or in other words, location_frac on
nir.h. Different places of mesa use different names for it.

Technically nir_xfb_info consumer can get the same from the
component_mask, it seems somewhat forced to make it to compute it,
instead of providing it.

v2: rename local location_frac for comp_offset, more similar to the
intended use (Timothy Arceri)

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2 years agoRevert "radv: execute external subpass barriers after ending subpasses"
Samuel Pitoiset [Fri, 8 Mar 2019 13:51:02 +0000 (14:51 +0100)]
Revert "radv: execute external subpass barriers after ending subpasses"

This changes is actually wrong because we have to sync
before doing image layout transitions.

This fixes rendering issues in Batman, Path of Exile and
probably more titles.

This reverts commit 76c17cfd8da017ebd19be33ba6cef888957a6758.

Fixes: 76c17cfd8da ("radv: execute external subpass barriers after ending subpasses")
Cc: 19.0 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2 years agointel/error2aub: support older style engine names
Lionel Landwerlin [Fri, 16 Nov 2018 18:13:36 +0000 (18:13 +0000)]
intel/error2aub: support older style engine names

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
2 years agointel/error2aub: deal with GuC log buffer
Lionel Landwerlin [Tue, 4 Sep 2018 16:33:45 +0000 (17:33 +0100)]
intel/error2aub: deal with GuC log buffer

When Guc is enabled, the error state will contain a "global" buffer
for the GuC log buffer.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
2 years agointel/error2aub: add a verbose option
Lionel Landwerlin [Thu, 23 Aug 2018 18:01:47 +0000 (19:01 +0100)]
intel/error2aub: add a verbose option

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
2 years agointel/error2aub: write GGTT buffers into the aub file
Lionel Landwerlin [Tue, 4 Sep 2018 13:45:37 +0000 (14:45 +0100)]
intel/error2aub: write GGTT buffers into the aub file

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
2 years agointel/error2aub: store engine last ring buffer head/tail pointers
Lionel Landwerlin [Tue, 4 Sep 2018 13:50:13 +0000 (14:50 +0100)]
intel/error2aub: store engine last ring buffer head/tail pointers

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
2 years agointel/error2aub: annotate buffer with their address space
Lionel Landwerlin [Tue, 4 Sep 2018 13:18:35 +0000 (14:18 +0100)]
intel/error2aub: annotate buffer with their address space

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
2 years agointel/error2aub: parse other buffer types
Lionel Landwerlin [Tue, 4 Sep 2018 12:44:49 +0000 (13:44 +0100)]
intel/error2aub: parse other buffer types

We don't write them in the aub file yet.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
2 years agointel/error2aub: strenghten batchbuffer identifier marker
Lionel Landwerlin [Tue, 4 Sep 2018 12:36:11 +0000 (13:36 +0100)]
intel/error2aub: strenghten batchbuffer identifier marker

Found out that some base64 data matched the '---' identifier. We can
avoid this by adding the surrounding spaces.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
2 years agointel/error2aub: identify buffers by engine
Lionel Landwerlin [Tue, 4 Sep 2018 12:32:44 +0000 (13:32 +0100)]
intel/error2aub: identify buffers by engine

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
2 years agointel/error2aub: build a list of BOs before writing them
Lionel Landwerlin [Thu, 23 Aug 2018 17:06:22 +0000 (18:06 +0100)]
intel/error2aub: build a list of BOs before writing them

The error state contains several kind of BOs, including the context
image which we will want to write in a later commit. Because it can
come later in the error state than the user buffers and because we
need to write it first in the aub file, we have to first build a list
of BOs and then write them in the appropriate order.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
2 years agoiris: Wire up EGL_IMG_context_priority
Chris Wilson [Fri, 22 Feb 2019 23:31:56 +0000 (23:31 +0000)]
iris: Wire up EGL_IMG_context_priority

Add the missing PIPE_CAP_CONTEXT_PRIORITY_MASK and parsing of the context
construction flags.

Testcase: piglit/egl-context-priority

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2 years agoiris: Export a copy_region helper that doesn't flush
Kenneth Graunke [Mon, 24 Dec 2018 08:27:09 +0000 (00:27 -0800)]
iris: Export a copy_region helper that doesn't flush

I'll want to use this for transfer maps, which already do their own
flushing.  This lets us avoid a double flush, and also gives us more
control over the batch which is selected.

2 years agoiris: Spruce up "are we using this engine?" checks for flushing
Kenneth Graunke [Tue, 5 Mar 2019 09:21:53 +0000 (01:21 -0800)]
iris: Spruce up "are we using this engine?" checks for flushing

We were using batch->contains_draw as a proxy for "are we even using
this engine?"  That isn't quite right, because it only counts regular
draws.  BLORP operations may have also rendered to a resource, which
needs to trigger flushing.  To check for this, we also see if the
render and sometimes depth caches are non-empty.

We can also drop the "but there might already be stale data in the
cache even if we haven't emitted any commands yet" concern in the
comments.  The kernel flushes caches between batches.

This may not be great but it's at least better than what was there.

2 years agoradeonsi/nir: Only set window_space_position for vertex shaders.
Timur Kristóf [Thu, 7 Mar 2019 07:19:02 +0000 (08:19 +0100)]
radeonsi/nir: Only set window_space_position for vertex shaders.

By mistake, this was previously set for all shaders.
It is a vertex shader property so only makes sense to
set it for vertex shaders.

Signed-Off-By: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-By: Timothy Arceri <tarceri@itsqueeze.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
2 years agonir/builder: Add a build_deref_array_imm helper
Jason Ekstrand [Thu, 7 Mar 2019 17:45:13 +0000 (11:45 -0600)]
nir/builder: Add a build_deref_array_imm helper

Unlike most of the cases in which we do this by hand, the new helper
properly handles non-32-bit pointers.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2 years agonir/builder: Cast array indices in build_deref_follower
Jason Ekstrand [Tue, 5 Mar 2019 22:06:31 +0000 (16:06 -0600)]
nir/builder: Cast array indices in build_deref_follower

There's no guarantee when build_deref_follower is called that the two
derefs have the same bit size destination.  Insert a cast on the array
index in case we have differing bit sizes.  While we're here, insert
some asserts in build_deref_array and build_deref_ptr_as_array.  The
validator will catch violations here but they're easier to debug if we
catch them while building.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2 years agonir/builder: Emit better code for iadd/imul_imm
Jason Ekstrand [Wed, 6 Mar 2019 18:27:26 +0000 (12:27 -0600)]
nir/builder: Emit better code for iadd/imul_imm

Because we already know the immediate right-hand parameter, we can
potentially save the optimizer a bit of work.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
2 years agofreedreno/a6xx: perfcntrs
Rob Clark [Thu, 7 Mar 2019 19:22:24 +0000 (14:22 -0500)]
freedreno/a6xx: perfcntrs

Signed-off-by: Rob Clark <robdclark@gmail.com>
2 years agofreedreno/a6xx: fix border-color swizzles
Rob Clark [Wed, 6 Mar 2019 15:34:53 +0000 (10:34 -0500)]
freedreno/a6xx: fix border-color swizzles

Fixes nearly all of the remaining
dEQP-GLES31.functional.texture.border_clamp.formats.* fails

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
2 years agofreedreno/a6xx: refactor fd6_tex_swiz()
Rob Clark [Wed, 6 Mar 2019 15:04:21 +0000 (10:04 -0500)]
freedreno/a6xx: refactor fd6_tex_swiz()

We need a version of fd6_tex_swiz() that just returns the composed
swizzle without building part of the TEX_CONST_0 state.  So just
refactor the existing function to build more of the TEX_CONST_0 state,
and leave fd6_tex_swiz() simply composing swizzles.

The small IBO state change (to use LINEAR for smaller sizes/levels) is
to match the state in fd6_tex_const_0().  It seems like maybe tiled
actually works at the smaller sizes but not if minification is in play,
so best just to make images match what we do for textures.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
2 years agofreedreno/a6xx: remove astc_srgb workaround
Rob Clark [Wed, 6 Mar 2019 14:44:14 +0000 (09:44 -0500)]
freedreno/a6xx: remove astc_srgb workaround

Not used on a6xx, so remove some of the related plumbing that was copied
over from older gens.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2 years agofreedreno: fix ir3_cmdline build
Rob Clark [Thu, 7 Mar 2019 20:32:11 +0000 (15:32 -0500)]
freedreno: fix ir3_cmdline build

Fixes: 7530d4abfcf glsl/freedreno/panfrost: pass gl_context to the standalone compiler
Signed-off-by: Rob Clark <robdclark@gmail.com>
2 years agoiris: Drop PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY
Kenneth Graunke [Wed, 19 Dec 2018 10:17:42 +0000 (02:17 -0800)]
iris: Drop PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY

This cap is mainly for working around a r600 texture swizzle issue,
but it also controls whether ARB_texture_buffer_object (with legacy
formats) is enabled.  I suspect the missing I/L/A/LA faking is why
I had it set in the first place.

Thanks to Ilia for pointing out that I shouldn't be setting this.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2 years agoiris: Properly support alpha and luminance-alpha formats
Kenneth Graunke [Fri, 22 Feb 2019 06:49:40 +0000 (22:49 -0800)]
iris: Properly support alpha and luminance-alpha formats

For texturing, we map alpha formats to the corresponding red format,
as many alpha formats are outright missing, and red is more efficient
when sampling anyway.

When rendering to A8_UNORM, we use that format directly, so the image
gets the shader output's .a/.w channel, rather than the .r/.x channel.

All other A* formats are non-renderable, so we can't do much and just
mark them as unsupported for rendering.  Fortunately, GL only requires
rendering to A8_UNORM, so that works out.

According to Andre Heider and Timur Kristóf, this fixes font rendering
in Witcher 1 (via nine).  Andre also reported that it fixes Unigine
Heaven (presumably via nine).

v2: Use the same swizzle for both sampler views and "render targets".
    BLORP expects the read swizzle, and will take the inverse when
    setting up the destination swizzle (and actually applying it in
    the shaders).  We ignore the format swizzle when setting up normal
    rendering SURFACE_STATEs, which is necessary because it would be
    an illegal shader channel select combination.  Thanks to Jason
    Ekstrand for pointing out that BLORP took an inverse swizzle.

Tested-by: Timur Kristóf <timur.kristof@gmail.com>
Tested-by: Andre Heider <a.heider@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2 years agoiris: Defer uploading sampler state tables until draw time
Kenneth Graunke [Tue, 4 Dec 2018 23:34:30 +0000 (15:34 -0800)]
iris: Defer uploading sampler state tables until draw time

Gallium might call us multiple times to bind subsets of the samplers,
at which point we'd recreate the table a bunch of times.  It doesn't
really buy us anything to do it here - even if we defer to draw time,
the dirty tracking ensures we'll only do it on the first draw after a
bind_sampler_states() call.

We now use the number of samplers specified by the shader instead of
the binding count.  If this number changes, we flag sampler state as
dirty so we re-upload a table with the right number of entries.

This also fixes a bug where ice->state.need_border_colors was never
unset, so once something needed border colors, the pool would always
be pinned in all future batches.

v2: Explicitly flag sampler states as dirty, rather than assuming that
    bind_sampler_states() will be called if the program texture count
    changes.  While this may be true for st/mesa, it isn't the case for
    Gallium HUD.

Tested-by: Timur Kristóf <timur.kristof@gmail.com>
Tested-by: Andre Heider <a.heider@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2 years agoiris: Plumb through ISL_SWIZZLE_IDENTITY in buffer surface emitters
Kenneth Graunke [Thu, 28 Feb 2019 09:13:33 +0000 (01:13 -0800)]
iris: Plumb through ISL_SWIZZLE_IDENTITY in buffer surface emitters

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>