summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* gallium: Add a pipe cap for whether primitive restart works for patches.Kenneth Graunke2016-05-2317-0/+18
| | | | | | | | | | | | | | | Some hardware supports primitive restart on patch primitives, and other hardware does not. Modern GL and ES include a query for this feature; adding a capability bit will allow us to answer it. As far as I know, AMD hardware does not support this feature, while NVIDIA and Intel hardware does. However, most Gallium drivers do not appear to support tessellation shaders yet. So, I've enabled it for nvc0 and disabled it everywhere else. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* i965/fs: Mark UBO uniform pull constant loads as force_writemask_all.Francisco Jerez2016-05-232-1/+4
| | | | | | | | | | This lets the rest of the backend know that the uniform pull constant load opcodes don't respect channel enables -- Without this the register allocator has no way to know that the return payload of a pull constant load is not per-channel and spills of the destination will be broken under non-uniform control flow. Reviewed-by: Jason Ekstrand <[email protected]>
* i965/fs: Allow spilling of non-contiguous registers.Francisco Jerez2016-05-231-19/+2
| | | | | | | This should be working fine now. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94997 Reviewed-by: Jason Ekstrand <[email protected]>
* i965/fs: Calculate the (un)spill block size correctly.Francisco Jerez2016-05-231-3/+17
| | | | | | | | | | | | | | | | | | | | | Currently the spilling code attempts to guess the scratch message block size from the dispatch width of the shader, which is plain wrong for SIMD-lowered instructions (frequently but not exclusively encountered in SIMD32 shaders) or for instructions with register region data types of size other than 32 bit. Instead try to use the SIMD component size of the instruction which in some cases will allow the dataport to apply the correct channel mask to the scratch data read or written. In the spill case the block size needs to be clamped to the number of MRF registers reserved for spilling. In the unspill case I didn't even bother because we currently have no 100% accurate way to determine whether a source region is per-channel or whether it contains things like headers that don't respect channel boundaries -- That's fine, because the unspill is marked force_writemask_all we can just use the largest allowable scratch message size. Reviewed-by: Jason Ekstrand <[email protected]>
* i965/fs: Set exec_all on spills not matching the channel layout of the ↵Francisco Jerez2016-05-231-3/+16
| | | | | | | | | | | instruction. This prevents the application of an incorrect channel mask by the scratch write instruction for spilled variables that don't have an exact one-to-one correspondence between channels of the variable and 32-bit components of the scratch write instruction. Reviewed-by: Jason Ekstrand <[email protected]>
* i965/fs: Set exec_all on unspills.Francisco Jerez2016-05-231-2/+10
| | | | | | | | | | This makes sure that unspills restore the exact contents of the variable in scratch space into the GRF without applying channel masking, which is incorrect under control flow for things like message headers or vectors of heterogeneous types that don't properly respect channel boundaries. Reviewed-by: Jason Ekstrand <[email protected]>
* i965/fs: Move scratch block size calculation into the caller of emit_(un)spill.Francisco Jerez2016-05-231-21/+23
| | | | | | | | | | | | | This makes emit_(un)spill even more stupid by removing the logic that decides what execution size each scratch read or write send message should have and instead relying on the caller to specify an appropriate execution size via the builder argument. This makes sense because the caller will need to act differently based on the scratch message width (e.g. emit an additional unspill before the instruction if the execution width and channel layout of the spill doesn't match the instruction's). Reviewed-by: Jason Ekstrand <[email protected]>
* i965/fs: Make emit_spill/unspill static functions taking builder as argument.Francisco Jerez2016-05-232-24/+21
| | | | | | | | | This seems cleaner than exposing an implementation detail of brw_fs_reg_allocate.cpp to the world, and will give the caller control over the instruction execution flags (e.g. force_writemask_all) that are applied to the scratch read and write instructions. Reviewed-by: Jason Ekstrand <[email protected]>
* i965/fs: Apply execution controls from the instruction to scratch messages.Francisco Jerez2016-05-231-6/+5
| | | | | | | | | | | | | Until now the execution controls (e.g. channel group, force_writemask_all, exec_size) of the instruction had been completely ignored by spilling, even though that can lead to a mismatch between the channel mask applied to the contents of the (un)spilled memory and the GRF source or destination of the instruction. In some cases we'll actually want the (un)spill messages to be marked force_writemask_all regardless of whether the instruction has it set, but that will have to be handled specially by the caller. Reviewed-by: Jason Ekstrand <[email protected]>
* i965/fs: Fix signedness of local variables and arguments of emit_(un)spill.Francisco Jerez2016-05-232-8/+8
| | | | | | | To avoid some some spurious warnings about comparison signedness in the following commits. Reviewed-by: Jason Ekstrand <[email protected]>
* i965/fs: Factor out calculation of the block of MRFs reserved for spilling.Francisco Jerez2016-05-231-9/+45
| | | | | | | And as we're at it fix the calculation to allocate a larger block of registers for 32-wide dispatch. Reviewed-by: Jason Ekstrand <[email protected]>
* egl: Add OpenGL_ES to API string regardless of GLES versionPlamena Manolova2016-05-231-7/+4
| | | | | | | | | | | | | | | | | According to the EGL specifications eglQueryString(EGL_CLIENT_APIS) should return a string containing a combination of "OpenGL", "OpenGL_ES" and "OpenVG", any other values would be considered invalid. Due to this when the API string is constructed, the version of GLES should be disregarded and "OpenGL_ES" should be attached once instead of "OpenGL_ES2" and "OpenGL_ES3". Fixes: dEQP-EGL.functional.negative_api* and dEQP-EGL.functional.query_context.simple.query_api Signed-off-by: Plamena Manolova <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ben Widawsky <[email protected]>
* freedreno/ir3: disable cp for indirect src'sRob Clark2016-05-231-0/+9
| | | | | | | | | | | | The variable-indexing tests always had a few random fails, which I usually couldn't reproduce when running tests manually. Somehow recently this got a lot worse. I ported a couple of the shaders to GLES to see what blob does, and it also seems to be avoiding to cp indirect srcs. So I guess indirect w/ instructions other than cat1 (mov) are not totally reliable. Let's just switch that off until this is better understood. Signed-off-by: Rob Clark <[email protected]>
* nvc0: do not invalidate compute constbufs on KeplerSamuel Pitoiset2016-05-231-4/+6
| | | | | | | | Constbufs are only aliased on Fermi and this will reduce the number of flushes when we switch between 3d and compute. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* nir/validate: fix null deref coverity warningRob Clark2016-05-231-0/+1
| | | | | | | | CID 1265536 (#1 of 2): Explicit null dereferenced (FORWARD_NULL)6. var_deref_op: Dereferencing null pointer parent. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: dri: Add shared glapi to LIBADD on AndroidNicolas Boichat2016-05-231-0/+8
| | | | | | | | | | | | | | | | | | | | /system/vendor/lib/dri/*_dri.so actually depend on libglapi: without this, loading the so file fails with: cannot locate symbol "__emutls_v._glapi_tls_Context" On non-Android (non-bionic) platform, EGL uses the following workflow, which works fine: dlopen("libglapi.so", RTLD_LAZY | RTLD_GLOBAL); dlopen("dri/<driver>_dri.so", RTLD_NOW | RTLD_GLOBAL); However, bionic does not respect the RTLD_GLOBAL flag, and the dri library cannot find symbols in libglapi.so, so we need to link to libglapi.so explicitly. Android.mk already does this. Signed-off-by: Nicolas Boichat <[email protected]> Reviewed-by: Emil Velikov <[email protected]> [Emil Velikov: s/explicitely/explicitly/] Signed-off-by: Emil Velikov <[email protected]>
* configure.ac: Add support for Android buildsNicolas Boichat2016-05-231-0/+5
| | | | | | | | | | | | | Add support for EGL android platform. Also, detect when --host finishes with -android. In that case, we do not set _GNU_SOURCE, and define autoconf symbol HAVE_ANDROID, so that Android-specific workarounds can be applied. Signed-off-by: Nicolas Boichat <[email protected]> Reviewed-by: Emil Velikov <[email protected]> [Emil Velikov: Rebase on top of HAVE_EGL_PLATFORM_NULL removal] Signed-off-by: Emil Velikov <[email protected]>
* anv: remove define _DEFAULT_SOURCEEmil Velikov2016-05-233-6/+0
| | | | | | | The build systems already add this as applicable. There's no need to have this in the source file. Signed-off-by: Emil Velikov <[email protected]>
* gbm: remove define _DEFAULT_SOURCEEmil Velikov2016-05-231-2/+0
| | | | | | | The build systems already add this as applicable. There's no need to have this in the source file. Signed-off-by: Emil Velikov <[email protected]>
* gbm: remove define _BSD_SOURCEEmil Velikov2016-05-231-1/+0
| | | | | | | The build systems already add this as applicable. There's no need to have this in the source file. Signed-off-by: Emil Velikov <[email protected]>
* glxcmds: glXGetFBConfigs, fix screen boundsJiri Slaby2016-05-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bounds of screen are 0 (inclusive) and ScreenCount(dpy) (exclusive). The upper bound was too ScreenCount(dpy) (inclusive). This causes a crash invoked by java3d which passes down an invalid screen: 6 0x00007f0e5198ba70 in <signal handler called> () at /lib64/libc.so.6 7 0x00007f0e14531e14 in glXGetFBConfigs (dpy=<optimized out>, screen=1, nelements=nelements@entry=0x7f0dab3c522c) at glxcmds.c:1660 8 0x00007f0e14532f7f in glXChooseFBConfig (dpy=<optimized out>, screen=<optimized out>, attribList=0x7f0dab3c54e0, nitems=0x7f0dab3c535c) at glxcmds.c:1611 9 0x00007f0e1478d29b in find_S_FBConfigs () at /usr/lib64/libj3dcore-ogl.so 10 0x00007f0e1478d3dc in find_S_S_FBConfigs () at /usr/lib64/libj3dcore-ogl.so 11 0x00007f0e1478d567 in find_AA_S_S_FBConfigs () at /usr/lib64/libj3dcore-ogl.so 12 0x00007f0e1478d728 in find_DB_AA_S_S_FBConfigs () at /usr/lib64/libj3dcore-ogl.so 13 0x00007f0e1478d97c in Java_javax_media_j3d_X11NativeConfigTemplate3D_chooseOglVisual () at /usr/lib64/libj3dcore-ogl.so While ScreenCount(dpy) is actually 1: (gdb) p dpy->nscreens $2 = 1 screen=1 is passed to glXGetFBConfigs. Fix this typo in glXGetFBConfigs. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95456 Signed-off-by: Jiri Slaby <[email protected]> Cc: <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: add missing link against $(CLOCK_LIB)Emil Velikov2016-05-231-1/+1
| | | | | | | | | | | | Some platforms require separate library in order to resolve the clock_gettime() symbol. Add the link or the build will fail. Fixes: 70299474f58 ("egl: add EGL_KHR_reusable_sync to egl_dri") Cc: Dongwon Kim <[email protected]> Reported-by: Pali Rohár <[email protected]> Tested-by: Pali Rohár <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* egl: android: remove explicit glFlush callEmil Velikov2016-05-231-6/+0
| | | | | | | The DRI flush extension should already do the same thing. Signed-off-by: Emil Velikov <[email protected]> Tested-by: Rob Herring <[email protected]>
* egl: android: drop dri2_create_image_android_native_buffer argumentEmil Velikov2016-05-231-2/+2
| | | | | | | The drv is no longer used/needed as of last commit. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Rob Herring <[email protected]>
* egl: android: directly use dri2_create_image_dma_buf()Emil Velikov2016-05-233-3/+6
| | | | | | | | Make the function non static so that we can use it directly from the android platform code. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Rob Herring <[email protected]>
* vl/drm: don't call close(-1) in vl_drm_screen_create error pathEmil Velikov2016-05-231-4/+5
| | | | | | | Analogous to previous commits. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Leo Liu <[email protected]>
* st/xa: don't call close(-1) in xa_tracker_create error pathEmil Velikov2016-05-231-3/+3
| | | | | | | Analogous to previous commit. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Leo Liu <[email protected]>
* st/dri: don't call close(-1) in dri{2, kms_}_init_screen error pathEmil Velikov2016-05-231-10/+20
| | | | | | | Add separate labels and jump to the correct one as needed. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Leo Liu <[email protected]>
* vk/intel: use negative VK_NO_PROTOTYPES schemeEric Engestrom2016-05-231-1/+0
| | | | | | | | | | 3d0fac7aca237bbe8ed8e2a362d3b42d0ef8c46c changed all VK_PROTOTYPES to VK_NO_PROTOTYPES This brings the Intel header in line with the rest of the Vulkan code. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* gbm: Add map/unmap functionsRob Herring2016-05-237-2/+165
| | | | | | | | | | | | | | | This adds map and unmap functions to GBM utilizing the DRIimage extension mapImage/unmapImage functions or existing internal mapping for dumb buffers. Unlike prior attempts, this version provides a region to map and usage flags for the mapping. The operation follows the same semantics as the gallium transfer_map() function. This was tested with GBM based gralloc on Android. Signed-off-by: Rob Herring <[email protected]> [Emil Velikov: drop no longer relevant hunk from commit message.] Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* gbm: rename gbm_dri_bo_{map,unmap} to gbm_dri_bo_{map,unmap}_dumbRob Herring2016-05-233-8/+8
| | | | | | | | | In preparation to add public map/unmap functions, rename the existing gbm_dri_bo_{map,unmap} functions to indicate that they are only for dumb buffers. Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* st/dri: Add support for DRIimage extension mapImage/unmapImageRob Herring2016-05-231-1/+42
| | | | | | | | | | Implement support for mapImage/unmapImage functions in version 12 of the DRIimage extension. Signed-off-by: Rob Herring <[email protected]> [Emil Velikov: align/indent the map/unmap vfuncs] Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* gbm: Add Android build supportRob Herring2016-05-231-0/+44
| | | | | | | | In order to use libgbm for gralloc, add it to the Android build. Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* gbm: add Android gallium_dri.so library loading supportRob Herring2016-05-231-0/+9
| | | | | | | | | GBM needs the same special gallium_dri.so loading as EGL for Android, so copy over the same hunk from the EGL code. Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* gbm: split out source file to Makefile.sourcesRob Herring2016-05-232-8/+15
| | | | | | | | | | | In preparation to add Android build support, split out the source file lists to Makefile.sources Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Eric Anholt <[email protected]> [Emil Velikov: Whitespace cleanup.] Signed-off-by: Emil Velikov <[email protected]>
* Android: Move setting DEFAULT_DRIVER_DIR to shared locationRob Herring2016-05-231-7/+0
| | | | | | | | | Move the defining of DEFAULT_DRIVER_DIR path to a common location so both EGL and GBM can use it. Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glsl/linker: dvec3/dvec4 consume twice input vertex attributesJuan A. Suarez Romero2016-05-231-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From the GL 4.5 core spec, section 11.1.1 (Vertex Attributes): "A program with more than the value of MAX_VERTEX_ATTRIBS active attribute variables may fail to link, unless device-dependent optimizations are able to make the program fit within available hardware resources. For the purposes of this test, attribute variables of the type dvec3, dvec4, dmat2x3, dmat2x4, dmat3, dmat3x4, dmat4x3, and dmat4 may count as consuming twice as many attributes as equivalent single-precision types. While these types use the same number of generic attributes as their single-precision equivalents, implementations are permitted to consume two single-precision vectors of internal storage for each three- or four-component double-precision vector." This commits makes dvec3, dvec4, dmat2x3, dmat2x4, dmat3, dmat3x4, dmat4x3 and dmat4 consume twice as many attributes as equivalent single-precision types. v3: count doubles as consuming two attributes (Dave Airlie) v4: make reference to spec (Michael Schellenberger Costa) Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Signed-off-by: Antia Puentes <[email protected]> Signed-off-by: Juan A. Suarez Romero <[email protected]>
* i965/fs: do not depend on std140 alignment rules for UBO loadsFrancisco Jerez2016-05-231-46/+13
| | | | | | | | | | | | The previous implementation relied on the std140 alignment rules to avoid handling misalignment in the case where we are loading more than 2 double components from a vector, which requires to emit a second load message. This alternative implementation deals with misalignment and is more flexible going forward. Reviewed-by: Iago Toral Quiroga <[email protected]>
* nir: handle double-precision in fsign, fsat, fnot and frcpIago Toral Quiroga2016-05-231-4/+9
| | | | | | | | I think these are not strictly necessary since the floats in them should be automatically promoted to doubles when operated with double sources, but it makes things more explicit at least. Reviewed-by: Matt Turner <[email protected]>
* nir: handle double-precision in fabs, frsq and fsqrtIago Toral Quiroga2016-05-231-3/+3
| | | | Reviewed-by: Matt Turner <[email protected]>
* glsl/parser: handle multiple layout sections with AST nodes.Dave Airlie2016-05-231-0/+2
| | | | | | | | | | | | | For geometry/compute inputs and tess control outputs, we create an AST node to keep track of some things. However if we have multiple layout sections, we don't ever link the node into the AST. This is because we create the node on the rightmost layout declaration and don't pass it back in so it gets linked at the end of the parsing of the rightmost. Reviewed-by: Timothy Arceri <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* glsl: allow layout qualifier overrides with ARB_shading_language_420packDave Airlie2016-05-231-1/+6
| | | | | | | | | | GLSL 4.20 allows overriding the layout qualifiers. This helps fix: GL45-CTS.shading_language_420pack.qualifier_override_layout Reviewed-by: Timothy Arceri <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* subroutines: handle explicit indexes properlyDave Airlie2016-05-235-19/+43
| | | | | | | | | | | | | | The code didn't deal with explicit function indexes properly. It also handed out the indexes at link time, when we really need them in the lowering pass to create the correct if ladder. So this patch moves assigning the non-explicit indexes earlier, fixes the lowering pass and the lookups to get the correct values. This fixes a few of: GL45-CTS.explicit_uniform_location.subroutine-index-* Signed-off-by: Dave Airlie <[email protected]>
* mesa/subroutines: fix reset on bindpipelineDave Airlie2016-05-232-1/+7
| | | | | | | | Fixes: GL45-CTS.shader_subroutine.subroutine_uniform_reset Reviewed-by: Chris Forbes <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa/subroutines: count number subroutines properly.Dave Airlie2016-05-233-2/+4
| | | | | | | | | | | | | The code was implementing the ACTIVE_SUBROUTINE_UNIFORMS incorrectly, using the number of types not the number of uniforms. This is different than the locations as the locations may be sparsly allocated. This fixes: GL43-CTS.shader_subroutine.four_subroutines_with_two_uniforms Reviewed-by: Chris Forbes <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa/subroutines: don't generate error in GetSubroutineIndex.Dave Airlie2016-05-231-1/+0
| | | | | | | | | | GLSL spec says this doesn't generate an error. Fixes: GL45-CTS.explicit_uniform_location.subroutine-loc Reviewed-by: Chris Forbes <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* glsl/ast: for geom shaders allow stream flags in input flags.Dave Airlie2016-05-231-1/+4
| | | | | | | | | | | This fixes: GL45-CTS.shader_subroutine.subroutines_with_separate_shader_objects Since we set the stream flags earlier on all geom shaders, we shouldn't fall over later if we find one. Reviewed-by: Chris Forbes <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* glsl/linker: skip inactive explicit locations.Dave Airlie2016-05-231-0/+3
| | | | | | | | This fixes a crash in: GL45-CTS.explicit_uniform_location.subroutine-loc-negative-link-max-num-of-locations Reviewed-by: Chris Forbes <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* glsl: fix subroutine uniform .length().Dave Airlie2016-05-231-0/+8
| | | | | | | | | | | | | This fixes .length() on subroutine uniform arrays, if we don't find the identifier normally, we look up the corresponding subroutine identifier instead. Fixes: GL45-CTS.shader_subroutine.arrays_of_arrays_of_uniforms GL45-CTS.shader_subroutine.arrayed_subroutine_uniforms Reviewed-by: Chris Forbes <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* glsl/linker: link error on too many subroutine functions.Dave Airlie2016-05-231-0/+4
| | | | | | | | This fixes: GL45-CTS.explicit_uniform_location.subroutine-index-negative-link-max-num-of-indices Reviewed-by: Chris Forbes <[email protected]> Signed-off-by: Dave Airlie <[email protected]>