Re: [Mesa-dev] [PATCH 10/11] mesa: enable ARB_vertex_attrib_64bit in compat profile
Whoops please ignore this patch it was sent by mistake. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 106980] Basemark GPU vulkan benchmark fails.
https://bugs.freedesktop.org/show_bug.cgi?id=106980 Jan Ziak <0xe2.0x9a.0...@gmail.com> changed: What|Removed |Added CC||0xe2.0x9a.0...@gmail.com -- You are receiving this mail because: You are the assignee for the bug.___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 106980] Basemark GPU vulkan benchmark fails.
https://bugs.freedesktop.org/show_bug.cgi?id=106980 Bas Nieuwenhuizen changed: What|Removed |Added CC|chadvers...@chromium.org, | |dan...@fooishbar.org, | |ja...@jlekstrand.net| QA Contact||mesa-dev@lists.freedesktop. ||org Component|Drivers/Vulkan/Common |Drivers/Vulkan/radeon --- Comment #3 from Bas Nieuwenhuizen --- Seems like the validation issue was fixed by the deref rewrite, and that has been upstreamed now. However, now I get the hang too ... Moving back to the radv-component since there is no hint at the moment that it is an issue on anv too. -- You are receiving this mail because: You are the assignee for the bug. You are the QA Contact for the bug.___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH v2 0/4] Add support GL_ARB_texture_compression_bptc in llvmpipe and softpipe.
This series add code for reuse in gallium bptc decode logic from mesa/main/texcompress_bptc.c. Checked on x86_64 by: * LIBGL_ALWAYS_SOFTWARE=true GALLIUM_DRIVER={llvmpipe,softpipe} * piglit/bin/bptc-float-modes * piglit/bin/bptc-modes * piglit/bin/compressedteximage GL_COMPRESSED_RGBA_BPTC_UNORM * piglit/bin/compressedteximage GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM * piglit/bin/compressedteximage GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT * piglit/bin/compressedteximage GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT Could you please review? v2: Added logic for decompress 4x4 as single block. Best regards, Denis. --- src/gallium/auxiliary/Makefile.sources| 2 + src/gallium/auxiliary/meson.build | 2 + src/gallium/auxiliary/util/u_format_bptc.c| 277 +++ src/gallium/auxiliary/util/u_format_bptc.h| 122 +++ src/gallium/auxiliary/util/u_format_table.py | 3 +- src/gallium/auxiliary/util/u_tile.c | 1 + src/gallium/drivers/llvmpipe/lp_screen.c | 3 +- src/gallium/drivers/llvmpipe/lp_test_format.c | 3 +- src/gallium/drivers/softpipe/sp_screen.c | 3 +- src/mesa/Makefile.sources | 1 + src/mesa/main/texcompress_bptc.c | 303 +- src/mesa/main/texcompress_bptc_share.h| 58 + 12 files changed, 767 insertions(+), 11 deletions(-) --- [PATCH v2 1/4] mesa: add header for share bptc decompress functions [PATCH v2 2/4] gallium/auxiliary: Add helper support for bptc format [PATCH v2 3/4] gallium/softpipe: Enable support bptc format. [PATCH v2 4/4] gallium/llvmpipe: Enable support bptc format. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH v2 1/4] mesa: add header for share bptc decompress functions
Make functions public: * fetch_rgba_unorm_from_block * fetch_rgb_float_from_block * compress_rgba_unorm * compress_rgb_float Create decompress functions: * decompress_rgba_unorm * decompress_rgb_float Functions will be reused in gallium/auxiliary code. v2: Add block decompress function Signed-off-by: Denis Pauk CC: Marek Olšák --- src/mesa/Makefile.sources | 1 + src/mesa/main/texcompress_bptc.c | 303 - src/mesa/main/texcompress_bptc_share.h | 58 + 3 files changed, 358 insertions(+), 4 deletions(-) create mode 100644 src/mesa/main/texcompress_bptc_share.h diff --git a/src/mesa/Makefile.sources b/src/mesa/Makefile.sources index 00aba0a2f7..d644112e6a 100644 --- a/src/mesa/Makefile.sources +++ b/src/mesa/Makefile.sources @@ -216,6 +216,7 @@ MAIN_FILES = \ main/texcompress.c \ main/texcompress_bptc.c \ main/texcompress_bptc.h \ + main/texcompress_bptc_share.h \ main/texcompress_cpal.c \ main/texcompress_cpal.h \ main/texcompress_etc.c \ diff --git a/src/mesa/main/texcompress_bptc.c b/src/mesa/main/texcompress_bptc.c index fd37be97f3..74828d63db 100644 --- a/src/mesa/main/texcompress_bptc.c +++ b/src/mesa/main/texcompress_bptc.c @@ -29,6 +29,7 @@ #include #include "texcompress.h" #include "texcompress_bptc.h" +#include "texcompress_bptc_share.h" #include "util/format_srgb.h" #include "util/half_float.h" #include "texstore.h" @@ -535,7 +536,7 @@ apply_rotation(int rotation, result[3] = t; } -static void +void fetch_rgba_unorm_from_block(const uint8_t *block, uint8_t *result, int texel) @@ -657,6 +658,173 @@ fetch_rgba_unorm_from_block(const uint8_t *block, apply_rotation(rotation, result); } +static void +decompress_rgba_unorm_block(int src_width, int src_height, +const uint8_t *block, +uint8_t *dst_row, int dst_rowstride) +{ + int mode_num = ffs(block[0]); + const struct bptc_unorm_mode *mode; + int bit_offset, secondary_bit_offset; + int partition_num; + int subset_num; + int rotation; + int index_selection; + int index_bits; + int indices[2]; + int index; + int anchors_before_texel; + bool anchor; + uint8_t endpoints[3 * 2][4]; + uint32_t subsets; + int component; + unsigned x, y; + + if (mode_num == 0) { + /* According to the spec this mode is reserved and shouldn't be used. */ + for(y = 0; y < src_height; y += 1) { + uint8_t *result = dst_row; + memset(result, 0, 4 * src_width); + for(x = 0; x < src_width; x += 1) { +result[3] = 0xff; +result += 4; + } + dst_row += dst_rowstride; + } + return; + } + + mode = bptc_unorm_modes + mode_num - 1; + bit_offset = mode_num; + + partition_num = extract_bits(block, bit_offset, mode->n_partition_bits); + bit_offset += mode->n_partition_bits; + + switch (mode->n_subsets) { + case 1: + subsets = 0; + break; + case 2: + subsets = partition_table1[partition_num]; + break; + case 3: + subsets = partition_table2[partition_num]; + break; + default: + assert(false); + return; + } + + if (mode->has_rotation_bits) { + rotation = extract_bits(block, bit_offset, 2); + bit_offset += 2; + } else { + rotation = 0; + } + + if (mode->has_index_selection_bit) { + index_selection = extract_bits(block, bit_offset, 1); + bit_offset++; + } else { + index_selection = 0; + } + + bit_offset = extract_unorm_endpoints(mode, block, bit_offset, endpoints); + + for(y = 0; y < src_height; y += 1) { + uint8_t *result = dst_row; + for(x = 0; x < src_width; x += 1) { + int texel; + texel = x + y * 4; + + anchors_before_texel = count_anchors_before_texel(mode->n_subsets, + partition_num, + texel); + + /* Calculate the offset to the secondary index */ + secondary_bit_offset = (bit_offset + + BLOCK_SIZE * BLOCK_SIZE * mode->n_index_bits - + mode->n_subsets + + mode->n_secondary_index_bits * texel - + anchors_before_texel); + + /* Calculate the offset to the primary index for this texel */ + bit_offset += mode->n_index_bits * texel - anchors_before_texel; + + subset_num = (subsets >> (texel * 2)) & 3; + + anchor = is_anchor(mode->n_subsets, partition_num, texel); + + index_bits = mode->n_index_bits; + if (anchor) +index_bits--; + indices[0] = extract_bits(block, bit_offset, index_bits); + + if (mode->n_secondary_index_bits) { +index_bits = mode->n_secondary_index
[Mesa-dev] [PATCH v2 3/4] gallium/softpipe: Enable support bptc format.
v2: none Signed-off-by: Denis Pauk CC: Marek Olšák CC: Rhys Perry --- src/gallium/drivers/softpipe/sp_screen.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c index 8fbcbc8bac..ed8f8d9112 100644 --- a/src/gallium/drivers/softpipe/sp_screen.c +++ b/src/gallium/drivers/softpipe/sp_screen.c @@ -441,8 +441,7 @@ softpipe_is_format_supported( struct pipe_screen *screen, return FALSE; } - if (format_desc->layout == UTIL_FORMAT_LAYOUT_BPTC || - format_desc->layout == UTIL_FORMAT_LAYOUT_ASTC) { + if (format_desc->layout == UTIL_FORMAT_LAYOUT_ASTC) { /* Software decoding is not hooked up. */ return FALSE; } -- 2.17.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH v2 2/4] gallium/auxiliary: Add helper support for bptc format compress/decompress
Reuse code shared with mesa/main/texcompress_bptc. v2: Use block decompress function Signed-off-by: Denis Pauk CC: Nicolai Hähnle CC: Marek Olšák CC: Gert Wollny --- src/gallium/auxiliary/Makefile.sources | 2 + src/gallium/auxiliary/meson.build| 2 + src/gallium/auxiliary/util/u_format_bptc.c | 277 +++ src/gallium/auxiliary/util/u_format_bptc.h | 122 src/gallium/auxiliary/util/u_format_table.py | 3 +- src/gallium/auxiliary/util/u_tile.c | 1 + 6 files changed, 406 insertions(+), 1 deletion(-) create mode 100644 src/gallium/auxiliary/util/u_format_bptc.c create mode 100644 src/gallium/auxiliary/util/u_format_bptc.h diff --git a/src/gallium/auxiliary/Makefile.sources b/src/gallium/auxiliary/Makefile.sources index 066746f2d0..626cde123a 100644 --- a/src/gallium/auxiliary/Makefile.sources +++ b/src/gallium/auxiliary/Makefile.sources @@ -256,6 +256,8 @@ C_SOURCES := \ util/u_fifo.h \ util/u_format.c \ util/u_format.h \ + util/u_format_bptc.c \ + util/u_format_bptc.h \ util/u_format_etc.c \ util/u_format_etc.h \ util/u_format_latc.c \ diff --git a/src/gallium/auxiliary/meson.build b/src/gallium/auxiliary/meson.build index 1f7548142b..98542d7ef3 100644 --- a/src/gallium/auxiliary/meson.build +++ b/src/gallium/auxiliary/meson.build @@ -276,6 +276,8 @@ files_libgallium = files( 'util/u_fifo.h', 'util/u_format.c', 'util/u_format.h', + 'util/u_format_bptc.c', + 'util/u_format_bptc.h', 'util/u_format_etc.c', 'util/u_format_etc.h', 'util/u_format_latc.c', diff --git a/src/gallium/auxiliary/util/u_format_bptc.c b/src/gallium/auxiliary/util/u_format_bptc.c new file mode 100644 index 00..44cfcb24e4 --- /dev/null +++ b/src/gallium/auxiliary/util/u_format_bptc.c @@ -0,0 +1,277 @@ +/** + * + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * Copyright (c) 2008 VMware, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + **/ + +#include "u_math.h" +#include "u_format.h" +#include "u_format_bptc.h" +#include "util/format_srgb.h" +#include "../../../mesa/main/texcompress_bptc_share.h" + +void +util_format_bptc_rgba_unorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, + const uint8_t *src_row, unsigned src_stride, + unsigned width, unsigned height) +{ + decompress_rgba_unorm(width, height, +src_row, src_stride, +dst_row, dst_stride); +} + +void +util_format_bptc_rgba_unorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, + const uint8_t *src_row, unsigned src_stride, + unsigned width, unsigned height) +{ + compress_rgba_unorm(width, height, + src_row, src_stride, + dst_row, dst_stride); +} + +void +util_format_bptc_rgba_unorm_unpack_rgba_float(float *dst_row, unsigned dst_stride, + const uint8_t *src_row, unsigned src_stride, + unsigned width, unsigned height) +{ + uint8_t *temp_block; + temp_block = malloc(width * height * 4 * sizeof(uint8_t)); + decompress_rgba_unorm(width, height, + src_row, src_stride, + temp_block, width * 4 * sizeof(uint8_t)); + util_format_read_4f(PIPE_FORMAT_R8G8B8A8_UNORM, + dst_row, dst_stride, + temp_block, width * 4 * sizeof(uint8_t), + 0, 0, width, height); + free((void *) temp_block); +} + +void +util_format_bptc_rgba_unorm_pack_rgba_float(uin
[Mesa-dev] [PATCH v2 4/4] gallium/llvmpipe: Enable support bptc format.
v2: none Signed-off-by: Denis Pauk CC: Marek Olšák CC: Rhys Perry CC: Matt Turner --- src/gallium/drivers/llvmpipe/lp_screen.c | 3 +-- src/gallium/drivers/llvmpipe/lp_test_format.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 28dbd9908f..9921a941d5 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -534,8 +534,7 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen, } } - if (format_desc->layout == UTIL_FORMAT_LAYOUT_BPTC || - format_desc->layout == UTIL_FORMAT_LAYOUT_ASTC) { + if (format_desc->layout == UTIL_FORMAT_LAYOUT_ASTC) { /* Software decoding is not hooked up. */ return FALSE; } diff --git a/src/gallium/drivers/llvmpipe/lp_test_format.c b/src/gallium/drivers/llvmpipe/lp_test_format.c index e9a6e01fdc..a8aa33d8ae 100644 --- a/src/gallium/drivers/llvmpipe/lp_test_format.c +++ b/src/gallium/drivers/llvmpipe/lp_test_format.c @@ -388,8 +388,7 @@ test_all(unsigned verbose, FILE *fp) } /* missing fetch funcs */ - if (format_desc->layout == UTIL_FORMAT_LAYOUT_BPTC || - format_desc->layout == UTIL_FORMAT_LAYOUT_ASTC) { + if (format_desc->layout == UTIL_FORMAT_LAYOUT_ASTC) { continue; } -- 2.17.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH mesa 4/4] radv: add VK_EXT_display_control to radv driver [v5]
Reviewed-by: Bas Nieuwenhuizen Thanks! On Thu, Jun 21, 2018 at 12:52 AM, Keith Packard wrote: > This extension provides fences and frame count information to direct > display contexts. It uses new kernel ioctls to provide 64-bits of > vblank sequence and nanosecond resolution. > > v2: > Rework fence integration into the driver so that waiting for > any of a mixture of fence types (wsi, driver or syncobjs) > causes the driver to poll, while a list of just syncobjs or > just driver fences will block. When we get syncobjs for wsi > fences, we'll adapt to use them. > > v3: Adopt Jason Ekstrand's coding conventions > > Declare variables at first use, eliminate extra whitespace between > types and names. Wrap lines to 80 columns. > > Suggested-by: Jason Ekstrand > > v4: Adapt to WSI fence API change. It now returns VkResult and > no longer has an option for relative timeouts. > > v5: wsi_register_display_event and wsi_register_device_event now > use the default allocator when NULL is provided, so remove the > computation of 'alloc' here. > > Signed-off-by: Keith Packard > --- > src/amd/vulkan/radv_device.c | 70 - > src/amd/vulkan/radv_extensions.py | 1 + > src/amd/vulkan/radv_private.h | 1 + > src/amd/vulkan/radv_wsi_display.c | 101 ++ > 4 files changed, 158 insertions(+), 15 deletions(-) > > diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c > index ffeb6450b33..b560f1c3085 100644 > --- a/src/amd/vulkan/radv_device.c > +++ b/src/amd/vulkan/radv_device.c > @@ -3241,6 +3241,7 @@ VkResult radv_CreateFence( > if (!fence) > return vk_error(device->instance, > VK_ERROR_OUT_OF_HOST_MEMORY); > > + fence->fence_wsi = NULL; > fence->submitted = false; > fence->signalled = !!(pCreateInfo->flags & > VK_FENCE_CREATE_SIGNALED_BIT); > fence->temp_syncobj = 0; > @@ -3285,6 +3286,8 @@ void radv_DestroyFence( > device->ws->destroy_syncobj(device->ws, fence->syncobj); > if (fence->fence) > device->ws->destroy_fence(fence->fence); > + if (fence->fence_wsi) > + fence->fence_wsi->destroy(fence->fence_wsi); > vk_free2(&device->alloc, pAllocator, fence); > } > > @@ -3310,7 +3313,19 @@ static bool > radv_all_fences_plain_and_submitted(uint32_t fenceCount, const VkFen > { > for (uint32_t i = 0; i < fenceCount; ++i) { > RADV_FROM_HANDLE(radv_fence, fence, pFences[i]); > - if (fence->syncobj || fence->temp_syncobj || > (!fence->signalled && !fence->submitted)) > + if (fence->fence == NULL || fence->syncobj || > + fence->temp_syncobj || > + (!fence->signalled && !fence->submitted)) > + return false; > + } > + return true; > +} > + > +static bool radv_all_fences_syncobj(uint32_t fenceCount, const VkFence > *pFences) > +{ > + for (uint32_t i = 0; i < fenceCount; ++i) { > + RADV_FROM_HANDLE(radv_fence, fence, pFences[i]); > + if (fence->syncobj == 0 && fence->temp_syncobj == 0) > return false; > } > return true; > @@ -3326,7 +3341,9 @@ VkResult radv_WaitForFences( > RADV_FROM_HANDLE(radv_device, device, _device); > timeout = radv_get_absolute_timeout(timeout); > > - if (device->always_use_syncobj) { > + if (device->always_use_syncobj && > + radv_all_fences_syncobj(fenceCount, pFences)) > + { > uint32_t *handles = malloc(sizeof(uint32_t) * fenceCount); > if (!handles) > return vk_error(device->instance, > VK_ERROR_OUT_OF_HOST_MEMORY); > @@ -3396,21 +3413,34 @@ VkResult radv_WaitForFences( > if (fence->signalled) > continue; > > - if (!fence->submitted) { > - while(radv_get_current_time() <= timeout && > !fence->submitted) > - /* Do nothing */; > + if (fence->fence) { > + if (!fence->submitted) { > + while(radv_get_current_time() <= timeout && > + !fence->submitted) > + /* Do nothing */; > > - if (!fence->submitted) > - return VK_TIMEOUT; > + if (!fence->submitted) > + return VK_TIMEOUT; > + > + /* Recheck as it may have been set by > +* submitting operations. */ > > - /* Recheck as it may have been set by submitting > operations. */ > - if (fence->signalled) > -
Re: [Mesa-dev] [PATCH mesa 4/4] radv: add VK_EXT_display_control to radv driver [v5]
Bas Nieuwenhuizen writes: > Reviewed-by: Bas Nieuwenhuizen > > Thanks! Thanks to you as well; I've rebased and pushed to master. Two down, two to go (extensions that is) -- -keith signature.asc Description: PGP signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 3/3] radv: Add new VK_MESA_query_timestamp extension to radv driver
This extension adds a single function to query the current GPU timestamp, just like glGetInteger64v(GL_TIMESTAMP, ×tamp). This function is needed to complete the implementation of GOOGLE_display_timing, which needs to be able to correlate GPU and CPU timestamps. Signed-off-by: Keith Packard --- src/amd/vulkan/radv_device.c | 8 src/amd/vulkan/radv_extensions.py | 1 + src/amd/vulkan/radv_private.h | 1 + 3 files changed, 10 insertions(+) diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 62e1b9dba66..c552030491f 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -4770,3 +4770,11 @@ radv_GetDeviceGroupPeerMemoryFeatures( VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT | VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT; } + +VkResult radv_QueryCurrentTimestampMESA(VkDevice _device, uint64_t *timestamp) +{ + RADV_FROM_HANDLE(radv_device, device, _device); + + *timestamp = device->ws->query_value(device->ws, RADEON_TIMESTAMP); + return VK_SUCCESS; +} diff --git a/src/amd/vulkan/radv_extensions.py b/src/amd/vulkan/radv_extensions.py index ebc3f6bc2b5..008e5cfe960 100644 --- a/src/amd/vulkan/radv_extensions.py +++ b/src/amd/vulkan/radv_extensions.py @@ -107,6 +107,7 @@ EXTENSIONS = [ Extension('VK_AMD_shader_core_properties',1, True), Extension('VK_AMD_shader_info', 1, True), Extension('VK_AMD_shader_trinary_minmax', 1, True), +Extension('VK_MESA_query_timestamp', 1, True), ] class VkVersion: diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index f001b836c8f..a3e0a6f013c 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -75,6 +75,7 @@ typedef uint32_t xcb_window_t; #include #include #include +#include #include "radv_entrypoints.h" -- 2.17.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 0/3] Add (internal) MESA_query_timestamp extension to anv/radv
This extension fetches the current GPU timestamp from the hardware, just like the OpenGL API glGetInteger64v(GL_TIMESTAMP, ×tamp) function. I need this to correlate GPU and CPU timestamps for the GOOGLE_display_timing extension, but I think it will be useful for applications as well. I'm not sure this is exactly the API we need for this; it might be better for it to return *two* timestamps, a GPU and a CPU one which were as closely correlated as possible down in the kernel. The kernel APIs that this calls on anv and radv don't do that, so I didn't want to pretend to offer functionality I couldn't actually supply. Suggestions on what to do here are welcome! -keith ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/3] anv: Add new VK_MESA_query_timestamp extension to anv driver [v2]
This extension adds a single function to query the current GPU timestamp, just like glGetInteger64v(GL_TIMESTAMP, ×tamp). This function is needed to complete the implementation of GOOGLE_display_timing, which needs to be able to correlate GPU and CPU timestamps. v2: Adopt Jason Ekstrand's coding conventions Declare variables at first use, eliminate extra whitespace between types and names. Wrap lines to 80 columns. Add extension to list in alphabetical order Suggested-by: Jason Ekstrand Signed-off-by: Keith Packard --- src/intel/vulkan/anv_extensions.py | 1 + src/intel/vulkan/anv_gem.c | 13 + src/intel/vulkan/anv_private.h | 3 +++ src/intel/vulkan/genX_query.c | 15 +++ 4 files changed, 32 insertions(+) diff --git a/src/intel/vulkan/anv_extensions.py b/src/intel/vulkan/anv_extensions.py index 0f99f58ecb1..37bace23857 100644 --- a/src/intel/vulkan/anv_extensions.py +++ b/src/intel/vulkan/anv_extensions.py @@ -120,6 +120,7 @@ EXTENSIONS = [ 'device->has_context_priority'), Extension('VK_EXT_shader_viewport_index_layer', 1, True), Extension('VK_EXT_shader_stencil_export', 1, 'device->info.gen >= 9'), +Extension('VK_MESA_query_timestamp', 1, True), ] class VkVersion: diff --git a/src/intel/vulkan/anv_gem.c b/src/intel/vulkan/anv_gem.c index 3ba6d198a8a..8a31940e7aa 100644 --- a/src/intel/vulkan/anv_gem.c +++ b/src/intel/vulkan/anv_gem.c @@ -423,6 +423,19 @@ anv_gem_fd_to_handle(struct anv_device *device, int fd) return args.handle; } +int +anv_gem_reg_read(struct anv_device *device, uint32_t offset, uint64_t *result) +{ + struct drm_i915_reg_read args = { + .offset = offset + }; + + int ret = anv_ioctl(device->fd, DRM_IOCTL_I915_REG_READ, &args); + + *result = args.val; + return ret; +} + #ifndef SYNC_IOC_MAGIC /* duplicated from linux/sync_file.h to avoid build-time dependency * on new (v4.7) kernel headers. Once distro's are mostly using diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 510471da602..0fa2a46e333 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -76,6 +76,7 @@ struct gen_l3_config; #include #include #include +#include #include "anv_entrypoints.h" #include "anv_extensions.h" @@ -1055,6 +1056,8 @@ int anv_gem_get_aperture(int fd, uint64_t *size); int anv_gem_gpu_get_reset_stats(struct anv_device *device, uint32_t *active, uint32_t *pending); int anv_gem_handle_to_fd(struct anv_device *device, uint32_t gem_handle); +int anv_gem_reg_read(struct anv_device *device, + uint32_t offset, uint64_t *result); uint32_t anv_gem_fd_to_handle(struct anv_device *device, int fd); int anv_gem_set_caching(struct anv_device *device, uint32_t gem_handle, uint32_t caching); int anv_gem_set_domain(struct anv_device *device, uint32_t gem_handle, diff --git a/src/intel/vulkan/genX_query.c b/src/intel/vulkan/genX_query.c index e35e9b85844..980c543460e 100644 --- a/src/intel/vulkan/genX_query.c +++ b/src/intel/vulkan/genX_query.c @@ -552,6 +552,21 @@ void genX(CmdWriteTimestamp)( } } +VkResult genX(QueryCurrentTimestampMESA)( + VkDevice _device, + uint64_t *timestamp) +{ + ANV_FROM_HANDLE(anv_device, device, _device); + int ret; + + /* XXX older kernels don't support this interface. */ + ret = anv_gem_reg_read(device, TIMESTAMP | 1, timestamp); + + if (ret != 0) + return VK_ERROR_DEVICE_LOST; + return VK_SUCCESS; +} + #if GEN_GEN > 7 || GEN_IS_HASWELL static uint32_t -- 2.17.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/3] vulkan: Define new VK_MESA_query_timestamp extension [v2]
This extension adds a single function to query the current GPU timestamp, just like glGetInteger64v(GL_TIMESTAMP, ×tamp). This function is needed to complete the implementation of GOOGLE_display_timing, which needs to be able to correlate GPU and CPU timestamps. v2: Adopt Jason Ekstrand's coding conventions Declare variables at first use, eliminate extra whitespace between types and names. Wrap lines to 80 columns. Add extension to list in alphabetical order Suggested-by: Jason Ekstrand Signed-off-by: Keith Packard --- include/vulkan/vk_mesa_query_timestamp.h | 41 src/vulkan/registry/vk.xml | 15 + 2 files changed, 56 insertions(+) create mode 100644 include/vulkan/vk_mesa_query_timestamp.h diff --git a/include/vulkan/vk_mesa_query_timestamp.h b/include/vulkan/vk_mesa_query_timestamp.h new file mode 100644 index 000..4e0b50cb9cc --- /dev/null +++ b/include/vulkan/vk_mesa_query_timestamp.h @@ -0,0 +1,41 @@ +/* + * Copyright © 2018 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#ifndef __VK_MESA_QUERY_TIMESTAMP_H__ +#define __VK_MESA_QUERY_TIMESTAMP_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef VkResult (VKAPI_PTR *PFN_vkQueryCurrentTimestampMESA)( +VkDevice device, uint64_t *timestamp); + +VKAPI_ATTR VkResult VKAPI_CALL vkQueryCurrentTimestampMESA( +VkDevice device, uint64_t *timestamp); + +#ifdef __cplusplus +} +#endif + +#endif /* __VK_MESA_QUERY_TIMESTAMP_H__ */ + diff --git a/src/vulkan/registry/vk.xml b/src/vulkan/registry/vk.xml index 7018bbe8421..3a5cecdc8e3 100644 --- a/src/vulkan/registry/vk.xml +++ b/src/vulkan/registry/vk.xml @@ -6102,6 +6102,11 @@ server. uint32_t maxDrawCount uint32_t stride + +VkResult vkQueryCurrentTimestampMESA +VkDevice device +uint64_t* pTimestamp + @@ -8826,5 +8831,15 @@ server. + + + + + + + -- 2.17.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 106980] Basemark GPU vulkan benchmark fails.
https://bugs.freedesktop.org/show_bug.cgi?id=106980 --- Comment #4 from Jason Ekstrand --- (In reply to Bas Nieuwenhuizen from comment #3) > Seems like the validation issue was fixed by the deref rewrite, and that has > been upstreamed now. That makes me suspicious. If we were getting a validation error before, likely something is still going wrong. -- You are receiving this mail because: You are the assignee for the bug. You are the QA Contact for the bug.___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/3] vulkan: Define new VK_MESA_query_timestamp extension [v2]
I haven't thought through this comment all that hard but would it make sense to have three timestamps, CPU, GPU, CPU so that you have error bars on the GPU timestamp? At the very least, two timestamps would be better than one so that, when we pull it into the kernel, it can provide something more accurate than userspace trying to grab a snapshot. --Jason On June 23, 2018 10:15:34 Keith Packard wrote: This extension adds a single function to query the current GPU timestamp, just like glGetInteger64v(GL_TIMESTAMP, ×tamp). This function is needed to complete the implementation of GOOGLE_display_timing, which needs to be able to correlate GPU and CPU timestamps. v2: Adopt Jason Ekstrand's coding conventions Declare variables at first use, eliminate extra whitespace between types and names. Wrap lines to 80 columns. Add extension to list in alphabetical order Suggested-by: Jason Ekstrand Signed-off-by: Keith Packard --- include/vulkan/vk_mesa_query_timestamp.h | 41 src/vulkan/registry/vk.xml | 15 + 2 files changed, 56 insertions(+) create mode 100644 include/vulkan/vk_mesa_query_timestamp.h diff --git a/include/vulkan/vk_mesa_query_timestamp.h b/include/vulkan/vk_mesa_query_timestamp.h new file mode 100644 index 000..4e0b50cb9cc --- /dev/null +++ b/include/vulkan/vk_mesa_query_timestamp.h @@ -0,0 +1,41 @@ +/* + * Copyright © 2018 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#ifndef __VK_MESA_QUERY_TIMESTAMP_H__ +#define __VK_MESA_QUERY_TIMESTAMP_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef VkResult (VKAPI_PTR *PFN_vkQueryCurrentTimestampMESA)( +VkDevice device, uint64_t *timestamp); + +VKAPI_ATTR VkResult VKAPI_CALL vkQueryCurrentTimestampMESA( +VkDevice device, uint64_t *timestamp); + +#ifdef __cplusplus +} +#endif + +#endif /* __VK_MESA_QUERY_TIMESTAMP_H__ */ + diff --git a/src/vulkan/registry/vk.xml b/src/vulkan/registry/vk.xml index 7018bbe8421..3a5cecdc8e3 100644 --- a/src/vulkan/registry/vk.xml +++ b/src/vulkan/registry/vk.xml @@ -6102,6 +6102,11 @@ server. uint32_t maxDrawCount uint32_t stride + +VkResult vkQueryCurrentTimestampMESA +VkDevice device +uint64_t* pTimestamp + @@ -8826,5 +8831,15 @@ server. name="VK_KHR_EXTENSION_211_EXTENSION_NAME"/> + + +name="VK_MESA_QUERY_TIMESTAMP_SPEC_VERSION"/> +name="VK_MESA_QUERY_TIMESTAMP_NAME"/> + + + -- 2.17.1 ___ dri-devel mailing list dri-de...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] nvc0/ir: return 0 in imageLoad on incomplete textures
We already guarded all OP_SULDP against out of bound accesses, but those ended up just reusing whatever value was stored in the dest registers. fixes CTS test shader_image_load_store.incomplete_textures Signed-off-by: Karol Herbst --- .../nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 30 +-- .../nouveau/codegen/nv50_ir_lowering_nvc0.h | 1 + 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp index 5723847234e..c7efbc74df3 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp @@ -2180,13 +2180,33 @@ NVC0LoweringPass::convertSurfaceFormat(TexInstruction *su) } } +void +NVC0LoweringPass::insertOOBSurfaceOpResult(TexInstruction *su) +{ + bld.setPosition(su, true); + + for (unsigned i = 0; su->defExists(i); ++i) { + ValueDef &def = su->def(i); + + Instruction *mov = bld.mkMov(bld.getSSA(), bld.loadImm(NULL, 0)); + assert(su->cc == CC_NOT_P); + mov->setPredicate(CC_P, su->getPredicate()); + Instruction *uni = bld.mkOp2(OP_UNION, TYPE_U32, bld.getSSA(), NULL, mov->getDef(0)); + + def.replace(uni->getDef(0), true); + uni->setSrc(0, def.get()); + } +} + void NVC0LoweringPass::handleSurfaceOpNVE4(TexInstruction *su) { processSurfaceCoordsNVE4(su); - if (su->op == OP_SULDP) + if (su->op == OP_SULDP) { convertSurfaceFormat(su); + insertOOBSurfaceOpResult(su); + } if (su->op == OP_SUREDB || su->op == OP_SUREDP) { assert(su->getPredicate()); @@ -2296,8 +2316,10 @@ NVC0LoweringPass::handleSurfaceOpNVC0(TexInstruction *su) processSurfaceCoordsNVC0(su); - if (su->op == OP_SULDP) + if (su->op == OP_SULDP) { convertSurfaceFormat(su); + insertOOBSurfaceOpResult(su); + } if (su->op == OP_SUREDB || su->op == OP_SUREDP) { const int dim = su->tex.target.getDim(); @@ -2397,8 +2419,10 @@ NVC0LoweringPass::handleSurfaceOpGM107(TexInstruction *su) { processSurfaceCoordsGM107(su); - if (su->op == OP_SULDP) + if (su->op == OP_SULDP) { convertSurfaceFormat(su); + insertOOBSurfaceOpResult(su); + } if (su->op == OP_SUREDP) { Value *def = su->getDef(0); diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h index 91771fbf7e9..d7350d03b78 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.h @@ -143,6 +143,7 @@ private: void processSurfaceCoordsNVE4(TexInstruction *); void processSurfaceCoordsNVC0(TexInstruction *); void convertSurfaceFormat(TexInstruction *); + void insertOOBSurfaceOpResult(TexInstruction *); Value *calculateSampleOffset(Value *sampleID); protected: -- 2.17.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] Implementation of VK extensions for i965
Hello, can I ask if it is planned to implement VK extensions for i965:- VK_EXT_shader_viewport_index_layer- VK_EXT_vertex_attribute_divisorThe new version of DXVK 0.60 requires their availability. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] Implementation of VK extensions for i965
Not sure about the other extension, but the latest version of the intel driver should support VK_EXT_shader_viewport_index_layer already. On Sun, Jun 24, 2018 at 1:13 AM, Александр Бесчасный wrote: > Hello, can I ask if it is planned to implement VK extensions for i965: > - VK_EXT_shader_viewport_index_layer > - VK_EXT_vertex_attribute_divisor > The new version of DXVK 0.60 requires their availability. > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] Implementation of VK extensions for i965
I have latest available version of Mesa - 18.1.2, Vulkan - 1.1.0.Can I check available extensions VK for my version? 24.06.2018, 03:35, "Bas Nieuwenhuizen" :Not sure about the other extension, but the latest version of theintel driver should support VK_EXT_shader_viewport_index_layeralready.On Sun, Jun 24, 2018 at 1:13 AM, Александр Бесчасныйwrote: Hello, can I ask if it is planned to implement VK extensions for i965: - VK_EXT_shader_viewport_index_layer - VK_EXT_vertex_attribute_divisor The new version of DXVK 0.60 requires their availability. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev -- ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] Implementation of VK extensions for i965
Yes, we already have support for VK_EXT_shader_viewport_index_layer. For VK_EXT_vertex_attribute_divisor, it should be trivial and I'm happy to do so but there are currently no tests for it and, up until this email, we haven't had any call for that. We'll try to bump it up the priority list. --Jason On June 23, 2018 20:22:10 Александр Бесчасный wrote: I have latest available version of Mesa - 18.1.2, Vulkan - 1.1.0. Can I check available extensions VK for my version? 24.06.2018, 03:35, "Bas Nieuwenhuizen" : Not sure about the other extension, but the latest version of the intel driver should support VK_EXT_shader_viewport_index_layer already. On Sun, Jun 24, 2018 at 1:13 AM, Александр Бесчасный wrote: Hello, can I ask if it is planned to implement VK extensions for i965: - VK_EXT_shader_viewport_index_layer - The new version of DXVK 0.60 requires their availability. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev -- ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] Implementation of VK extensions for i965
Many thanks! 24.06.2018, 04:50, "Jason Ekstrand" : > Yes, we already have support for VK_EXT_shader_viewport_index_layer. For > VK_EXT_vertex_attribute_divisor, it should be trivial and I'm happy to do so > but there are currently no tests for it and, up until this email, we haven't > had any call for that. We'll try to bump it up the priority list. > > --Jason > > On June 23, 2018 20:22:10 Александр Бесчасный wrote: >> I have latest available version of Mesa - 18.1.2, Vulkan - 1.1.0. >> Can I check available extensions VK for my version? >> >> 24.06.2018, 03:35, "Bas Nieuwenhuizen" : >>> Not sure about the other extension, but the latest version of the >>> intel driver should support VK_EXT_shader_viewport_index_layer >>> already. >>> >>> On Sun, Jun 24, 2018 at 1:13 AM, Александр Бесчасный >>> wrote: Hello, can I ask if it is planned to implement VK extensions for i965: - VK_EXT_shader_viewport_index_layer - The new version of DXVK 0.60 requires their availability. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev >> >> -- ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev