Commit Graph

98550 Commits

Author SHA1 Message Date
Rob Clark 77c595358f freedreno/ir3: handle input/output component
After the mesa/st nir linking support, we start to see inputs/outputs
like:

   decl_var shader_out INTERP_MODE_NONE float packed:uv (VARYING_SLOT_VAR9.x, 1, 0)
   decl_var shader_out INTERP_MODE_NONE float packed:uv@0 (VARYING_SLOT_VAR9.y, 1, 0)

(ie. were location_frac != .x)

Unfortunately I overlooked the addition of the component parameter to
load_input/store_output, so when we started encountering inputs/outputs
with component other than .x, we'd end up loading/storing the wrong
input/output.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2017-12-05 16:03:38 -05:00
Rob Clark fd6a96635e mesa/st: move cloning of NIR shader for compute
Since in the NIR case, driver takes ownership of the NIR shader, we need
to clone what is passed to the driver.  Normally this is done as part of
creating the shader variant (where is clone is anyways needed).  But
compute shaders have no variants, so we were cloning earlier.

The problem is that after the NIR linking optimizations, we ended up
cloning *before* all the lowering passes where done.

So move this into st_get_cp_variant(), to make compute shaders work more
like other shader stages.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-12-05 16:03:38 -05:00
Dave Airlie 12a96aaf90 r600: refactor and export some shader selector code for compute
This just moves some code around to make it easier to add compute.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-12-05 20:31:50 +00:00
Dave Airlie ca64281690 r600: add compute support to compressed resource handling.
This just adds support for decompressing compute resources.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-12-05 20:31:48 +00:00
Dave Airlie 5c78d000e6 r600: update max threads per block for evergreen compute
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-12-05 20:31:37 +00:00
Dave Airlie 5f15d35efc r600/shader: add local memory support to shader assembler.
This is needed for compute shaders.

v1.1: make work for vectors, fix missing lds ops.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-12-05 20:31:34 +00:00
Dave Airlie dd3630f71c r600/cs: add support for compute to image/buffers/atomics state
This just adds the compute paths to state handling for the
main objects

Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-12-05 20:31:24 +00:00
Dave Airlie 84feb6c24a r600: handle compute null key shader state
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-12-05 20:31:13 +00:00
Dave Airlie 9b8b78b457 r600: add some missing cayman register defines
These are just taken from the kernel, and were seen in some fglrx dumps.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-12-05 20:09:43 +00:00
Dave Airlie 3a403a9797 r600: don't set EOP on pop or loop end
This appears to bad, compute shaders hang without it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-12-05 20:09:33 +00:00
Dave Airlie 2fdc21bcab r600/ssbo: refactor out buffer coord calcs and use for atomic path.
The atomic rat path has a bug in the ssbo path, refactor out the
address calcs from the load/store paths and reuse to fix the bug
in the buffer rat atomic path.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-12-05 20:07:08 +00:00
Dave Airlie a256506b76 r600/ssbo: fix multi-dword buffer loads.
This fixes loading from different channels.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-12-05 20:07:08 +00:00
Dave Airlie 989697eccc r600/ssbo: use r32ui format for ssbo resources.
This works best for returning the correct values and sizes in
tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-12-05 20:07:08 +00:00
Dave Airlie 275293b2b4 r600: refactor out the immediate setup code.
This just refactors the same code out of the images/buffers paths.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-12-05 20:07:07 +00:00
Dave Airlie df21cd5248 r600/shader: fix ssbo atomic operations formats.
Don't try and use the image format for ssbo, just 32-bit uint.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-12-05 20:07:07 +00:00
Dave Airlie 4ee2b7c452 r600/shader: fix thread id loading.
This just changes how thread id loading is done, it makes
smaller shaders if we don't use thread id gprs.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-12-05 20:07:07 +00:00
Rob Herring 20d37da597 Android: enable noreturn and returns_nonnull attributes
Commit 94ca8e04ad ("spirv: Add vtn_fail and vtn_assert helpers") broke
Android builds which have -Werror enabled with the following errors:

external/mesa3d/src/compiler/spirv/spirv_to_nir.c:272:1: error: control may reach end of non-void function [-Werror,-Wreturn-type]
external/mesa3d/src/compiler/spirv/spirv_to_nir.c:810:1: error: control may reach end of non-void function [-Werror,-Wreturn-type]
...

The problem is the noreturn attribute is not enabled and we to define
HAVE_FUNC_ATTRIBUTE_NORETURN.

Auditing src/util/macros.h, we're also missing
HAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL and HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT,
so add them too.

Fixes: 94ca8e04ad ("spirv: Add vtn_fail and vtn_assert helpers")
Cc: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Rob Herring <robh@kernel.org>
2017-12-05 07:47:04 -06:00
Marek Olšák dbad0acfaf gallium/u_upload_mgr: allow drivers to specify pipe_resource::flags
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-12-05 13:30:35 +01:00
Marek Olšák c7f84f6513 winsys/amdgpu: add RADEON_FLAG_READ_ONLY
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-12-05 13:30:34 +01:00
Marek Olšák cccf09677f gallium/radeon: remove RADEON_HEAP_VRAM_GTT
Only winsyses can set VRAM|GTT. Drivers shouldn't if they want to use
winsys allocators.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-12-05 13:30:34 +01:00
Marek Olšák 9ac5504df5 gallium/radeon: move setting VRAM|GTT into winsyses
The combined VRAM|GTT heap will be removed.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-12-05 13:30:34 +01:00
Marek Olšák 5e805cc74b radeonsi: flush the context after resource_copy_region for buffer exports
Cc: 17.2 17.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-12-05 13:28:00 +01:00
Mauro Rossi cd8554502e Android: gallium/radeon: fix libmesa_amd_common dependency
libmesa_amd_common static dependency is added in Android build
to avoid the following building errors:

In file included from external/mesa/src/gallium/drivers/radeon/r600_buffer_common.c:24:
In file included from external/mesa/src/gallium/drivers/radeonsi/si_pipe.h:26:
external/mesa/src/gallium/drivers/radeonsi/si_shader.h:138:10: fatal error: 'ac_binary.h' file not found
         ^~~~~~~~~~~~~
1 error generated.
...
In file included from external/mesa/src/gallium/drivers/radeon/r600_gpu_load.c:34:
In file included from external/mesa/src/gallium/drivers/radeonsi/si_pipe.h:26:
external/mesa/src/gallium/drivers/radeonsi/si_shader.h:138:10: fatal error: 'ac_binary.h' file not found
         ^~~~~~~~~~~~~
1 error generated.

Fixes: 950221f923 ("radeonsi: remove r600_common_screen")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-12-05 12:05:21 +00:00
Dave Airlie b501ef164e st/mesa: handle compute atomics
Just reuse the cs atomics bit and emit the hw atomic state.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-12-05 10:38:35 +00:00
Dave Airlie 05f594f229 r600/atomic: add cayman version of atomic save/restore from GDS (v2)
On Cayman we don't use the append/consume counters (fglrx doesn't)
and they don't seem to work well with compute shaders.

This just uses GDS instead to do the atomic operations.

v1.1: remove unused line.
v2: use EOS on cayman, it appears to work.

Acked-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-12-05 10:38:07 +00:00
Dave Airlie cf6d3caee2 r600/atomic: refactor out evergreen atomic setup/save code.
For cayman we want to use different code paths.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-12-05 10:38:04 +00:00
Timothy Arceri e9e6476ae5 radeonsi: pass llvm type directly to buffer_load()
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-12-05 15:15:36 +11:00
Dylan Baker 6b4c7047d5 meson: build gallium nine state_tracker
v2: - set d3d_drivers_path instead of dri_drivers_path
    - Fix nine guard to check for all relavent gallium drivers
    - Link with libswdri and libswkmsdri when necessary
    - Fix pkg-config generation
    - Add missing comma

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-12-04 14:36:58 -08:00
Dylan Baker 0ba909f0f1 meson: build gallium xa state tracker
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-12-04 14:36:56 -08:00
Dylan Baker 5a785d51a6 meson: build gallium va state tracker
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-12-04 14:36:53 -08:00
Dylan Baker 1d36dc674d meson: build gallium omx state tracker
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-12-04 14:36:51 -08:00
Dylan Baker 22a817af8a meson: build gallium xvmc state tracker
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-12-04 14:36:48 -08:00
Dylan Baker 68076b8747 meson: build gallium vdpau state tracker
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-12-04 14:36:38 -08:00
Dylan Baker 085070a2c8 meson: drop gallium-media argument
This argument is the wrong approach for handling gallium media state
trackers, since it doesn't allow for an auto option. Instead we'll use
tristates, which do allow for auto.

This option has never been wired to anything anyway.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-12-04 14:36:35 -08:00
Dylan Baker f7f1b30f81 meson: extend install_megadrivers script to handle symmlinking
Which is required for the gallium media state trackers.

v2: - Make symlinks local instead of absolute

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-12-04 14:36:26 -08:00
Dylan Baker b065de05c6 meson: Add osmesa.sym script as a link dependency (gallium-osmesa)
v2: - Add this patch

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-12-04 14:36:19 -08:00
Dylan Baker 0cb6d69a72 meson: use driver_deps for gallium osmesa
v2: - Put driver_swrast in the correct field (dependencies)
    - Remove unused osmesa_deps

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Acked-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-12-04 14:36:10 -08:00
Dylan Baker 60283769ec meson: Use driver dependencies for libgl-xlib target
v2: - put driver_swrast in the right field
    - add dep_threads (dep_llvm requires threads, so it masked this
      previously)

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Acked-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-12-04 14:35:48 -08:00
Dylan Baker 95a791f63e meson: use the driver dependencies for the gallium dri target
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-12-04 14:35:43 -08:00
Dylan Baker 0bbecc5a85 meson: define driver dependencies
This allow us to encapsulate the compiler and linkage requirements of
each driver in a reusable way. The result will be that each target that
needs a specific driver can simply add `driver_<name>` to its
dependencies line and the necessary libraries and compiler args will be
added. This will allow for a lot of code de-duplication between gallium
targets.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-12-04 14:35:36 -08:00
Dylan Baker 831d2fb012 meson: sort gallium drivers after winsys
This is a requirement of the next patch. Since meson does not have
forward declarations, and we're going to define the driver dependencies
in the drivers folder they need to be after the winsys so that the
winsys libs are defined first.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-12-04 14:35:31 -08:00
Dylan Baker 383cdaf990 meson: Combine gallium target subdirs
So that state trackers, targets, and special winsys requirements are all
in a single if statement. This is a cosmetic only cleanup with no
functional changes.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-12-04 14:35:03 -08:00
Nanley Chery 0a257b3fe4 i965/cnl: Avoid fast-clearing sRGB render buffers
Gen10 doesn't automatically decode the clear color of sRGB buffers. To
get correct rendering, avoid fast-clearing such buffers for now.

The driver now passes the following piglit tests:
* spec@arb_framebuffer_srgb@msaa-fast-clear
* spec@ext_texture_srgb@multisample-fast-clear gl_ext_texture_srgb

Suggested-by: Kenneth Graunke <kenneth@whitecape.org>
Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-12-04 14:21:47 -08:00
Dylan Baker 6a9611763b meson: Fix overlinkage of dri3 loader
This was covering for underinkage elsewhere. With that fixed these can
be removed.

v2: - sort dependencies

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk> (v1)
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (v1)
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-12-04 13:15:13 -08:00
Dylan Baker d2e9ba2782 meson: fix underlinkage without dri3
There are some case where the dri3 loader is covering for underlinkage
for GLX and EGL, provide the linkage that they actually need.

v2: - remove dep_xcb_dri3 from glx. This was an oversight in v1 and is
      not needed.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk> (v1)
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (v1)
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-12-04 13:15:02 -08:00
Dylan Baker b08a35b150 meson: Reformat glx code to match more common style
Generally in our meson build large arrays are formated in the form:
[
  ..., ..., ..., $
  ...,
]

So use that form

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-12-04 13:14:00 -08:00
Samuel Pitoiset 5de7c782fb radv: fix a crash in radv_can_dump_shader()
module can be NULL, oops.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2017-12-04 19:52:14 +01:00
Chad Versace a932aee7a8 intel/isl: Declare private array as static const
It's array isl_drm.c:modifier_info[] .

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2017-12-04 10:16:33 -08:00
Dylan Baker 2be2565b9e meson: Install dri.pc file when building gallium dri drivers
Currently this pkg-config file is only installed if a classic dri driver
is built. This is wrong, it should be installed if any dri driver is
installed, which includes the gallium dri target.

Reported-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-12-04 10:14:09 -08:00
Lionel Landwerlin 2ead8f1690 anv: query CS timestamp frequency from the kernel
The reference value in gen_device_info isn't going to be acurate on
Gen10+. We should query it from the kernel, which reads a couple of
register to compute the actual value.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
2017-12-04 18:05:20 +00:00