Commit Graph

98339 Commits

Author SHA1 Message Date
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
Lionel Landwerlin b66e4b51bf i965: read CS timestamp frequency from the kernel on Gen10+
We cannot figure this value out of the PCI-id anymore. Let's read it
from the kernel (which computes this from a few registers).

When running on a (upcoming) 4.16-rc1+ kernel, this will fixes piglit
tests on CNL :

    spec@arb_timer_query@query gl_timestamp
    spec@arb_timer_query@timestamp-get
    spec@ext_timer_query@time-elapsed

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
Lionel Landwerlin aa8a2a8670 drm-uapi: Update drm/i915 headers from drm-next
Taken from drm-next ca797d29cd63e7b71b4eea29aff3b1cefd1ecb59

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
Jason Ekstrand 1e565bc6ce radv: Implement VK_KHR_get_surface_capabilities2
The WSI core code does all the hard work.  Just add the wrappers and
turn it on.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
2017-12-04 10:04:19 -08:00
Jason Ekstrand 0a10e3770f vulkan/wsi: Initialize individual WSI interfaces in wsi_device_init
Now that we have anv_device_init/finish functions, there's no reason to
have the individual driver do any more work than that.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
2017-12-04 10:04:19 -08:00
Jason Ekstrand 2e3e55110b vulkan/wsi: Drop some unneeded cruft from the API
This drops the unneeded callbacks struct as well as the queue_get_family
callback we were using before we'd pulled QueuePresent inside.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
2017-12-04 10:04:19 -08:00
Jason Ekstrand c1b1be5196 vulkan/wsi: Add wrappers for all of the surface queries
This lets us move wsi_interface to wsi_common_private.h

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
2017-12-04 10:04:19 -08:00
Jason Ekstrand 82931dc007 vulkan/wsi: Drop the can_handle_different_gpu parameter from get_support
Both anv and radv can handle prime now.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
2017-12-04 10:04:19 -08:00
Jason Ekstrand 3131fd9dec vulkan/wsi: Move wsi_swapchain to wsi_common_private.h
The drivers no longer poke at this directly.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
2017-12-04 10:04:19 -08:00
Jason Ekstrand 516dfb34e1 vulkan/wsi: Add a helper for AcquireNextImage
Unfortunately, due to the fact that AcquireNextImage does not take a
queue, the ANV trick for triggering the fence won't work in general.  We
leave dealing with the fence up to the caller for now.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
2017-12-04 10:04:19 -08:00
Dave Airlie 8ff49951c3 vulkan/wsi: move swapchain create/destroy to common code
v2 (Jason Ekstrand):
 - Rebase
 - Alter the names of the helpers to better match the vulkan entrypoints
 - Use the helpers in anv

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
2017-12-04 10:04:19 -08:00
Jason Ekstrand ad4c60d6b8 vulkan/wsi: Move prime blitting into queue_present
This lets us save a QueueSubmit and it also makes prime a lot less
X11-specific.  Also, it means we can only wait on the semaphores once
instead of on every blit.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2017-12-04 10:04:19 -08:00