summaryrefslogtreecommitdiffstats
path: root/src/intel
Commit message (Collapse)AuthorAgeFilesLines
* i965/icl: Disable binding table prefetchingTopi Pohjolainen2018-07-271-0/+7
| | | | | | | | | | | | | Gen 11 workarounds table #2056 WABTPPrefetchDisable suggests to disable prefetching of binding tables for ICLLP A0 and B0 steppings. It fixes multiple gpu hangs in ext_framebuffer_multisample* tests on ICLLP B0 h/w. Anuj: Add comments and commit message. Add gen 11 checks in the code. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Rafael Antognolli <[email protected]>
* intel/compiler: fix lower conversions to account for predicationIago Toral Quiroga2018-07-271-1/+4
| | | | | | | | The pass can create a temporary result for the instruction and then moves from it to the original destination, however, if the original instruction was predicated, the mov has to be predicated as well. Reviewed-by: Jose Maria Casanova Crespo <[email protected]>
* i965: Combine both gl_PatchVerticesIn lowering passes.Kenneth Graunke2018-07-262-4/+2
| | | | | | | | | | | | | | | | | | Until now, we had separate passes for lowering gl_PatchVerticesIn to a statically known constant (for TES inputs when linked against a TCS), and a uniform in the other cases. Annoyingly, one had to be run before nir_lower_system_values, and the other afterward. This simplified the passes, but made life painful for the callers. This patch combines both into a single pass. If you give it a non-zero static count, it uses that. If you give it Mesa state slots, it turns it back into a built-in uniform. Otherwise, it does nothing. This also moves the i965 uniform lowering out to shared code. v2: Make token arrays const. Reviewed-by: Eric Anholt <[email protected]>
* intel/compiler: Delete dead VS intrinsic handling.Kenneth Graunke2018-07-261-12/+4
| | | | | | | These are lowered by brw_nir_lower_vs_inputs(). If they weren't, we would have already hit the unreachable() in emit_system_values_block(). Reviewed-by: Jason Ekstrand <[email protected]>
* anv: drop unused local varsEric Engestrom2018-07-261-6/+0
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: remove incorrect `UNUSED` flagEric Engestrom2018-07-261-1/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* intel: Make the decoder just store addresses for bases, not buffers.Kenneth Graunke2018-07-252-12/+12
| | | | | | | | | | The various base addresses are simply addresses. There may or may not be a buffer located at those addresses. So, it doesn't make much sense to request one. Just save the raw address so we can add it later, when asking about BOs at the final <base + offset> address. Suggested-by: Lionel Landwerlin <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* intel: Make the decoder handle STATE_BASE_ADDRESS not being a buffer.Kenneth Graunke2018-07-252-38/+46
| | | | | | | | | | | | | | | | | | | | | | | | Normally, i965 programs STATE_BASE_ADDRESS every batch, and puts all state for a given base in a single buffer. I'm working on a prototype which emits STATE_BASE_ADDRESS only once at startup, where each base address is a fixed 4GB region of the PPGTT. State may live in many buffers in that 4GB region, even if there isn't a buffer located at the actual base address itself. To handle this, we need to save the STATE_BASE_ADDRESS values across multiple batches, rather than assuming we'll see the command each time. Then, each time we see a pointer, we need to ask the driver for the BO map for that data. (We can't just use the map for the base address, as state may be in multiple buffers, and there may not even be a buffer at the base address to map.) v2: Fix things caught in review by Lionel: - Drop bogus bind_bo.size check. - Drop "get the BOs again" code - we just get the BOs as needed - Add a message about interface descriptor data being unavailable Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: don't crash on vkDestroyDevice(NULL)Eric Engestrom2018-07-251-1/+3
| | | | | | | | CovID: 1438132 Fixes: a99c9e63a07477634ab73 "anv: finish the binding_table_pool on destroyDevice when use_softpin" Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Jose Maria Casanova Crespo <[email protected]>
* anv: fix python whitespace warningEric Engestrom2018-07-251-1/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* anv: cleanup python importsEric Engestrom2018-07-252-3/+3
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* anv: remove unnecessary semicolons in pythonEric Engestrom2018-07-251-3/+3
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* intel: tools: dump: only store device id on successLionel Landwerlin2018-07-251-2/+2
| | | | | | | | We might fail on master node drm fd because we won't have the right permissions. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* i965, anv: Use INTEL_DEBUG for disk_cache driver flagsJordan Justen2018-07-242-1/+7
| | | | | | | | | | | | | | | | | | | Since various options within INTEL_DEBUG could impact code generation, we need to set the disk cache driver_flags parameter based on the INTEL_DEBUG flags in use. An example that will affect the program generated by i965 is the INTEL_DEBUG=nocompact option. The DEBUG_DISK_CACHE_MASK value is added to mask the settings of INTEL_DEBUG that can affect program generation. v2: * Use driver_flags (Tim) * Also update Anvil (Jason) Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* i965, anv: Add extra unused character in disk_cache renderer temp stringJordan Justen2018-07-241-2/+2
| | | | | | | | | | | | This extra character should not be used by snprintf, but we make it available to verify that we printed the exact number we wanted, and didn't overflow. v2: * Also update Anvil Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* 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-242-6/+6
| | | | | | | | | | | | | | | | 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]>
* intel: Make the disassembler take a const pointer to the assembly.Kenneth Graunke2018-07-242-4/+5
| | | | | | Disassembling doesn't modify the assembly. Reviewed-by: Lionel Landwerlin <[email protected]>
* intel/compiler: Account for built-in uniforms in analyze_ubo_rangesJason Ekstrand2018-07-233-4/+40
| | | | | | | | | | | | The original pass only looked for load_uniform intrinsics but there are a number of other places that could end up loading a push constant. One obvious omission was images which always implicitly use a push constant. Legacy VS clip planes also get pushed into the shader. This fixes some new Vulkan CTS tests that test random combinations of bindings and, in particular, test lots of UBOs and images together. Cc: [email protected] Cc: Kenneth Graunke <[email protected]>
* anv: remove unnecessary runtime copy of static stringEric Engestrom2018-07-231-2/+1
| | | | | | | | It's actually also a bit safer, since now the compiler will warn if the string is larger than the `.name` array. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Pay attention to VK_ACCESS_MEMORY_(READ|WRITE)_BITAlex Smith2018-07-231-0/+9
| | | | | | | | | | | | | According to the spec, these should apply to all read/write access types (so would be equivalent to specifying all other access types individually). Currently, they were doing nothing. v2: Handle VK_ACCESS_MEMORY_WRITE_BIT in dstAccessMask. Signed-off-by: Alex Smith <[email protected]> Cc: [email protected] Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* intel/blorp: Fix blits to R8G8B8_UNORM_SRGB sRGB harderJason Ekstrand2018-07-231-3/+11
| | | | | | | | | | | | The first fix attempt contained a nasty typo which somehow didn't get caught in review. It also didn't work as intended because the sRGB conversion was happening but then throwing away all but the red channel because it dind't know it was RGB. Really, it's my fault for trying to fix a bug without first writing tests. I've now written tests and they pass with this change. :) Fixes: 11712b9ca17 "intel/blorp: Fix blits to R8G8B8_UNORM_SRGB" Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Stop setting 3DSTATE_PS_EXTRA::PixelShaderHasUAVJason Ekstrand2018-07-221-31/+22
| | | | | | | | | | | | | | We've had several broadwell hangs that have come down to this bit just not working correctly. Most recently, we've had a pile of hangs reported with apps running under DXVK: https://github.com/doitsujin/dxvk/issues/469 Instead, use the bit that doesn't try to imply weird D3D coherency things and just force-enables the PS like we want. cc: [email protected] Reviewed-by: Kenneth Graunke <[email protected]>
* anv: Properly handle GetImageSubresourceLayout on complex imagesJason Ekstrand2018-07-221-7/+16
| | | | | | | | We support mipmapped and arrayed linear images so we need to support vkGetImageSubresourceLayout on them. Fortunately, it's just a trivial call into ISL. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv/gen9: expose VK_EXT_post_depth_coverageIlia Mirkin2018-07-223-2/+10
| | | | | | | | | | Note that the use of ICMS_INNER_CONSERVATIVE disagrees with the GL driver. Perhaps it's more performant than ICMS_NORMAL and is otherwise permitted? Not sure, so I left it as-is. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* intel: tools: dump: protect against multiple calls on destructorLionel Landwerlin2018-07-201-3/+16
| | | | | | | | | | | When running gdb, make sure to pass the LD_PRELOAD variable only to the executed program, not the debugger. Otherwise the debugger will run the preloaded constructor/destructor too and bad things will happen. Suggested-by: Rafael Antognolli <[email protected]> Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Rafael Antognolli <[email protected]>
* intel: tools: dump: make dump tool reliable under gdbLionel Landwerlin2018-07-202-4/+9
| | | | | | | | | | | | The problem with passing the configuration of the dump lib through a file descriptor is that it can be read only once. But under gdb you might want to rerun your program multiple times. This change hands the configuration through a temporary file that is deleted once the command line passes to intel_dump_gpu has exited. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Rafael Antognolli <[email protected]>
* intel: tools: dump: remove mentions of intel_aubdumpLionel Landwerlin2018-07-191-15/+15
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Acked-by: Rafael Antognolli <[email protected]>
* intel: tools: aubwrite: fix invalid frees on finishLionel Landwerlin2018-07-191-4/+9
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* intel/isl/gen4: Make depth/stencil buffers Y-TiledNanley Chery2018-07-191-1/+8
| | | | | | | | | | | | | | Rendering to a linear depth buffer on gen4 is causing a GPU hang in the CI system. Until a better explanation is found, assume that errata is applicable to all gen4 platforms. Fixes fbe01625f6bf2cef6742e1ff0d3d44a2afec003e ("i965/miptree: Share tiling_flags in miptree_create"). Reported-by: Mark Janes <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107248 Tested-by: Mark Janes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel: tools: dump: trace memory writesLionel Landwerlin2018-07-191-13/+32
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Rafael Antognolli <[email protected]>
* intel: tools: dump: remove command execution featureLionel Landwerlin2018-07-192-119/+29
| | | | | | | | | | | | | | In commit 86cb05a6d35a52 ("intel: aubinator: remove standard input processing option") we removed the ability to process aub as an input stream because we're now rely on mmapping the aub file to back the buffers aubinator is parsing. intel_aubdump was the provider of the standard input data and since we've copied/reworked intel_aubdump into intel_dump_gpu within Mesa, we don't need that code anymore. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* intel/blorp: Take an explicit filter parameter in blorp_blitJason Ekstrand2018-07-183-49/+32
| | | | | | | | This lets us move the glBlitFramebuffer nonsense into the GL driver and make the usage of BLORP mutch more explicit and obvious as to what it's doing. Reviewed-by: Chad Versace <[email protected]>
* intel/blorp: Add a blorp_filter enum for use in blorp_blitJason Ekstrand2018-07-183-109/+123
| | | | | | | At the moment, this is entirely internal but we'll expose it to clients of the BLORP API in the next commit. Reviewed-by: Chad Versace <[email protected]>
* intel/tools: add missing include for stdarg.hCaio Marcelo de Oliveira Filho2018-07-181-0/+1
| | | | | | | | | | | | | | | | | | | Fixes build in GCC 8.1.1: FAILED: src/intel/tools/src@intel@tools@@intel_dump_gpu@sha/aub_write.c.o gcc -Isrc/intel/tools/src@intel@tools@@intel_dump_gpu@sha -Isrc/intel/tools -I../../src/intel/tools -Isrc/../include -I../../src/../include -Isrc -I../../src -Isrc/mapi -I../../src/mapi -Isrc/mesa -I../../src/mesa -I../../src/gallium/include -I../../src/gallium/auxiliary -Isrc/intel -I../../src/intel -I../../include/drm-uapi -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c99 -O2 -g -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DVERSION="18.2.0-devel"' -DPACKAGE_VERSION=VERSION '-DPACKAGE_BUGREPORT="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa"' -DGLX_USE_TLS -DENABLE_ST_OMX_BELLAGIO=0 -DENABLE_ST_OMX_TIZONIA=0 -DHAVE_X11_PLATFORM -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_DRM -DHAVE_DRM_PLATFORM -DHAVE_SURFACELESS_PLATFORM -DENABLE_SHADER_CACHE -DHAVE___BUILTIN_BSWAP32 -DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ -DHAVE___BUILTIN_CLZLL -DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT -DHAVE___BUILTIN_FFS -DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT -DHAVE___BUILTIN_POPCOUNTLL -DHAVE___BUILTIN_UNREACHABLE -DHAVE_FUNC_ATTRIBUTE_CONST -DHAVE_FUNC_ATTRIBUTE_FLATTEN -DHAVE_FUNC_ATTRIBUTE_MALLOC -DHAVE_FUNC_ATTRIBUTE_PURE -DHAVE_FUNC_ATTRIBUTE_UNUSED -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT -DHAVE_FUNC_ATTRIBUTE_WEAK -DHAVE_FUNC_ATTRIBUTE_FORMAT -DHAVE_FUNC_ATTRIBUTE_PACKED -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL -DHAVE_FUNC_ATTRIBUTE_VISIBILITY -DHAVE_FUNC_ATTRIBUTE_ALIAS -DHAVE_FUNC_ATTRIBUTE_NORETURN -D_GNU_SOURCE -DUSE_SSE41 -DUSE_GCC_ATOMIC_BUILTINS -DUSE_X86_64_ASM -DMAJOR_IN_SYSMACROS -DHAVE_SYS_SYSCTL_H -DHAVE_LINUX_FUTEX_H -DHAVE_ENDIAN_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_POSIX_MEMALIGN -DHAVE_TIMESPEC_GET -DHAVE_MEMFD_CREATE -DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DHAVE_ZLIB -DHAVE_PTHREAD -DHAVE_LIBDRM -DHAVE_LLVM=0x0600 -DMESA_LLVM_VERSION_PATCH=1 -DHAVE_VALGRIND -DHAVE_LIBUNWIND -DHAVE_WAYLAND_PLATFORM -DWL_HIDE_DEPRECATED -DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -Wall -Werror=implicit-function-declaration -Werror=missing-prototypes -fno-math-errno -fno-trapping-math -Wno-missing-field-initializers -fPIC -fvisibility=hidden -Wno-override-init -MD -MQ 'src/intel/tools/src@intel@tools@@intel_dump_gpu@sha/aub_write.c.o' -MF 'src/intel/tools/src@intel@tools@@intel_dump_gpu@sha/aub_write.c.o.d' -o 'src/intel/tools/src@intel@tools@@intel_dump_gpu@sha/aub_write.c.o' -c ../../src/intel/tools/aub_write.c ../../src/intel/tools/aub_write.c: In function ‘fail_if’: ../../src/intel/tools/aub_write.c:243:4: error: implicit declaration of function ‘va_start’; did you mean ‘assert’? [-Werror=implicit-function-declaration] va_start(args, format); ^~~~~~~~ assert ../../src/intel/tools/aub_write.c:245:4: error: implicit declaration of function ‘va_end’; did you mean ‘rand’? [-Werror=implicit-function-declaration] va_end(args); ^~~~~~ rand cc1: some warnings being treated as errors Reviewed-by: Jason Ekstrand <[email protected]>
* intel/tools: Rename error2aub to intel_error2aubJason Ekstrand2018-07-181-1/+1
| | | | Suggested-by: Lionel Landwerlin <[email protected]>
* intel/tools: Add an error state to aub translatorJason Ekstrand2018-07-182-0/+343
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* intel/tools: Break aub file writing into a helperJason Ekstrand2018-07-184-762/+862
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* intel/tools: Refactor aub dumping to remove singletonsJason Ekstrand2018-07-181-211/+287
| | | | | | | Instead of having quite so many singletons, we use a struct aub_file to organize the bits we need for writing an aub file. Reviewed-by: Lionel Landwerlin <[email protected]>
* intel/dump_gpu: Fix corner cases in PPGTT range calculationsJason Ekstrand2018-07-181-6/+6
| | | | | | | | | | | | | For large buffers which span an entire l1 page table, we got the range calculations wrong. In this case, we end up with an l1_start which is the first byte represented by the given l1 table and an l1_end which is the first byte after the range represented by the l1 table. Then l2_start_index == L2_index(l2_end) due to roll-over. Instead, compute lN_end using (1Ull << shift) - 1 so that lN_end is the last byte in the range represented by the Nth level page table. When we do this, we don't need the conditional expression anymore. Reviewed-by: Lionel Landwerlin <[email protected]>
* intel/batch-decoder: fix uninitialized values warningsCaio Marcelo de Oliveira Filho2018-07-181-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Code assumes that all the necessary fields will exist, but compiler doesn't know about this. Provide zero as default values, like in other decoding functions. Fixes warnings ../../src/intel/common/gen_batch_decoder.c: In function ‘handle_media_interface_descriptor_load’: ../../src/intel/common/gen_batch_decoder.c:347:7: warning: ‘binding_entry_count’ may be used uninitialized in this function [-Wmaybe-uninitialized] dump_binding_table(ctx, binding_table_offset, binding_entry_count); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../src/intel/common/gen_batch_decoder.c:347:7: warning: ‘binding_table_offset’ may be used uninitialized in this function [-Wmaybe-uninitialized] ../../src/intel/common/gen_batch_decoder.c:346:7: warning: ‘sampler_count’ may be used uninitialized in this function [-Wmaybe-uninitialized] dump_samplers(ctx, sampler_offset, sampler_count); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../src/intel/common/gen_batch_decoder.c:346:7: warning: ‘sampler_offset’ may be used uninitialized in this function [-Wmaybe-uninitialized] ../../src/intel/common/gen_batch_decoder.c:343:7: warning: ‘ksp’ may be used uninitialized in this function [-Wmaybe-uninitialized] ctx_disassemble_program(ctx, ksp, "compute shader"); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../src/intel/common/gen_batch_decoder.c: In function ‘decode_dynamic_state_pointers’: ../../src/intel/common/gen_batch_decoder.c:663:54: warning: ‘state_offset’ may be used uninitialized in this function [-Wmaybe-uninitialized] const uint32_t *state_map = ctx->dynamic_base.map + state_offset; ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ ../../src/intel/common/gen_batch_decoder.c: In function ‘gen_print_batch’: ../../src/intel/common/gen_batch_decoder.c:856:13: warning: ‘next_batch.map’ may be used uninitialized in this function [-Wmaybe-uninitialized] if (next_batch.map == NULL) { ^ ../../src/intel/common/gen_batch_decoder.c:860:13: warning: ‘next_batch.addr’ may be used uninitialized in this function [-Wmaybe-uninitialized] gen_print_batch(ctx, next_batch.map, next_batch.size, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ next_batch.addr); ~~~~~~~~~~~~~~~~ Reviewed-by: Anuj Phogat <[email protected]>
* intel/decoder: use snprintf(..., "%s", ...) instead of strncpyCaio Marcelo de Oliveira Filho2018-07-181-2/+2
| | | | | | | | | | | | | | | | | | | strncpy() doesn't guarantee the terminator NUL, so we would need to set ourselves. Just use snprintf() instead. Fixes the warnings ../../src/intel/common/gen_decoder.c: In function ‘iter_decode_field’: ../../src/intel/common/gen_decoder.c:897:7: warning: ‘strncpy’ specified bound 128 equals destination size [-Wstringop-truncation] strncpy(iter->name, iter->field->name, sizeof(iter->name)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In function ‘iter_advance_field’, inlined from ‘gen_field_iterator_next’ at ../../src/intel/common/gen_decoder.c:1015:9: ../../src/intel/common/gen_decoder.c:844:7: warning: ‘strncpy’ specified bound 128 equals destination size [-Wstringop-truncation] strncpy(iter->name, iter->field->name, sizeof(iter->name)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reviewed-by: Anuj Phogat <[email protected]>
* anv: give more room to debug reportCaio Marcelo de Oliveira Filho2018-07-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The error buffer is limited to 256, but the report contains the filename and possibly other data. So give it more space. Avoids the warnings ../../src/intel/vulkan/anv_util.c: In function ‘__anv_perf_warn’: ../../src/intel/vulkan/anv_util.c:66:42: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 254 [-Wformat-truncation=] snprintf(report, sizeof(report), "%s: %s", file, buffer); ^~ ~~~~~~ ../../src/intel/vulkan/anv_util.c:66:4: note: ‘snprintf’ output 3 or more bytes (assuming 258) into a destination of size 256 snprintf(report, sizeof(report), "%s: %s", file, buffer); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../src/intel/vulkan/anv_util.c: In function ‘__vk_errorf’: ../../src/intel/vulkan/anv_util.c:96:48: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 252 [-Wformat-truncation=] snprintf(report, sizeof(report), "%s:%d: %s (%s)", file, line, buffer, ^~ ~~~~~~ ../../src/intel/vulkan/anv_util.c:96:7: note: ‘snprintf’ output 8 or more bytes (assuming 263) into a destination of size 256 snprintf(report, sizeof(report), "%s:%d: %s (%s)", file, line, buffer, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error_str); ~~~~~~~~~~ Reviewed-by: Anuj Phogat <[email protected]>
* anv: avoid warning when switching in VkStructureTypeCaio Marcelo de Oliveira Filho2018-07-181-1/+2
| | | | | | | | | | | | | | When one of the cases is not part of the enum, the compilar complains: ../../src/intel/vulkan/anv_formats.c: In function ‘anv_GetPhysicalDeviceFormatProperties2’: ../../src/intel/vulkan/anv_formats.c:728:7: warning: case value ‘1000001004’ not in enumerated type ‘VkStructureType’ {aka ‘enum VkStructureType’} [-Wswitch] case VK_STRUCTURE_TYPE_WSI_FORMAT_MODIFIER_PROPERTIES_LIST_MESA: ^~~~ Given the switch has an "default:" case, we don't lose anything by switching on the unsigned value to avoid the warning. Reviewed-by: Anuj Phogat <[email protected]>
* intel/compiler: fix -Wsign-compare warningCaio Marcelo de Oliveira Filho2018-07-181-1/+1
| | | | | | | | | | | | Explicitly convert to signed integer. Conversion is valid since is the same (implicitly) used to initialize the loop. Avoids the warning: ../../src/intel/compiler/brw_fs.cpp: In member function ‘bool fs_visitor::lower_simd_width()’: ../../src/intel/compiler/brw_fs.cpp:5761:45: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] split_inst.eot = inst->eot && i == n - 1; ~~^~~~~~~~ Reviewed-by: Anuj Phogat <[email protected]>
* intel/compiler: silence -Wclass-memaccess warningsCaio Marcelo de Oliveira Filho2018-07-182-5/+5
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* anv: fix assert in anv_CmdBindDescriptorSets()Samuel Iglesias Gonsálvez2018-07-181-1/+1
| | | | | | | | | | | The assert is checking that we are not binding more descriptor sets than the supported by the driver. When binding the descriptor set number MAX_SETS-1, it was breaking the assert because descriptorSetCount = 1. Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Cc: <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* intel/batch_decoder: decoding of 3DSTATE_CONSTANT_BODY.Sergii Romantsov2018-07-161-24/+14
| | | | | | | | | | | | | | SNB doesn't have a definition of 3DSTATE_CONSTANT_BODY, thats why we got segmentation fault when used INTEL_DEBUG=bat. Fixed by adding of 3DSTATE_CONSTANT_BODY into 3DSTATE_CONSTANT of VS, GS and PS structures. v2: added definition of 3DSTATE_CONSTANT_BODY to the gen6.xml Fixes: 169d8e011ae (intel: Fix 3DSTATE_CONSTANT buffer decoding.) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107190 Signed-off-by: Sergii Romantsov <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel: tools: Fix uninitialized variable warnings in intel_dump_gpu.Eric Anholt2018-07-161-0/+2
| | | | Reviewed-by: Rafael Antognolli <[email protected]>