summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* egl: Wrap dri3 surface primitive around dri2 egl surfaceYogesh Marathe2017-09-192-11/+11
| | | | | | | | | | | | | | | | Originally dri3 egl surface was wrapped around _EGLSurface. With next commit we'll add additional attributes, which will be checked from generic code. Thus in order to access that we need to use dri2_egl_surface. The name of the latter is a misnomer - it should really be dri or dri_common... Signed-off-by: Yogesh Marathe <[email protected]> [Emil Velikov: commit message, squash the patches appropriately, add relevant _eglInitSurface hunk to prevent build breakage] Signed-off-by: Emil Velikov <[email protected]>
* radv: replace conditional compilation with MAYBE_UNUSEDEric Engestrom2017-09-191-3/+2
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* glsl: replace conditional compilation with MAYBE_UNUSEDEric Engestrom2017-09-191-3/+2
| | | | | | Suggested-by: Nicolai Hähnle <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* broadcom/vc4: Fix use-after-free when deleting a program.Eric Anholt2017-09-181-6/+15
| | | | | | | | | | | By leaving the compiled shader in the context's stage state, the next compile of a new FS would look in the old compiled FS for figuring out whether to set various dirty flags for the VS compile. Clear out the pointer when deleting the program, and make sure that we always mark the state as dirty if the previous program had been lost. Fixes valgrind warnings on glsl-max-varyings. Fixes: 2350569a78c6 ("vc4: Avoid VS shader recompiles by keeping a set of FS inputs seen so far.")
* i965: Fix batch map failure check in INTEL_DEBUG=bat handling.Kenneth Graunke2017-09-181-1/+1
| | | | | | | | | | I originally wrote the code to call the maps 'batch' and 'state', until I remembered that 'batch' is the intel_batchbuffer struct pointer. The NULL check was still using the wrong variable. Caught by Coverity. CID: 1418109
* broadcom/vc4: Fix crashes since the gallium blitter reworks.Eric Anholt2017-09-181-1/+3
| | | | | Even if we're not clearing color, the blitter has started dereferencing the color value.
* broadcom/vc4: Fix use-after-free trying to mix a quad and tile clear.Eric Anholt2017-09-181-24/+32
| | | | | | | | | | | | | The blitter will bind just the depth buffer, which flushes the current job if we had both a color and depth/stencil. If the clear was doing partial depth/stencil (quad-based) and color (tile-based), we'd go on to try to set up the rest of the tile clear in the now flushed job. Instead, move the partial clear up before we start setting up the job for the current FBO state, and re-fetch the job if we're continuing on to a tile-based clear. Fixes valgrind failures in fbo-depthtex. Fixes: 9421a6065c4e ("vc4: Fix fallback to quad clears of depth in GLX.")
* broadcom/vc4: Fix use-after-free for flushing when writing to a texture.Eric Anholt2017-09-181-2/+7
| | | | | | | | I was trying to continue the hash table loop, not the inner loop. This tended to work out, because we would have *just* freed the job struct. Fixes some valgrind failures in fbo-depthtex. Fixes: f597ac396640 ("vc4: Implement job shuffling")
* ttn: Fix out-of-bounds accesses since the always-2D-constants change.Eric Anholt2017-09-181-2/+3
| | | | | | | | | | Only one of the three checks for dim was updated, so we would try to set a UBO buffer index source value on a nir_load_uniform, and wouldn't actually declare non-UBO uniforms. Fixes: 37dd8e8dee1d ("gallium: all drivers should accept two-dimensional constant buffer indexing") Tested-by: Derek Foreman <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* anv/android: Disable surface and swapchain extensions (v2)Chad Versace2017-09-181-3/+20
| | | | | | | | | | | | | Android's Vulkan loader implements VK_KHR_surface and VK_KHR_swapchain, and applications cannot access the driver's implementation. Moreoever, if the driver exposes the those extension strings, then tests dEQP-VK.api.info.instance.extensions and dEQP-VK.api.info.device fail due to the duplicated strings. v2: Replace !ANDROID with ANV_HAS_SURFACE. (for jekstrand) Reviewed-by: Tapani Pälli <[email protected]> Tested-by: Tapani Pälli <[email protected]>
* anv: Feed vk_android_native_buffer.xml to generators (v2)Chad Versace2017-09-183-6/+28
| | | | | | | | | | | | | | Feed the XML to anv_extensions.py and anv_entrypoints_gen.py. Do it on all platforms, not just Android. Tested on Android and Fedora. We always parse the Android XML, regardless of target platform, to help reduce the chance that people working on non-Android break the Android build. v2: - Squash in Tapani's changes to Android.*.mk. Reviewed-by: Tapani Pälli <[email protected]> (v1)
* anv: Teach generator scripts how to parse mutliple XML filesChad Versace2017-09-182-10/+23
| | | | | | | | | | | | | | The taught scripts are anv_extensions.py and anv_entrypoints_gen.py. To give a script multiple XML files, call it like so: anv_extensions.py --xml a.xml --xml b.xml --xml c.xml ... The scripts parse the XML files in the given order. This will allow us to feed the scripts XML files for extensions that are missing from the official vk.xml, such as VK_ANDROID_native_buffer. Reviewed-by: Tapani Pälli <[email protected]>
* vulkan/registry: Feed vk_android_native_buffer.xml to gen_enum_to_str.pyChad Versace2017-09-183-5/+33
| | | | | | Tested on Android and Fedora. Reviewed-by: Tapani Pälli <[email protected]>
* vulkan/util: Teach gen_enum_to_str.py to parse mutliple XML filesChad Versace2017-09-181-8/+11
| | | | | | | | | | | | | To give the script multiple XML files, call it like so: gen_enum_to_str.py --xml a.xml --xml b.xml --xml c.xml ... The script parses the XML files in the given order. This will allow us to feed the script XML files for extensions that are missing from the official vk.xml, such as VK_ANDROID_native_buffer. Reviewed-by: Tapani Pälli <[email protected]>
* vulkan/registry: Add VK_ANDROID_native_bufferChad Versace2017-09-182-0/+54
| | | | | | | | | | | | | | | The VK_ANDROID_native_buffer extension is missing from the official vk.xml. This patch defines the extension in a separate, minimal XML file: vk_android_native_buffer.xml. I chose to add the extension to a new XML file instead of adding it to the official vk.xml in order to avoid conflicts each time we sync the vk.xml from Khronos. This should be only a temporary solution until Jesse Hall is persuaded to add it to the official vk.xml. Reviewed-by: Tapani Pälli <[email protected]>
* i965: Use prepare_external instead of make_shareable in setTexBuffer2Jason Ekstrand2017-09-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The setTexBuffer2 hook from GLX is used to implement glxBindTexImageEXT which has tighter restrictions than just "it's shared". In particular, it says that any rendering to the image while it is bound causes the contents to become undefined. This means that we can do whatever aux tracking we want between glxBindTexImageEXT and glxReleaseTexImageEXT so long as we always transition from external in Bind and to external in Release. The fact that we were using make_shareable before was a problem because it would resolve away 100% of the aux data and then throw away our reference to the aux buffer. If the aux data was shared with some other application (i.e. if we're using I915_FORMAT_MOD_Y_TILED_CCS) then we would forget that the aux data even existed for the rest of eternity. This is fine for the first frame but any subsequent calls to glxBindTexImageEXT would bind the texture as if it has no aux whatsoever and no resolves would happen and texturing would happen as if there is no aux. This was causing rendering corruption in mutter when running on top of X11 with modifiers. Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965/tex_image: Reference the renderbuffer miptree in setTexBuffer2Jason Ekstrand2017-09-181-19/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old code made a new miptree that referenced the same BO as the renderbuffer and just trusted in the memory aliasing to work. There are only two ways in which the new miptree is liable to differ from the one in the renderbuffer and neither of them matter: 1) It may have a different target. The only targets that we can ever see in intelSetTexBuffer2 are GL_TEXTURE_2D and GL_TEXTURE_RECTANGLE and the difference between the two doesn't matter as far as the miptree is concerned; genX(update_sampler_state) only looks at the gl_texture_object and not the miptree when determining whether or not to use normalized coordinates. 2) It may have a very slightly different format. Again, this doesn't matter because we've supported texture views for quite some time so we always look at the gl_texture_object format instead of the miptree format for hardware setup anyway. On the other hand, because we were recreating the miptree, we were using intel_miptree_create_for_bo which doesn't understand modifiers. We really want this function to work without doing a resolve so long as you have modifiers so we need to fix that. Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Reset miptree aux state on update_image_bufferJason Ekstrand2017-09-183-1/+25
| | | | | | | | | | | | | When we get a miptree in through glxBindImageEXT, we don't know the current aux state so we have to assume the worst-case. If the image gets recreated, everything is fine because miptreecreate_for_dri_image sets it to the default. However, if our miptree is recycled, then we may have stale aux_usage and we need to reset to the default otherwise our aux_state tracking will get messed up. Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* intel/isl: Add a drm_modifier_get_default_aux_state helperJason Ekstrand2017-09-182-2/+21
| | | | | | Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965: Warn for GTT fallbacks when mapping the batch/state buffers.Kenneth Graunke2017-09-181-2/+2
| | | | | | | | This shouldn't really happen in practice, but I hit it a couple of times when running a driver with a bad memory leak. We may as well hook up the warning, because if it ever triggers, we'll know something is wrong. Reviewed-by: Chris Wilson <[email protected]>
* i965: Plumb brw through to intel_batchbuffer_reset().Kenneth Graunke2017-09-183-11/+11
| | | | | | We'll want to pass this to brw_bo_map in a moment. Reviewed-by: Chris Wilson <[email protected]>
* radeonsi: reallocate if a non-sharable textures is being sharedMarek Olšák2017-09-181-1/+5
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: PIPE_BIND_SHARED should allow inter-process sharingMarek Olšák2017-09-181-5/+4
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* freedreno: compile fixNicolai Hähnle2017-09-181-1/+1
| | | | | Fixes: 3f6b3d9db ("gallium: add PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE") Reported-by: Jan Vesely <[email protected]>
* clover: add missing include to compat.hJan Vesely2017-09-181-0/+1
| | | | | | | | | | Fixes build issues with llvm-3.6 Fixes: 3115687f9b9830417c408228db2bc679e346bba6 (clover: Fix build after LLVM r313390) Signed-off-by: Jan Vesely <[email protected]> Tested-by: Gert Wollny <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* clover: Query and export half precision supportJan Vesely2017-09-183-3/+18
| | | | | | | | v2: PIPE_CAP_HALFS -> PIPE_SHADER_CAP_FP16 has_halfs -> has_halves Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* gallium: Add PIPE_SHADER_CAP_FP16Jan Vesely2017-09-1816-0/+27
| | | | | | | | | Denotes native half precision float operations capability v2: PIPE_CAP_HALFS -> PIPE_SHADER_CAP_FP16 fix indentation Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* anv: Implement VK_KHR_image_format_listJason Ekstrand2017-09-182-2/+36
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Implement VK_KHR_bind_memory2Jason Ekstrand2017-09-183-17/+68
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* nvc0: fix compile errorBenedikt Schemmer2017-09-181-1/+1
| | | | | | | Fixes: 3f6b3d9db ("gallium: add PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE") Signed-off-by: Benedikt Schemmer <[email protected]> Previously-pointed-out-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: allow out-of-order rasterization in commutative blending casesNicolai Hähnle2017-09-186-4/+73
| | | | | | | | | | | | We do not enable this by default for additive blending, since it slightly breaks OpenGL invariance guarantees due to non-determinism. Still, there may be some applications can benefit from white-listing via the radeonsi_commutative_blend_add drirc setting without any real visible artifacts. Reviewed-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* radeonsi: add drirc option "radeonsi_assume_no_z_fights"Nicolai Hähnle2017-09-185-4/+13
| | | | | | | | | | | | | | This option enables a performance optimization where typical non-blending draws with depth buffer may be rasterized out-of-order (on VI+, multi-SE chips). This optimization can lead to incorrect results when an applications renders multiple objects with the same Z value at the same pixel, so we will never enable it by default. But there may be applications that could benefit from white-listing. Reviewed-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* radeonsi: enable out-of-order rasterization when possible on VI and GFX9 dGPUsNicolai Hähnle2017-09-187-6/+193
| | | | | | | | | This does not take commutative blending into account yet. R600_DEBUG=nooutoforder disables it. Reviewed-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* gallium/radeon: pass old_(perfect_)enable to set_occlusion_query_stateNicolai Hähnle2017-09-184-4/+11
| | | | | | | The callee can derive the current enable state itself. Reviewed-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* gallium: add PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVENicolai Hähnle2017-09-1824-12/+97
| | | | | | | | | | | | | | | | | To be able to properly distinguish between GL_ANY_SAMPLES_PASSED and GL_ANY_SAMPLES_PASSED_CONSERVATIVE. This patch goes through all drivers, having them treat the two query types identically, except: 1. radeon incorrectly enabled conservative mode on PIPE_QUERY_OCCLUSION_PREDICATE. We now do it correctly, only on PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE. 2. st/mesa uses the new query type. Fixes dEQP-GLES31.functional.fbo.no_attachments.* Reviewed-by: Marek Olšák <[email protected]>
* amd/common: add workaround for cube map array layer clampingNicolai Hähnle2017-09-181-2/+29
| | | | | | | Fixes dEQP-GLES31.functional.texture.filtering.cube_array.* Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]>
* amd/common: remove has_ds_bpermute argument from ac_build_ddxyNicolai Hähnle2017-09-186-11/+3
| | | | Reviewed-by: Marek Olšák <[email protected]>
* amd/common: add chip_class to ac_llvm_contextNicolai Hähnle2017-09-184-5/+13
| | | | Reviewed-by: Marek Olšák <[email protected]>
* amd/common: round cube array slice in ac_prepare_cube_coordsNicolai Hähnle2017-09-184-5/+9
| | | | | | | | | | | | The NIR-to-LLVM pass already does this; now the same fix covers radeonsi as well. Fixes various tests of dEQP-GLES31.functional.texture.filtering.cube_array.combinations.* Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radeonsi: workaround for gather4 on integer cube mapsNicolai Hähnle2017-09-181-6/+100
| | | | | | | | | | This is the same workaround that radv already applied in commit 3ece76f03dc0 ("radv/ac: gather4 cube workaround integer"). Fixes dEQP-GLES31.functional.texture.gather.basic.cube.rgba8i/ui.* Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]>
* st/glsl_to_tgsi: fix theoretical memory leakNicolai Hähnle2017-09-181-2/+5
| | | | | | | | It can't *really* happen since we don't use subroutines. CID: 1417491 Reviewed-by: Timothy Arceri <[email protected]> Reviewed-By: Gert Wollny <[email protected]>
* i965: emit BRW_NEW_AUX_STATE on aux state changesIago Toral Quiroga2017-09-181-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes a regression introduced with b96313c0e1289b296d7, which removed BRW_NEW_BLORP for a bunch of SURFACE_STATE setup code, including render targets, on the basis that blorp invalidates binding tables but not surface states, however, at least on Broadwell, this caused a regression in a CTS test, which Ken and Jason tracked down to the fact that we are not uploading new render target surface states after allocating new CCS_D surfaces for fast clears (which allocation is deferred until an actual clear occurs). The reason this only fails in BDW is that on SKL+ we use CCS_E which is allocated up front so it exists in the initial surface state, the problem can be reproduced in these platforms too if we use INTEL_DEBUG=norcb to force the CCS_D path. This patch, together with the ones preceding it, fixes the regression by ensuring that we track and flag as dirty all aux state changes. Credit goes to Jason and Ken for figuring out the reason for the regression. Fixes: KHR-GL45.transform_feedback.draw_xfb_test Reviewed-by: Jason Ekstrand <[email protected]>
* i965: emit BRW_NEW_AUX_STATE when we change the fast clear valueIago Toral Quiroga2017-09-183-11/+31
| | | | | | | v2: rename intel_miptree_set_clear_value to intel_miptree_set_clear_color (Jason) Reviewed-by: Jason Ekstrand <[email protected]>
* i965: emit BRW_NEW_AUX_STATE if we drop the aux surfaceIago Toral Quiroga2017-09-181-0/+2
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* i965: rename BRW_NEW_FAST_CLEAR_COLOR to BRW_NEW_AUX_STATEIago Toral Quiroga2017-09-188-14/+14
| | | | | | | We want to use this flag to signal changes to the aux surfaces, so let's not make it about fast clearing only. Suggested by Jason. Reviewed-by: Jason Ekstrand <[email protected]>
* gbm: Add gbm_device_get_format_modifier_plane_count to testGert Wollny2017-09-171-0/+1
| | | | | | | | | | | | | Adding gbm_device_get_format_modifier_plane_count made the test gbm-symbols-check fail, this patch adds the according function name to the test. Fixes: 8824141b8d48d9120ddbf542d6fb661046c41c62 (gbm: Add a gbm_device_get_format_modifier_plane_count function) Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Andres Gomez <[email protected]>
* radv: Add support for more DCC compression with VK_KHR_image_format_list.Bas Nieuwenhuizen2017-09-162-3/+25
| | | | Reviewed-by: Dave Airlie <[email protected]>
* radv: Add code to check if two formats can share DCC metadata.Bas Nieuwenhuizen2017-09-162-0/+87
| | | | | | Ported from radeonsi. Reviewed-by: Dave Airlie <[email protected]>
* i965: Add an INTEL_DEBUG=reemit option.Kenneth Graunke2017-09-153-1/+3
| | | | | | | | | Jason and I use this for debugging all the time. Recompiling the driver to enable it is kind of annoying. It's a great thing to try along with always_flush_batch=true and always_flush_cache=true to detect a class of problems - namely, atoms listening to an insufficient set of dirty bits. Reviewed-by: Matt Turner <[email protected]>
* clover: Fix build after LLVM r313390Jan Vesely2017-09-152-1/+11
| | | | | | | v2: pass llvm context reference instead of a pointer Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>