summaryrefslogtreecommitdiffstats
path: root/src/amd
Commit message (Collapse)AuthorAgeFilesLines
* 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]>
* radv: generate entrypoints for VK_ANDROID_native_bufferMauro Rossi2018-07-281-3/+0
| | | | | | | | | | | | Patch changes radv entrypoints generator to not skip this extension even though it is set as disabled in the vk.xml Reference: 63525ba730 ("android: enable VK_ANDROID_native_buffer") Fixes: 69f447553c ("vulkan: Drop vk_android_native_buffer.xml") Signed-off-by: Mauro Rossi <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Robert Foss <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* radv: move vk_format_table.c to generated sourcesMauro Rossi2018-07-281-2/+2
| | | | | | | | | | | | Android build system will try to compile vk_format_table.c as a shipped source, but at compile time it will be missing, we move it to generated source, where it belongs Fixes: f4e499ec791 ("radv: add initial non-conformant radv vulkan driver") Signed-off-by: Mauro Rossi <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Robert Foss <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* ac: pass write param to get_sampler_desc() from get_image_descriptor()Timothy Arceri2018-07-281-1/+1
| | | | | | | Looks like a mistake from when the deref stuff landed. Fixes: 506a07e4e3a4 ("ac/nir: Add deref support to image intrinsics.") Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: fix cdw check vs tracing emitDave Airlie2018-07-281-2/+2
| | | | | | | If we have tracing enabled we could do all the tracing emits and overflow the precalculated cdw_max. Reviewed-by: Samuel Pitoiset <[email protected]>
* radv: return binary code_size not variant code size to cacheDave Airlie2018-07-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code sizes return here get passed to the cache shader insert function, which then memcpy from the code ptr, and causes all sorts of valgrind errors like: ==6755== Invalid read of size 8 ==6755== at 0x4C32FEE: memcpy@GLIBC_2.2.5 (vg_replace_strmem.c:1021) ==6755== by 0x2305D4C7: radv_pipeline_cache_insert_shaders (radv_pipeline_cache.c:416) ==6755== by 0x2305791D: radv_create_shaders (radv_pipeline.c:2158) ==6755== by 0x2305C523: radv_pipeline_init (radv_pipeline.c:3404) ==6755== by 0x2305C890: radv_graphics_pipeline_create (radv_pipeline.c:3515) ==6755== by 0x230188AB: radv_device_init_meta_blit_color (radv_meta_blit.c:871) ==6755== by 0x2301D50E: radv_device_init_meta_blit_state (radv_meta_blit.c:1278) ==6755== by 0x23011893: radv_device_init_meta (radv_meta.c:352) ==6755== by 0x2300744B: radv_CreateDevice (radv_device.c:1576) ==6755== by 0x5187D0F: ??? (in /usr/lib64/libvulkan.so.1.1.77) ==6755== by 0x518F6A3: ??? (in /usr/lib64/libvulkan.so.1.1.77) ==6755== by 0x5192A42: vkCreateDevice (in /usr/lib64/libvulkan.so.1.1.77) ==6755== Address 0x22a58548 is 4 bytes after a block of size 116 alloc'd ==6755== at 0x4C2EBAB: malloc (vg_replace_malloc.c:299) ==6755== by 0x23089DC4: ac_elf_read (ac_binary.c:144) ==6755== by 0x23090A60: ac_compile_module_to_binary (ac_llvm_helper.cpp:162) ==6755== by 0x23053F06: compile_to_memory_buffer (radv_llvm_helper.cpp:58) ==6755== by 0x23053F06: radv_compile_to_binary (radv_llvm_helper.cpp:98) ==6755== by 0x23052769: ac_llvm_compile (radv_nir_to_llvm.c:3394) ==6755== by 0x23052823: ac_compile_llvm_module (radv_nir_to_llvm.c:3418) ==6755== by 0x23053C05: radv_compile_nir_shader (radv_nir_to_llvm.c:3542) ==6755== by 0x23061B4E: shader_variant_create (radv_shader.c:580) ==6755== by 0x23061CFD: radv_shader_variant_create (radv_shader.c:634) ==6755== by 0x23057765: radv_create_shaders (radv_pipeline.c:2123) ==6755== by 0x2305C523: radv_pipeline_init (radv_pipeline.c:3404) ==6755== by 0x2305C890: radv_graphics_pipeline_create (radv_pipeline.c:3515) Since we are just inserting the code into the cache, we can avoid these bad reads and data in the cache by just using the binary code size here. Fixes: 939e5a382 (radv: add padding for the UMR disassembler) Reviewed-by: Samuel Pitoiset <[email protected]>
* radv: allocate enough space in radv_cmd_buffer_after_draw()Samuel Pitoiset2018-07-271-0/+2
| | | | | | | | The driver might emit up to 4 dwords when RADV_TRACE_FILE is used. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: check CS space in radv_emit_write_data_packet()Samuel Pitoiset2018-07-271-14/+12
| | | | | | | | This wasn't wrong but it looks better to me like this. It's only used for debugging purposes (ie. RADV_TRACE_FILE). Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: do not emit pipeline stats flushes on compute queueSamuel Pitoiset2018-07-271-1/+3
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: reduce CB/DB meta flushes in radv_dst_access_flush()Samuel Pitoiset2018-07-271-8/+23
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: Fix buildKenneth Graunke2018-07-261-1/+1
| | | | | | I renamed this pass and forgot to update radv. Fixes: 488972222c6454551ab1559f753c13a493dc513f ("i965: Combine both gl_PatchVerticesIn lowering passes.")
* radv: Add support for ETC2 textures.Bas Nieuwenhuizen2018-07-273-11/+49
| | | | | | Was surprised that is even supported by Vega. Reviewed-by: Samuel Pitoiset <[email protected]>
* radv: fix adjusting vertex fetches since 16bit supportSamuel Pitoiset2018-07-261-3/+4
| | | | | | | | | | | Move the integer conversion after the fixup. This fixes some regressions with dEQP-VK.pipeline.vertex_input.single_attribute.mat4.as_a2r10g10b10* Fixes: b722b29f10 ("radv: add support for 16bit input/output") Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* ac: fix typo DSL_SEL -> DST_SELMarek Olšák2018-07-262-4/+4
|
* nir: rename f2f16_undef to f2f16Karol Herbst2018-07-241-1/+1
| | | | | | | | | | | we need rounding modes on other conversions involving floats and it is easier to rename f2f16_undef than renaming all the other ones. v2: rebased on master Reviewed-by: Jason Ekstrand <[email protected]> Acked-by: Rob Clark <[email protected]> Signed-off-by: Karol Herbst <[email protected]>
* python: Use range() instead of xrange()Mathieu Bridon2018-07-241-1/+1
| | | | | | | | | | | | | | | | Python 2 has a range() function which returns a list, and an xrange() one which returns an iterator. Python 3 lost the function returning a list, and renamed the function returning an iterator as range(). As a result, using range() makes the scripts compatible with both Python versions 2 and 3. Signed-off-by: Mathieu Bridon <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* python: Better iterate over dictionariesMathieu Bridon2018-07-241-1/+1
| | | | | | | | | | | | | | | | In Python 2, dictionaries have 2 sets of methods to iterate over their keys and values: keys()/values()/items() and iterkeys()/itervalues()/iteritems(). The former return lists while the latter return iterators. Python 3 dropped the method which return lists, and renamed the methods returning iterators to keys()/values()/items(). Using those names makes the scripts compatible with both Python 2 and 3. Signed-off-by: Mathieu Bridon <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* radv: Still enable inmemory & API level caching if disk cache is not enabled.Bas Nieuwenhuizen2018-07-241-2/+1
| | | | | | | | That we don't have a background disk cache does not mean we should prevent the app caching anything. CC: <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* radeonsi: Add debug option to enable LLVM GlobalISel (v2)Tom Stellard2018-07-233-2/+18
| | | | | | | | | | R600_DEBUG=gisel will tell LLVM to use GlobalISel rather than SelectionDAG for instruction selection. v2: mareko: move the helper to src/amd/common Signed-off-by: Marek Olšák <[email protected]> Reviewed-by: Tom Stellard <[email protected]>
* radv: enable VK_KHR_16bit_storage extension / 16bit storage featuresDaniel Schürmann2018-07-233-4/+8
| | | | Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* ac: add support for 16bit load_push_constantDaniel Schürmann2018-07-231-0/+20
| | | | Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: add support for 16bit input/outputDaniel Schürmann2018-07-232-18/+80
| | | | Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* ac: add support for 16bit buffer loadsDaniel Schürmann2018-07-231-40/+55
| | | | | | v2: Fixed dvec3 loads (bas) Reviewed-by: Bas Nieuwenhuizen <[email protected]>