summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* anv: Disable VF statistics for blorp and SOL memcpyJason Ekstrand2017-03-174-3/+18
| | | | | | | | | | | | | | | | | | | In order to get accurate statistics, we need to disable statistics for blits, clears, and the surface state memcpy at the top of each secondary command buffer. There are two possible approaches to this: 1) Disable before the blit/memcpy and re-enable afterwards 2) Move emitting 3DSTATE_VF_STATISTICS from initialization and make it part of pipeline state and then just disabale statistics before blits and memcpy operations. Emitting 3DSTATE_VF_STATISTICS should be fairly cheap so it doesn't really matter which path we take. We choose the second option as it's more consistent with the way the rest of the statistics are enabled and disabled. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv/pipeline: Enable clipper statisticsJason Ekstrand2017-03-171-0/+1
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* genxml: s/Clipper Statistics Enable/Statistics Enable/Jason Ekstrand2017-03-175-5/+5
| | | | | | | It's in 3DSTATE_CLIP, so it doesn't really need the extra detail. This matches what we do for VS, FS, etc. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv/query: Rework store_query_resultJason Ekstrand2017-03-171-15/+24
| | | | | | | | The new version is a nice GPU parallel to cpu_write_query_result and it nicely handles things like dealing with 32 vs. 64-bit offsets in the destination buffer. Reviewed-By: Lionel Landwerlin <[email protected]>
* anv/query: Break GPU query calculation into a helperJason Ekstrand2017-03-171-12/+18
| | | | Reviewed-By: Lionel Landwerlin <[email protected]>
* genxml: Add pipeline statistics registers on gen7+Jason Ekstrand2017-03-174-0/+176
| | | | Reviewed-By: Lionel Landwerlin <[email protected]>
* anv/query: Add a helper for writing a query pool resultJason Ekstrand2017-03-171-16/+17
| | | | Reviewed-By: Lionel Landwerlin <[email protected]>
* anv/query: Use a variable-length slot sizeJason Ekstrand2017-03-172-28/+33
| | | | | | | | Not all queries are the same. Even the two queries we support today require a different amount of data per slot. Once we introduce pipeline statistics queries, the size will vary wildly. Reviewed-By: Lionel Landwerlin <[email protected]>
* anv/query: Move the available bits to the frontJason Ekstrand2017-03-172-28/+19
| | | | | | | | We're about to make slots variable-length and always having the available bits at the front makes certain operations substantially easier once we do that. Reviewed-By: Lionel Landwerlin <[email protected]>
* anv/query: Let 32-bit values wrapJason Ekstrand2017-03-171-2/+0
| | | | | | | | | | | | | | | From the Vulkan 1.0.39 Specification: "If VK_QUERY_RESULT_64_BIT is not set and the result overflows a 32-bit value, the value may either wrap or saturate." So we can either clamp or wrap. Wrapping is both easier and what the user gets if they use vkCmdCopyQueryPoolResults and we should be consistent. We could make vkCmdCopyQueryPoolResults clamp but it's annoying and ends up burning extra batch for something the spec clearly doesn't require. Reviewed-By: Lionel Landwerlin <[email protected]>
* gallium/radeon: formalize that create_batch_query doesn't need pipe_contextMarek Olšák2017-03-173-13/+12
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* gallium/radeon: formalize that create_query doesn't need pipe_contextMarek Olšák2017-03-173-32/+32
| | | | | | for threaded gallium Reviewed-by: Timothy Arceri <[email protected]>
* gallium/radeon: reference pipe_resource in pipe_transferMarek Olšák2017-03-172-2/+5
| | | | | | for threaded gallium Reviewed-by: Timothy Arceri <[email protected]>
* radeonsi: compile all TGSI compute shaders asynchronouslyMarek Olšák2017-03-171-44/+81
| | | | | | required by threaded gallium Reviewed-by: Timothy Arceri <[email protected]>
* radeonsi: require that compiler threads are enabledMarek Olšák2017-03-172-11/+13
| | | | | | | threaded gallium can't use pipe_context's LLVM target machine, because create_shader_selector can be called from a non-driver thread. Reviewed-by: Timothy Arceri <[email protected]>
* trace: remove leftover assertions after pipe_resource wrapping removalMarek Olšák2017-03-171-6/+0
|
* gallium/u_upload: make the first persistent mapping unsynchronizedMarek Olšák2017-03-171-0/+1
| | | | This is simpler for drivers.
* anv/device: init timestampPeriod from devinfoRobert Bragg2017-03-171-3/+1
| | | | | | | | | | Now that there's a timebase_scale in gen_device_info which is effectively the 'period' this switches anv_GetPhysicalDeviceProperties to using this common device info to initialize the timestampPeriod device limit. Signed-off-by: Robert Bragg <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Allow a per gen timebase scale factorRobert Bragg2017-03-176-27/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to Skylake the Gen HW timestamps were driven by a 12.5MHz clock with the convenient property of being able to scale by an integer (80) to nanosecond units. For Skylake the frequency is 12MHz or a scale factor of 83.333333 This updates gen_device_info to track a floating point timebase_scale factor and makes corresponding _queryobj.c changes to no longer assume a scale factor of 80 works across all gens. Although the gen6_ code could have been been left alone, the changes keep the code more comparable, and it now shares a few utility functions for scaling raw timestamps and calculating deltas. The utility for calculating deltas takes into account 32 or 36bit overflow depending on the current kernel version. Note: this leaves the timestamp handling of ARB_query_buffer_object untouched, which continues to use an incorrect scale of 80 on Skylake for now. This is more awkward to solve since the scaling is currently done using a very limited uint64 ALU available to the command parser that doesn't support multiply or divide where it's already taking a large number of instructions just to effectively multiple by 80. This fixes piglit arb_timer_query-timestamp-get on Skylake v2: (Ken) Update timebase_scale for platforms past Skylake/Broxton too. Signed-off-by: Robert Bragg <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* anv/device: Remove a use of a compound literalJason Ekstrand2017-03-171-1/+1
| | | | | | | | Older versions of GCC don't like compound literals in static const variable declarations because they don't think it's an actual constant value. Reviewed-by: Lionel Landwerlin <[email protected]>
* i965: bounds checks while concatenating sysfs pathsRobert Bragg2017-03-171-11/+32
| | | | | | | | | | | | | | This adds some missing return value checks for all uses of snprintf in brw_performance_query.c. This also switches a use of strncpy + strncat for snprintf for consistency and to avoid the chance of the strncpy leaving an unterminated string in the dest buffer if the src is too long. This issue with strncpy was picked up by Coverity. CID: 1402201 Signed-off-by: Robert Bragg <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* mesa: automake: add all headers to the tarball.Emil Velikov2017-03-171-0/+2
| | | | | Fixes: d8d81fbc316 ("mesa: Add infrastructure for a worker thread to process GL commands.") Signed-off-by: Emil Velikov <[email protected]>
* mapi: automake: add all python scripts to EXTRA_DISTEmil Velikov2017-03-171-0/+3
| | | | | | | Otherwise it'll be missing in the tarball and make distcheck will fail. Fixes: 05dd4a1104e ("glapi: Generate GL API marshalling code from the XML.") Signed-off-by: Emil Velikov <[email protected]>
* glapi: avoid using $< in non-suffix make rulesJonathan Gray2017-03-171-2/+2
| | | | | | | | Using $< in non-suffix make rules is a GNU extension. Explicitly use the name of the python script to fix the build on OpenBSD. Signed-off-by: Jonathan Gray <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* radv/ac: Fix shared memory offset calculationAlex Smith2017-03-171-1/+1
| | | | | | | | | | | The index passed to get_shared_memory_ptr is an attribute slot index, i.e. the index of a vec4 within LDS. Therefore this must be scaled by sizeof(vec4) to give the LDS byte offset. Fixes: f4e499ec791 ("radv: add initial non-conformant radv vulkan driver") Signed-off-by: Alex Smith <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> CC: <[email protected]>
* radv: Fix using more than 4 bound descriptor setsJames Legg2017-03-171-1/+3
| | | | | | | | Avoid a buffer overflow in ac_nir_to_llvm.c's create_function when using more than 4 descriptor sets. radv claims support for 8. Cc: 17.0 <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* util/build-id: check dlpi_name before strstr callTapani Pälli2017-03-171-0/+6
| | | | | | | | | | | | According to dl_iterate_phdr man page first object visited is the main program where dlpi_name is an empty string. This fixes segfault on Android when using build-id as identifier. Fixes: d4fa083e11f ("util: Add utility build-id code.") Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Plamena Manolova <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* android: fix segfault within swap_buffersTapani Pälli2017-03-171-0/+8
| | | | | | | | | | | | | | | | | | | | Function droid_swap_buffers may get called without dri2_surf->buffer set, in these cases we don't have a back buffer set either. Patch fixes segfault seen with 3DMark that uses android.opengl.GLSurfaceView for rendering it's UI. backtrace: #00 pc 00013f88 /system/lib/egl/libGLES_mesa.so (droid_swap_buffers+104) #01 pc 000117b2 /system/lib/egl/libGLES_mesa.so (dri2_swap_buffers+50) #02 pc 000058b2 /system/lib/egl/libGLES_mesa.so (eglSwapBuffers+386) #03 pc 00011329 /system/lib/libEGL.so (eglSwapBuffersWithDamageKHR+553) #04 pc 000118e7 /system/lib/libEGL.so (eglSwapBuffers+55) #05 pc 000754dc /system/lib/libandroid_runtime.so v2: do like other backends, call get_back_bo (Emil Velikov) Fixes: 2acc69d ("EGL/Android: Add EGL_EXT_buffer_age extension") Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* radv: make sure gs copy shader is retrieved from the cache with the variantTimothy Arceri2017-03-171-4/+9
| | | | | | | Apps can limit the size of the cache via VkAllocationCallbacks so we can't be sure that both are always in the cache. Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: fallback to an in-memory cache when no pipline cache is providedTimothy Arceri2017-03-173-6/+13
| | | | Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: always create an fallback pipeline cacheTimothy Arceri2017-03-172-0/+20
| | | | | | | This will be used as an in-memory cache when a pipeline cache is not provided by the app. Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: move cache check inside insert and search functionsTimothy Arceri2017-03-172-16/+20
| | | | | | | This will allow us to use fallback in-memory and on-disk caches should the app not provide a pipeline cache. Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* st/mesa: call glthread_destroy() before _vbo_DestroyContext()Timothy Arceri2017-03-172-2/+3
| | | | | | | | | Otherwise we have a race condition between vbo calls in the glthread and the _vbo_DestroyContext() call. This fixes a bunch of piglit crashes. Reviewed-by: Marek Olšák <[email protected]>
* anv/GetQueryPoolResults: Actually implement the specJason Ekstrand2017-03-161-16/+36
| | | | | | | | | | | | | | The Vulkan spec is fairly clear about when we should and should not write query pool results. We're also supposed to return VK_NOT_READY if VK_QUERY_RESULT_PARTIAL_BIT is not set and we come across any queries which are not yet finished. This fixes rendering corruptions on The Talos Principle where geometry flickers in and out due to bogus query results being returned by the driver. These issues are most noticable on Sky Lake GT4 2hen running on "ultra" settings. Reviewed-By: Lionel Landwerlin <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100182 Cc: "17.0 13.0" <[email protected]>
* anv/query: Invalidate the correct rangeJason Ekstrand2017-03-161-2/+6
| | | | | Reviewed-By: Lionel Landwerlin <[email protected]> Cc: "17.0 13.0" <[email protected]>
* anv/query: Fix the location of timestamp availabilityJason Ekstrand2017-03-161-1/+1
| | | | | Reviewed-By: Lionel Landwerlin <[email protected]> Cc: "17.0 13.0" <[email protected]>
* genxml: Add XML version tagsJason Ekstrand2017-03-168-0/+8
| | | | | | | There's not much point to having them or not having them but this reduces some pointless diff from the version we can auto-generate Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Use fprintf for output.Kenneth Graunke2017-03-161-69/+73
| | | | | | | This will make it easier to choose an output file. For now, it remains stdout. Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Reuse decode_structure code for handling commandsKenneth Graunke2017-03-161-23/+16
| | | | | | | | | | | The code for decoding structures and commands was almost identical. The only differences are: we print dword headers for commands, and we skip the first one (with the command opcode and lengths). So, generalize decode_structure to add a starting DWord, and a flag for printing the DWord headers, and reuse it. Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Delete redundant NULL check.Kenneth Graunke2017-03-161-10/+3
| | | | | | | | | handle_struct_decode() is just a wrapper around decode_structure() with a NULL check. But the only caller already does that NULL check. So, just use decode_structure() directly. Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Fix indentation.Kenneth Graunke2017-03-161-7/+6
| | | | | | Three space, not four. Reviewed-by: Lionel Landwerlin <[email protected]>
* i965/gen8+: Do full stall when switching pipelineTopi Pohjolainen2017-03-161-1/+2
| | | | | | | | | just as earlier gens do. CC: "17.0 13.0" <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96743 Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
* i965: remove uneeded asm/unistd.h includeJonathan Gray2017-03-161-1/+0
| | | | | | | Fix the build on OpenBSD by removing an uneeded include for asm/unistd.h. Signed-off-by: Jonathan Gray <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* i965: automake: remove spurious white spaceEmil Velikov2017-03-161-1/+0
| | | | | | Unintentionally introduced by yours truly with the i965 compiler move. Signed-off-by: Emil Velikov <[email protected]>
* i965: avoid using a GNU make pattern ruleJonathan Gray2017-03-161-4/+4
| | | | | | | | | % pattern rules are a GNU extension. As there is only one file here avoid patterns and globbing entirely to fix the build on non-GNU make. Signed-off-by: Jonathan Gray <[email protected]> v2 [Emil Velikov: brw_oa.py dependency] Signed-off-by: Emil Velikov <[email protected]>
* mapi: remove Xlib/xcb include in gl_marshal.pyEmil Velikov2017-03-161-3/+1
| | | | | | | | | | | | | | | | The only use of the header is to provide the _X_INLINE macro. We already require (and provide where needed) 'inline', plus it's used in the file already. So replace the macro and drop the include. This fixes the build on platforms which lack the header - from X-less Linuxes to Androids. Fixes: 05dd4a1104e ("glapi: Generate GL API marshalling code from the XML.") Reported-by: Vinson Lee <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100223 Signed-off-by: Emil Velikov <[email protected]>
* anv: improve error reporting when creating pipelinesIago Toral Quiroga2017-03-162-2/+4
| | | | | | | Specifically, report 'out of memory' errors that might have happened while emitting the pipeline's batch. Reviewed-by: Topi Pohjolainen <[email protected]>
* anv: handle errors in emit_binding_table() and emit_samplers()Iago Toral Quiroga2017-03-161-5/+17
| | | | | | | | | | | | | | These can fail to allocate device memory, however, the driver can recover from this error by allocating a new binding table block and trying again. v2: - Instead of tracking the errors in these functions and making callers reset the batch's status before attempting to allocate a new block for the binding table, simply make callers responsible for setting the error status if they fail to allocate memory during the second attempt (Jason). Reviewed-by: Topi Pohjolainen <[email protected]>
* anv: handle errors while allocating new binding table blocksIago Toral Quiroga2017-03-162-6/+13
| | | | | | | | | | Also, we had a couple of instances in flush_descriptor_sets() were we were returning a VkResult directly upon error, but the return value of this function is not a VkResult but a uint32_t dirty mask, so simply return 0 in these cases which reduces the amount of work the driver will do after the error has been raised. Reviewed-by: Topi Pohjolainen <[email protected]>
* anv/blorp: make anv_cmd_buffer_alloc_blorp_binding_table() return a VkResultIago Toral Quiroga2017-03-163-26/+46
| | | | | | | | | | | | Instead of asserting inside the function, and then use use that information to return early from its callers upon failure. v2: - Make sure that clear_color_attachment() and clear_depth_stencil_attachment() get the VkResult as well so they avoid executing the batch if an error happened. (Topi) Reviewed-by: Topi Pohjolainen <[email protected]>