summaryrefslogtreecommitdiffstats
path: root/src/vulkan
Commit message (Collapse)AuthorAgeFilesLines
* vulkan/overlay: keep allocating draw data until it can be reusedLionel Landwerlin2019-05-101-113/+135
| | | | | | | | | | | | | | | | | | | | | | | The original implementation assumed that we could allocate the same amount of command buffers as the number of images in the swapchain. But the application could potentially render much faster and rerender into images that have been submitted for presentation but not yet presented. This change keeps on allocating command buffers, vertex buffer, vertex indices as well as a semaphore and a fence for as long as we can't reuse a previously submitted one. This fixes rendering issues in the overlay at high frame rates. v2: Don't recreate semaphores constantly (Józef) v3: Drop useless surface & FreeCommandBuffers (Józef) Signed-off-by: Lionel Landwerlin <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110655 Cc: 19.1 <[email protected]> Reviewed-by: Józef Kucia <[email protected]>
* vulkan/overlay: fix truncating error on 32bit platformsLionel Landwerlin2019-05-101-40/+36
| | | | | | | | | | | | | | Non dispatchable handles can be uint64_t. When compiling the layer on a 32bit platform, this will lead to casting uint64_t into (void *) which is 32bit, leading to incorrect handles being mapped internally in the layer. v2: Use more HKEY() (Eric) Signed-off-by: Lionel Landwerlin <[email protected]> Reported-by: Józef Kucia <[email protected]> Fixes: 2d2927938f074f ("vulkan/overlay-layer: fix cast errors") Reviewed-by: Józef Kucia <[email protected]>
* vulkan/overlay-layer: fix cast errorsLionel Landwerlin2019-05-071-7/+7
| | | | | | | | | | | Not quite sure what version of GCC/Clang produces errors (8.3.0 locally was fine). v2: also fix an integer literal issue (Karol) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> (v1) Reviewed-by: Eric Engestrom <[email protected]>
* vulkan/overlay: add TODO listLionel Landwerlin2019-05-021-0/+3
| | | | | | | Keen on having other people contribute. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* vulkan/overlay: make overriden functions staticLionel Landwerlin2019-05-021-25/+26
| | | | | | And fix the unused CmdDrawIndirect. Signed-off-by: Lionel Landwerlin <[email protected]>
* vulkan/overlay: make overlay size configurableLionel Landwerlin2019-05-023-1/+18
| | | | Signed-off-by: Lionel Landwerlin <[email protected]>
* vulkan/overlay: add a frame counter optionLionel Landwerlin2019-05-022-1/+5
| | | | | | | | This is useful to normalize the numbers written into the output file as those number are accumulated over a period of time and number of frames. Signed-off-by: Lionel Landwerlin <[email protected]>
* vulkan/overlay: record all select metrics into output fileLionel Landwerlin2019-05-022-1/+48
| | | | | | | | | | | | | | | | The output looks something like this (csv style) : fps, frame, frame_timing(us), submit, draw_indexed, pipeline_graphics, acquire_timing(us), vert_invocations, frag_invocations, gpu_timing(ns) 480.55, 242, 501512, 247, 1444, 1204, 714, 5827272, 113043296, 121424174 467.80, 234, 500214, 234, 1412, 1176, 648, 5635680, 109436188, 117743760 424.37, 213, 501923, 213, 2130, 1704, 623, 5132448, 99657292, 105474683 472.15, 237, 501962, 237, 2370, 1896, 667, 5710752, 110924644, 122226004 411.32, 206, 500826, 206, 2060, 1648, 709, 4963776, 96491764, 95333273 458.87, 230, 501228, 230, 2300, 1840, 634, 5542080, 107758204, 123112090 475.01, 238, 501044, 238, 2380, 1904, 631, 5734848, 111477480, 122087426 471.08, 236, 500972, 236, 2360, 1888, 655, 5686656, 110498496, 114816162 Signed-off-by: Lionel Landwerlin <[email protected]>
* vulkan/overlay: add a margin to the size of the windowLionel Landwerlin2019-05-021-5/+6
| | | | | | Looks a bit better. Signed-off-by: Lionel Landwerlin <[email protected]>
* vulkan/overlay: add no display optionLionel Landwerlin2019-05-023-25/+50
| | | | | | | In case you're just interested in data being record to the output file. Signed-off-by: Lionel Landwerlin <[email protected]>
* vulkan/overlay: add pipeline statistic & timestamps supportLionel Landwerlin2019-05-022-55/+383
| | | | | | | | | | v2: switch to VkBase{In,Out}Structure v3: Add timestamps at begin/end of primary command buffers to estimate gpu time spent per submission (Lionel) Signed-off-by: Lionel Landwerlin <[email protected]> Acked-by: Eric Engestrom <[email protected]> (v2)
* vulkan/overlay: record stats in command buffers and accumulate on exec/submitLionel Landwerlin2019-05-022-141/+238
| | | | | | | | | | | | This significantly reworks how numbers displayed are computed. We accumulate operations written into command buffers and add those to the device when submitted to a queue. These collected values are then used to compute per frame overlay data. We also accumulate the data over the sampling fps period to produce numbers for that period of time. Signed-off-by: Lionel Landwerlin <[email protected]>
* vulkan/overlay: update help printoutLionel Landwerlin2019-05-021-2/+2
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* vulkan/util: generate a helper function to return pNext struct sizesLionel Landwerlin2019-05-022-4/+54
| | | | | | | | | | | | | | This will be used to copy chains of structures so that we can alterate some of them. v2: Drop vk_util.h include (Eric) Use VkBaseInStructure directly (Eric) v3: Drop --platforms= param to generator script, instead produce a file with #ifdef based what platforms are compiled. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* wsi/wayland: document lack of vkAcquireNextImageKHR timeout supportEric Engestrom2019-05-021-0/+10
| | | | Signed-off-by: Eric Engestrom <[email protected]>
* vulkan/wsi/wayland: Respect non-blocking AcquireNextImageDaniel Stone2019-05-021-2/+7
| | | | | | | | | | | | | | | | | If the client has requested that AcquireNextImage not block at all, with a timeout of 0, then don't make any non-blocking calls. This will still potentially block infinitely given a non-infinte timeout, but the fix for that is much more involved. Signed-off-by: Daniel Stone <[email protected]> Cc: [email protected] Cc: Chad Versace <[email protected]> Cc: Jason Ekstrand <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108540 Acked-by: Jason Ekstrand <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* delete autotools .gitignore filesEric Engestrom2019-04-292-3/+0
| | | | | | | | One special case, `src/util/xmlpool/.gitignore` is not entirely deleted, as `xmlpool.pot` still gets generated (eg. by `ninja xmlpool-pot`). Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* vulkan/wsi: don't use DUMB_CLOSE for normal GEM handlesEmil Velikov2019-04-261-2/+2
| | | | | | | | | | | Currently we get normal GEM handles from PrimeFDToHandle, yet we close then with DUMB_CLOSE. Use GEM_CLOSE instead. Fixes: da997ebec92 ("vulkan: Add KHR_display extension using DRM [v10]") Cc: Jason Ekstrand <[email protected]> Cc: Keith Packard <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* vulkan/wsi: check if the display_fd given is masterEmil Velikov2019-04-261-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | As effectively required by the extension, we need to ensure we're master Currently drivers employ vendor specific solutions, which check if the device behind the fd is capable*, yet none of them do the master check. *In the radv case, if acceleration is available. Instead of duplicating the check in each driver, keep it where it's needed and used. Note this copies libdrm's drmIsMaster() to avoid depending on bleeding edge version of the library. v2: set the fd to -1 if not master (Bas) Fixes: da997ebec92 ("vulkan: Add KHR_display extension using DRM [v10]") Cc: Andres Rodriguez <[email protected]> Cc: Jason Ekstrand <[email protected]> Cc: Keith Packard <[email protected]> Reported-by: Andres Rodriguez <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* vulkan/wsi: Add X11 adaptive sync support based on dri options.Bas Nieuwenhuizen2019-04-234-2/+52
| | | | | | | | | | | | | | | | | | | | | | | | The dri options are optional. When the dri options are not provided the WSI will not use adaptive sync. FWIW I think for xf86-video-amdgpu this still requires an X11 config option, so only people who opt in can get possible regressions from this. So then the remaining question is: why do this in the WSI? It has been suggested in another MR that the application sets this. However, I disagree with that as I don't think we'll ever get a reasonable set of applications setting it. The next questions is whether this can be a layer. It definitely can be as implemented now. However, I think this generally fits well with the function of the WSI. Furthemore, for e.g. the DISPLAY WSI this is much harder to do in a layer. Of course, most of the WSI could almost be a layer, but I think this still fits best in the WSI. Acked-by: Jason Ekstrand <[email protected]>
* Delete autotoolsDylan Baker2019-04-151-124/+0
| | | | | | | | | | Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Acked-by: Marek Olšák <[email protected]> Acked-by: Jason Ekstrand <[email protected]> Acked-by: Bas Nieuwenhuizen <[email protected]> Acked-by: Matt Turner <[email protected]>
* vulkan: Update the XML and headers to 1.1.106Jason Ekstrand2019-04-151-18/+64
| | | | | Acked-by: Dave Airlie <[email protected]> Acked-by: Lionel Landwerlin <[email protected]>
* wsi: allow to override the present mode with MESA_VK_WSI_PRESENT_MODESamuel Pitoiset2019-04-106-3/+78
| | | | | | | This is common to all Vulkan drivers and all WSI. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* vulkan/wsi: make wl_drm optionalChia-I Wu2019-04-091-19/+32
| | | | | | | | | | | | When wl_drm is missing and the driver supports modifiers, use zwp_linux_dmabuf_v1 for the list of supported formats and for buffer creation. Limit the supported formats to those with modifiers, which are WL_DRM_FORMAT_{ARGB8888,XRGB8888} currently. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* vulkan/wsi: add wsi_wl_display_dmabufChia-I Wu2019-04-091-22/+28
| | | | | | | Add wsi_wl_display_dmabuf for zwp_linux_dmabuf_v1-related states. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* vulkan/wsi: add wsi_wl_display_drmChia-I Wu2019-04-091-14/+18
| | | | | | | | | | Add wsi_wl_display_drm for wl_drm-related states. We will move formats into the struct in a later commit. Remove the unnecessary check for wl_registry_bind failures. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* vulkan/wsi: refactor drm_handle_formatChia-I Wu2019-04-091-53/+75
| | | | | | | | Refactor the swtich statement in drm_handle_format out to wsi_wl_display_add_wl_format. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* vulkan/wsi: create wl_drm wrapper as neededChia-I Wu2019-04-091-7/+20
| | | | | | | | When modifiers are specified, we have to use dmabuf rather than wl_drm. We don't need the wrapper in that case. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* vulkan/wsi: move modifier array into wsi_wl_swapchainChia-I Wu2019-04-091-20/+32
| | | | | | | This avoids repeated checks for each wsi_wl_image. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* anv: implement VK_KHR_swapchain revision 70Lionel Landwerlin2019-04-081-0/+12
| | | | | | | | | | | | | | | | | | This revision allows for images to be : - created by reusing image parameters from swapchain - bound to memory from a swapchain v2: Add color attachment flag Use same implicit WSI parameters (tiling, samples, usage) v3: Fix missing break in vk_foreach_struct_const() switch (Lionel) v4: Fix accessing image aspects before android resolve (Tapani) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* vk/util: remove unneeded array indexEric Engestrom2019-04-081-1/+1
| | | | | | | | | This is an array of 1, so [0] is the only content, and meson already flattens the list so this is unnecessary. Also, all the other uses of vk_api_xml don't do that. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* vulkan/overlay: improve error reportingLionel Landwerlin2019-03-221-125/+89
| | | | | | | | We can show the actual command & line where the failure happened Signed-off-by: Lionel Landwerlin <[email protected]> Suggested-by: Tapani Pälli <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* vulkan/overlay: check return value of swapchain get imagesLionel Landwerlin2019-03-221-8/+11
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* vulkan/overlay: silence validation layer warningsLionel Landwerlin2019-03-221-5/+5
| | | | | | | v2: Drop call to FreeDescriptorSet Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* vulkan/overlay: properly register layer object with loaderLionel Landwerlin2019-03-221-9/+24
| | | | | | | | This is required by the validation layers if we want to validate the commands inserted by the overlay layer. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* anv,radv: Implement VK_KHR_surface_capability_protectedJason Ekstrand2019-03-183-7/+59
| | | | | Reviewed-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* vulkan: Update the XML and headers to 1.1.104Bas Nieuwenhuizen2019-03-181-27/+177
| | | | | | Acked-by: Samuel Pitoiset <[email protected]> Acked-by: Eric Engestrom <[email protected]> Acked-by: Lionel Landwerlin <[email protected]>
* vulkan/util: Handle enums that are in platform-specific headers.Bas Nieuwenhuizen2019-03-181-0/+23
| | | | | | | | | | | | VkFullScreenExclusiveEXT comes from the win32 header. Mostly took the logic from the entrypoint scripts: 1) If there is an ext that has it in the requires and has a platform, take the guard for that platform. 2) Otherwise assume it is from the core headers. Acked-by: Samuel Pitoiset <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* vulkan: factor out wsi dependenciesLionel Landwerlin2019-03-184-24/+15
| | | | | | | | | | | | | In commit 530927d3f6a303d9 ("vulkan/util: generate instance/device dispatch tables") we started generating instance dispatch tables some of them (like wayland) require external headers. This commit moves the dependencies up one level so that they apply the whole vulkan directory. We use them for both the util & overlay layer. Signed-off-by: Lionel Landwerlin <[email protected]> Fixes: 530927d3f6a303 ("vulkan/util: generate instance/device dispatch tables") Reviewed-by: Eric Engestrom <[email protected]>
* android: Build fixes for OMR1Tapani Pälli2019-03-181-0/+8
| | | | | | | | | | | | | Some of the header file locations are changed between Android versions (when VNDK is used), patch makes sure we get all the required headers. v2: cleanups, put SDK version checks in all places (Tapani) Signed-off-by: Tapani Pälli <[email protected]> Signed-off-by: Chen Lin Z <[email protected]> Tested-by: Clayton Craft <[email protected]> Acked-by: Eric Engestrom <[email protected]>
* vulkan/util: meson build - add wayland client includeTobias Klausmann2019-03-171-0/+7
| | | | | | | | | | | | | | | | | | | Without this the build breaks with: In file included from ../src/vulkan/util/vk_util.h:32, from ../src/vulkan/util/vk_util.c:28: ../include/vulkan/vulkan.h:51:10: fatal error: wayland-client.h: No such file or directory #include <wayland-client.h> ^~~~~~~~~~~~~~~~~~ compilation terminated. The above misses the include directory for wayland: -I/usr/include/wayland Signed-off-by: Tobias Klausmann <[email protected]> Cc: [email protected] Reviewed-by: Eric Engestrom <[email protected]>
* wsi/x11: use WSI_FROM_HANDLE() instead of pointer castsEric Engestrom2019-03-111-1/+2
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* wsi/wayland: fix pointer casting warning on 32bitEric Engestrom2019-03-111-1/+2
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* wsi/display: s/#if/#ifdef/ to fix -WundefEric Engestrom2019-03-111-1/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* wsi: deduplicate get_current_time() functions between display and x11Eric Engestrom2019-03-114-24/+18
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* vulkan/overlay: fix missing var rename in previous commitEric Engestrom2019-03-071-1/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* vulkan/util: use the platform defines in vk.xml instead of hard-coding themEric Engestrom2019-03-071-9/+10
| | | | | | | See also: 3d4238d26c5de4a0f7a5 "anv: use the platform defines in vk.xml instead of hard-coding them" Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* vulkan/overlay: drop dependency on validation layer headersLionel Landwerlin2019-03-064-213/+40
| | | | | | | | | v2: reimplement layer chain info getters (Eric) v3: make it compile.. (Lionel) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* vulkan/util: generate instance/device dispatch tablesLionel Landwerlin2019-03-065-24/+148
| | | | | | | | This will be used by the overlay instead of system installed validation layers helpers. Signed-off-by: Lionel Landwerlin <[email protected]> Acked-by: Eric Engestrom <[email protected]>
* vulkan/util: make header available from c++Lionel Landwerlin2019-03-061-1/+9
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>