Commit Graph

108972 Commits

Author SHA1 Message Date
Tapani Pälli 105002bd2d 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: 14f6275c92 ("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>
2019-03-11 08:13:01 +02:00
Timothy Arceri 051b4064da 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>
2019-03-11 16:16:04 +11:00
Kenneth Graunke f36794d1f0 iris: Fix backface stencil write condition
A bit too much search and replace here.
2019-03-10 14:52:53 -07:00
Alyssa Rosenzweig ea2cd73625 panfrost/drm: Cast pointer to u64 to fix warning
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2019-03-10 19:16:56 +00:00
Tomeu Vizoso 756f7b9989 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>
2019-03-10 19:09:23 +00:00
Tomeu Vizoso d4dc79df72 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>
2019-03-10 18:56:56 +00:00
Rob Clark 941adcef03 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>
2019-03-10 11:40:06 -04:00
Eric Engestrom db944999a1 gitlab-ci: add panfrost to the gallium drivers build
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2019-03-09 23:25:12 +00:00
Eric Engestrom e6ba67dd65 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: e67e072637 "panfrost: Implement Midgard shader toolchain"
Cc: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2019-03-09 22:37:40 +00:00
Eric Engestrom d4d29c0455 panfrost: fix tgsi_to_nir() call
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=109945
Fixes: 7da251fc72 "panfrost: Check in sources for command stream"
Cc: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2019-03-09 22:06:19 +00:00
Axel Davy 5475434fa6 Revert "d3dadapter9: Support software renderer on any DRI device"
This reverts commit 0d08476593.

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

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
2019-03-09 14:29:43 +01:00
Axel Davy 597b5e27fa 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>
2019-03-09 13:57:49 +01:00
Axel Davy 0d3c37e2f9 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>
2019-03-09 13:57:49 +01:00
Axel Davy a8583e75d6 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>
2019-03-09 13:57:49 +01:00
Patrick Rudolph 0d08476593 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>
2019-03-09 13:57:49 +01:00
Axel Davy f7b9c09c7c 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>
2019-03-09 13:57:49 +01:00
Elie Tournier d7b3196976 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>
2019-03-09 11:33:20 +01:00
Elie Tournier 1f1514e1aa 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>
2019-03-09 11:33:14 +01:00
Elie Tournier 8ad1e86bb0 virgl: Add a caps to advertise GLES backend
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: <Gurchetan Singh gurchetansingh@chromium.org>
2019-03-09 11:32:30 +01:00
Kenneth Graunke da51e3f1b0 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.
2019-03-09 01:42:16 -08:00
Ian Romanick 18e4bf65de 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>
2019-03-08 22:24:19 -08:00
Ian Romanick 55c1ac4b75 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>
2019-03-08 22:24:19 -08:00
Ian Romanick 9aaaac6080 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>
2019-03-08 22:24:19 -08:00
Ian Romanick 37ee462e03 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>
2019-03-08 22:24:19 -08:00
Jason Ekstrand 8fdee457a4 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>
2019-03-08 22:03:34 -06:00
Jason Ekstrand 179d254cba 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>
2019-03-08 22:03:14 -06:00
Rob Clark ad25948261 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: 1d8994a63b glsl: [u/i]mulExtended optimization for GLSL
Signed-off-by: Rob Clark <robdclark@gmail.com>
2019-03-08 18:44:57 -05:00
Rob Clark 53083e4fbc freedreno/ir3: fix ir3_cmdline harder
Fixes: 45271702ec freedreno: fix ir3_cmdline build
Fixes: 7530d4abfc glsl/freedreno/panfrost: pass gl_context to the standalone compiler
Signed-off-by: Rob Clark <robdclark@gmail.com>
2019-03-08 18:44:57 -05:00
Eric Anholt fafead7b62 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: 59527a36e9 ("v3d: Restructure RO allocations using
resource_from_handle.")
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
2019-03-08 15:33:35 -08:00
Kenneth Graunke 9d1334d2a0 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).
2019-03-08 13:29:39 -08:00
Eric Engestrom f67c870179 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: e1d81decf7 "build: make passing an incorrect pointer type a hard error"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2019-03-08 21:14:24 +00:00
Karol Herbst 8a8742d327 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>
2019-03-08 10:35:12 -08:00
Sagar Ghuge bca28deb46 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>
2019-03-08 10:01:39 -08:00
Sagar Ghuge d0a8fba69a 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>
2019-03-08 10:01:39 -08:00
Eric Engestrom 6e3d3f5b2c 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>
2019-03-08 18:00:19 +00:00
Eric Engestrom b1218d8cf7 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>
2019-03-08 18:00:19 +00:00
Brian Paul 0de83bacf0 intel/compiler: silence unitialized variable warning in opt_vector_float()
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2019-03-08 10:23:11 -07:00
Brian Paul b5ea56e411 intel/decoders: silence uninitialized variable warnings in gen_print_batch()
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2019-03-08 10:23:11 -07:00
Brian Paul e5e2be3c73 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: 67d96816ff ("st/mesa: move, clean-up shader variant key decls/inits")

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2019-03-08 10:23:11 -07:00
Eric Engestrom d2cff164cd gitlab-ci: fix llvm version (7 doesn't have a ".0")
Fixes: 85ee157283 "gitlab-ci: autotools needs to be told which llvm version to use"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2019-03-08 17:03:06 +00:00
Eric Engestrom e1d81decf7 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>
2019-03-08 16:24:06 +00:00
Eric Engestrom 598f10eacc r600: cast pointer to expected type
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
2019-03-08 16:24:06 +00:00
Eric Engestrom 85ee157283 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>
2019-03-08 16:03:04 +00:00
Eric Engestrom 3006f9d8c0 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>
2019-03-08 15:59:27 +00:00
Eric Engestrom 08b70e1c2b travis: clean up
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2019-03-08 15:33:39 +00:00
Eric Engestrom e2f528bf21 travis: drop unused vars
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2019-03-08 15:17:42 +00:00
Eric Engestrom 44c420aa1b travis: fix meson build by letting `auto` do its job
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2019-03-08 15:17:42 +00:00
Eric Engestrom 9cf85d3b78 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>
2019-03-08 15:13:36 +00:00
Eric Engestrom b01524fff0 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>
2019-03-08 15:13:36 +00:00
Brian Paul 2c387819f4 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.
2019-03-08 08:07:24 -07:00