summaryrefslogtreecommitdiffstats
path: root/src/amd
Commit message (Collapse)AuthorAgeFilesLines
* Revert "configure: allow building with python3"Emil Velikov2018-08-242-6/+6
| | | | | | | | | | | | | | This reverts commit ae7898dfdbe5c8dab7d11c71862353f1ae43feb0. Turns out the python scripts are _not_ fully python 3 compatible. As Ilia reported using get_xmlpool.py with LANG=C produces some weird output - see the link for details. Even though the issue was spotted with the autoconf build, it exposes a genuine problem with the script (and lack of lang handling of the meson build.) https://lists.freedesktop.org/archives/mesa-dev/2018-August/203508.html
* configure: allow building with python3Emil Velikov2018-08-232-6/+6
| | | | | | | | | | | | Pretty much all of the scripts are python2+3 compatible. Check and allow using python3, while adjusting the PYTHON2 refs. Note: - python3.4 is used as it's the earliest supported version - python3 chosen prior to python2 Signed-off-by: Emil Velikov <[email protected]> Acked-by: Eric Engestrom <[email protected]>
* radv/gfx9: implement coherent shaders for VK_ACCESS_SHADER_READ_BITSamuel Pitoiset2018-08-231-1/+20
| | | | | | | | Single-sample color and single-sample depth (not stencil) are coherent with shaders. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]
* amd/addrlib: Fix include path for c99_compat.hMariusz Ceier2018-08-221-1/+1
| | | | | | | | | | | | | | | | Without this patch mesa doesn't compile: In file included from ../mesa-9999/src/amd/addrlib/addrinterface.cpp:39: ../mesa-9999/src/util/macros.h:29:10: fatal error: c99_compat.h: No such file or directory #include "c99_compat.h" ^~~~~~~~~~~~~~ compilation terminated. Fixes: 15ca5ce99a80d9ebb5ef2b1aca6ea00784931de4 ("amd/addrlib: mark returnCode as MAYBE_UNUSED in") Signed-off-by: Mariusz Ceier <[email protected]> Acked-by: Kai Wasserbäch <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* radv: use different builtin shader cache for 32bitGrazvydas Ignotas2018-08-231-9/+7
| | | | | | | | Currently if 64bit and 32bit programs are used interchangeably, radv will keep overwriting the cache. Use separate cache files to avoid that. Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: place pointer length into cache uuidGrazvydas Ignotas2018-08-231-1/+1
| | | | | | | | | | | | | | | | Thanks to reproducible builds, binary file timestamps may be identical for both 32bit and 64bit packages when built from the same source. This means radv will use the same cache for both 32 and 64 bit processes, which leads to crashes. Conveniently there is a spare byte in cache_uuid, let's place the pointer size there. Fixes: f4e499ec79 "radv: add initial non-conformant radv vulkan driver" CC: 18.1 18.2 <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107601 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105904 Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* ac: fix WAITCNT flags for GFX9Marek Olšák2018-08-222-4/+6
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* amd/addrlib: mark physicalSliceSize as MAYBE_UNUSED in ↵Kai Wasserbäch2018-08-221-1/+1
| | | | | | | | | | | | | | | Addr::V1::EgBasedLib::HwlGetSizeAdjustmentMicroTiled Only used, when asserts are enabled. Fixes an unused-but-set-variable warning with GCC 8: ../../../src/amd/addrlib/r800/egbaddrlib.cpp: In member function 'virtual long long unsigned int Addr::V1::EgBasedLib::HwlGetSizeAdjustmentMicroTiled(unsigned int, unsigned int, ADDR_SURFACE_FLAGS, unsigned int, unsigned int, unsigned int, unsigned int*, unsigned int*) const': ../../../src/amd/addrlib/r800/egbaddrlib.cpp:4111:13: warning: variable 'physicalSliceSize' set but not used [-Wunused-but-set-variable] UINT_64 physicalSliceSize; ^~~~~~~~~~~~~~~~~ Signed-off-by: Kai Wasserbäch <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* amd/addrlib: mark numPipes as MAYBE_UNUSED in ↵Kai Wasserbäch2018-08-221-1/+3
| | | | | | | | | | | | | | | | | | Addr::V1::EgBasedLib::SanityCheckMacroTiled (v2) Only used, when asserts are enabled. Fixes an unused-variable warning with GCC 8: ../../../src/amd/addrlib/r800/egbaddrlib.cpp: In member function 'int Addr::V1::EgBasedLib::SanityCheckMacroTiled(ADDR_TILEINFO*) const': ../../../src/amd/addrlib/r800/egbaddrlib.cpp:982:13: warning: unused variable 'numPipes' [-Wunused-variable] UINT_32 numPipes = HwlGetPipes(pTileInfo); ^~~~~~~~ v2: Don't realign other variable definitions, to keep in line with file style (Marek) Signed-off-by: Kai Wasserbäch <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* amd/addrlib: mark *pEqToCheck as MAYBE_UNUSED in ↵Kai Wasserbäch2018-08-221-1/+1
| | | | | | | | | | | | | | | | | | Addr::V2::Gfx9Lib::ComputeStereoInfo (v2) Only used, when asserts are enabled. Fixes an unused-variable warning with GCC 8: ../../../src/amd/addrlib/gfx9/gfx9addrlib.cpp: In member function 'ADDR_E_RETURNCODE Addr::V2::Gfx9Lib::ComputeStereoInfo(const ADDR2_COMPUTE_SURFACE_INFO_INPUT*, ADDR2_COMPUTE_SURFACE_INFO_OUTPUT*, unsigned int*) const': ../../../src/amd/addrlib/gfx9/gfx9addrlib.cpp:3879:34: warning: unused variable 'pEqToCheck' [-Wunused-variable] const ADDR_EQUATION *pEqToCheck = &m_equationTable[eqIndex]; ^~~~~~~~~~ v2: Don't realign other variable definitions, to keep in line with file style (Marek) Signed-off-by: Kai Wasserbäch <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* amd/addrlib: mark microBlockDim as MAYBE_UNUSED in ↵Kai Wasserbäch2018-08-221-1/+3
| | | | | | | | | | | | | | | Addr::V2::Gfx9Lib::HwlComputeBlock256Equation Only used, when asserts are enabled. Fixes an unused-but-set-variable warning with GCC 8: ../../../src/amd/addrlib/gfx9/gfx9addrlib.cpp: In member function 'virtual ADDR_E_RETURNCODE Addr::V2::Gfx9Lib::HwlComputeBlock256Equation(AddrResourceType, AddrSwizzleMode, unsigned int, ADDR_EQUATION*) const': ../../../src/amd/addrlib/gfx9/gfx9addrlib.cpp:2473:15: warning: variable 'microBlockDim' set but not used [-Wunused-but-set-variable] Dim2d microBlockDim = Block256_2d[elementBytesLog2]; ^~~~~~~~~~~~~ Signed-off-by: Kai Wasserbäch <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* amd/addrlib: mark returnCode as MAYBE_UNUSED in ElemGetExportNormKai Wasserbäch2018-08-222-1/+4
| | | | | | | | | | | | | Only used, when asserts are enabled. Fixes an unused-but-set-variable warning with GCC 8: ../../../src/amd/addrlib/addrinterface.cpp: In function 'int ElemGetExportNorm(ADDR_HANDLE, const ELEM_GETEXPORTNORM_INPUT*)': ../../../src/amd/addrlib/addrinterface.cpp:835:23: warning: variable 'returnCode' set but not used [-Wunused-but-set-variable] ADDR_E_RETURNCODE returnCode = ADDR_OK; ^~~~~~~~~~ Signed-off-by: Kai Wasserbäch <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* ac/nir: fix getting GLSL type of array of samplers for TG4Samuel Pitoiset2018-08-221-2/+4
| | | | | | | | | | | This fixes a crash in build_tex_intrinsic() when trying to launch the Basemark GPU benchmark on GFX8. It looks like there is still something wrong because some frames are black. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106980 CC: 18.2 <[email protected]> Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: remove dead variables after splitting per member structsSamuel Pitoiset2018-08-221-3/+3
| | | | | | | | | | | | | | | Otherwise, nir_lower_clip_cull_distance_arrays might report wrong number of output clips/culls because it relies on shader output variables and some of them might be dead. This fixes a rendering issue with Dolphin and Super Mario Sunshine. Fixes: b0c643d8f5 ("spirv: Use NIR per-member splitting") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107610 CC: 18.2 <[email protected]> Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: use ac_build_imad()Samuel Pitoiset2018-08-221-16/+8
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* ac,radeonsi: use ac_build_gather_values moreMarek Olšák2018-08-211-11/+3
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* ac,radeonsi: use ac_build_fmadMarek Olšák2018-08-212-7/+3
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* ac: add imad & fmad helpersMarek Olšák2018-08-212-0/+18
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* ac: add ac_build_s_barrierMarek Olšák2018-08-213-2/+8
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* ac: completely remove +auto-waitcnt-before-barrierMarek Olšák2018-08-212-6/+2
| | | | | | | it causes corruption on several different GPU generations. Cc: 18.2 <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* radv: do not use CP predication for DCC decompressionsSamuel Pitoiset2018-08-201-2/+2
| | | | | | | | | | | | | | | | | | | | This fixes a regression with some Unity demos. Not sure what the root cause of the problem is, especially because the driver doesn't perform any fast color clears. So, it shouldn't be needed to decompress DCC. RadeonSI says that the decompression is relatively cheap if the surface has been decompressed already. One possible improvement is to two use predicates, one for DCC and one for FCE that could be cleared when DCC, FMASK or CMASK are performed by the driver. That might skip some unnecessary decompression passes (not DCC though). Fixes: ff7daadca1 ("radv: enable/disable predication for the DCC decompression pass") CC: 18.2 <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107563 Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv/winsys: fix creating the BO list for virtual buffersSamuel Pitoiset2018-08-171-1/+1
| | | | | | | | | | | | | | When the number of unique BO is 0, we optimize the list creation by copying all buffers of the current CS directly into it. But this is only valid if the CS doesn't have virtual buffers, otherwise they are not added and hw might report VM faults. This fixes VM faults with: dEQP-VK.sparse_resources.image_sparse_binding.2d.rgba8ui.1024_128_1 CC: <[email protected]> Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: initialize the DCC predicate correctly when it's compressedSamuel Pitoiset2018-08-161-1/+4
| | | | | | | | | | We have to do a fast-clear eliminate when clearing DCC metadata with 0x20202020. I don't know if that fixes anything but that seems correct to me. CC: 18.2 <[email protected]> Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: fix missing initialization of the conditional rendering stateSamuel Pitoiset2018-08-161-0/+1
| | | | | | | | | | | | | | This was missing when VK_EXT_conditional_rendering has been implemented. The predication type should be -1 to avoid restoring previous state when performing a decompression pass with DCC enabled. Note that we don't have to handle secondary command buffers because we don't support this feature currently. CC: 18.2 <[email protected]> Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: Revert divisor = 0 case for vertex attribute extension.Bas Nieuwenhuizen2018-08-161-1/+1
| | | | | | | | | | Seems like DXVK depends on that and it might get reverted upstream. Since apps are not supposed to use 0 in v2 anyway, we should be safe implementing the old behavior there. Fixes: 66e12451ac4 "radv: Update to new VK_EXT_vertex_attribute_divisor to version 2." CC: 18.2 <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* radv: Possible on-demand compilation fix.Bas Nieuwenhuizen2018-08-161-0/+8
| | | | | | | | | | Seems that in a single case we use the renderpass before checking the pipeline, so check the renderpass before we use it. Fixes: fbcd1673144 "radv: Add on-demand compilation of built-in shaders." Tested-by: Timothy Arceri <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* radv: add Doom workaroundTimothy Arceri2018-08-161-0/+3
| | | | | | Cc: <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* radv: disable the auto-waitcnt-before-barrier LLVM optionSamuel Pitoiset2018-08-152-1/+3
| | | | | | | | | | | | | | This option allows us to remove additional s_waitcnt instructions because s_barrier internally does s_waitcnt 0. Though, apparently there is a problem with LDS accesses that causes rendering issues with FFXV and DXVK. Disable this optimization for now (RadeonSI still uses it). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107460 CC: 18.2 <[email protected]> Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: fix memory leaks in radv_load_meta_pipeline()Samuel Pitoiset2018-08-151-2/+3
| | | | | | | | Reported by Coverity. Fixes: fbcd167314 ("radv: Add on-demand compilation of built-in shaders.") Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: drop wrong initialization of COMPUTE_RESOURCE_LIMITSSamuel Pitoiset2018-08-151-3/+1
| | | | | | | | | | | | The last parameter of radeon_set_sh_reg_seq() is the number of dwords to emit. We were lucky because WAVES_PER_SH(0x3) is 3 but it was initialized to 0. COMPUTE_RESOURCE_LIMITS is correctly set when generating compute pipelines, so we don't need to initialize it. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv/meta_decompress: fix pointer to integer conversionMauro Rossi2018-08-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | VK_NULL_HANDLE replaces NULL to avoid following building error: external/mesa/src/amd/vulkan/radv_meta_decompress.c:365:54: error: incompatible pointer to integer conversion passing 'void *' to parameter of type 'VkShaderModule' (aka 'unsigned long long') [-Werror,-Wint-conversion] VkResult ret = create_pipeline(cmd_buffer->device, NULL, samples, ^~~~ prebuilts/clang/host/linux-x86/clang-4053586/lib64/clang/5.0.300080/include/stddef.h:105:16: note: expanded from macro 'NULL' # define NULL ((void*)0) ^~~~~~~~~~ external/mesa/src/amd/vulkan/radv_meta_decompress.c:97:32: note: passing argument to parameter 'vs_module_h' here VkShaderModule vs_module_h, ^ 1 error generated. Fixes: fbcd167314 ("radv: Add on-demand compilation of built-in shaders.") Signed-off-by: Mauro Rossi <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* ac: add radeon_info::nameMarek Olšák2018-08-142-1/+6
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* radeonsi: implement EXT_window_rectanglesMarek Olšák2018-08-141-0/+16
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* radv: Update to new VK_EXT_vertex_attribute_divisor to version 2.Bas Nieuwenhuizen2018-08-142-4/+5
| | | | | | | | | | | | | Behavior wrt firstInstance got changed, and a divisor of 0 has been disallowed. The new version of the ext got published in specification 1.1.81. Sending to stable since the only known user is DXVK, which needs this for correctness. Reviewed-by: Samuel Pitoiset <[email protected]> CC: 18.2 <[email protected]>
* radv: Allow ETC2 on RAVEN and VEGA10 instead of all GFX9.Bas Nieuwenhuizen2018-08-141-1/+2
| | | | | | | Follow radeonsi. Fixes: 3665f66ef26 "radv: Add support for ETC2 textures." Reviewed-by: Samuel Pitoiset <[email protected]>
* radv: Fix missing Android platform define.Bas Nieuwenhuizen2018-08-142-1/+3
| | | | | CC: <[email protected]> Acked-by: Samuel Pitoiset <[email protected]>
* radv: Add on-demand compilation of built-in shaders.Bas Nieuwenhuizen2018-08-1413-80/+454
| | | | | | | | | | | | | | | | | | | | | | | | | In environments where we cannot cache, e.g. Android (no homedir), ChromeOS (readonly rootfs) or sandboxes (cannot open cache), the startup cost of creating a device in radv is rather high, due to compiling all possible built-in pipelines up front. This meant depending on the CPU a 1-4 sec cost of creating a Device. For CTS this cost is unacceptable, and likely for starting random apps too. So if there is no cache, with this patch radv will compile shaders on demand. Once there is a cache from the first run, even if incomplete, the driver knows that it can likely write the cache and precompiles everything. Note that I did not switch the buffer and itob/btoi compute pipelines to on-demand, since you cannot really do anything in Vulkan without them and there are only a few. This reduces the CTS runtime for the no caches scenario on my threadripper from 32 minutes to 8 minutes. Reviewed-by: Dave Airlie <[email protected]>
* radv: Refactor blit pipeline creation.Bas Nieuwenhuizen2018-08-141-350/+175
| | | | Reviewed-by: Dave Airlie <[email protected]>
* radv: Make fs key exemplars ordered to be a reverse fs_key lookup.Bas Nieuwenhuizen2018-08-147-88/+39
| | | | | | | While at it, share the exemplars and account for a non-occurring fs key. Reviewed-by: Dave Airlie <[email protected]>
* meson: Build with Python 3Mathieu Bridon2018-08-102-6/+6
| | | | | | | | | | | | Now that all the build scripts are compatible with both Python 2 and 3, we can flip the switch and tell Meson to use the latter. Since Meson already depends on Python 3 anyway, this means we don't need two different Python stacks to build Mesa. Signed-off-by: Mathieu Bridon <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* python: Fix inequality comparisonsMathieu Bridon2018-08-101-0/+6
| | | | | | | | | | | | | | | | | | | On Python 3, executing `foo != bar` will first try to call foo.__ne__(bar), and fallback on the opposite result of foo.__eq__(bar). Python 2 does not do that. As a result, those __eq__ methods were never called, when we were testing for inequality. Expliclty adding the __ne__ methods fixes this issue, in a way that is compatible with both Python 2 and 3. However, this means the __eq__ methods are now called when testing for `foo != None`, so they need to be guarded correctly. Signed-off-by: Mathieu Bridon <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* python: Fix rich comparisonsMathieu Bridon2018-08-071-2/+3
| | | | | | | | | | | | | | Python 3 doesn't call objects __cmp__() methods any more to compare them. Instead, it requires implementing the rich comparison methods explicitly: __eq__(), __ne(), __lt__(), __le__(), __gt__() and __ge__(). Fortunately Python 2 also supports those. This commit only implements the comparison methods which are actually used by the build scripts. Signed-off-by: Mathieu Bridon <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* amd: remove support for LLVM 5.0Marek Olšák2018-08-032-108/+25
| | | | | | Users are encouraged to switch to LLVM 6.0 released in March 2018. Reviewed-by: Timothy Arceri <[email protected]>
* android: radv: build vulkan.radv conditionally to radeonsiMauro Rossi2018-08-031-0/+2
| | | | | | | | | | | | | A problem was reported with arm,arm64 targets build due to missing libLLVM shared library dependency with AOSP; to avoid this issue vulkan.radv is built conditionally only when radeonsi is in BOARD_GPU_DRIVERS Fixes: 0ca153f869 ("android: radv: enable build of vulkan.radv HAL module") Reported-by: John Stultz <[email protected]> Signed-off-by: Mauro Rossi <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Cc: "18.2" <[email protected]>
* ac,radeonsi: reduce optimizations for complex compute shaders on older APUs (v2)Marek Olšák2018-08-012-4/+25
| | | | | | | | To make dEQP-GLES31.functional.ssbo.layout.random.all_shared_buffer.23 finish sooner on the older CPUs. (otherwise it gets killed and we fail the test) Acked-by: Dave Airlie <[email protected]>
* python: Use the unicode_escape codecMathieu Bridon2018-08-011-1/+1
| | | | | | | | | | | | Python 2 had string_escape and unicode_escape codecs. Python 3 only has the latter. These work the same as far as we're concerned, so let's use the future-proof one. However, the reste of the code expects unicode strings, so we need to decode them again. Signed-off-by: Mathieu Bridon <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* ac/surface: fix MSAA corruption on Vega due to FMASK tile swizzleMarek Olšák2018-07-311-1/+1
| | | | | | | a needle in the haystack? Cc: 18.1 <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radeonsi: use storage_samples instead of color_samples in most placesMarek Olšák2018-07-313-5/+5
| | | | | | | and use pipe_resource::nr_storage_samples instead of r600_texture::num_color_samples. Tested-by: Dieter Nützel <[email protected]>
* android: radv: enable build of vulkan.radv HAL moduleMauro Rossi2018-07-281-0/+1
| | | | | | | | | src/amd/Android.mk requires to include src/amd/vulkan/Android.mk to enable the build of vulkan.radv module Signed-off-by: Mauro Rossi <[email protected]> Reviewed-by: Robert Foss <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* android: radv: add Android.mk for vulkan.radv HAL moduleMauro Rossi2018-07-281-0/+166
| | | | | | | | | radv implements the Android Vulkan HAL interface, this patch adds Android.mk building rules by porting of radv automake rules. vendor HAL module is installed as /vendor/lib/hw/vulkan.radv.so Signed-off-by: Mauro Rossi <[email protected]> Reviewed-by: Emil Velikov <[email protected]>