summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'mesa/13.0' into nougat-x86Chih-Wei Huang2017-01-0910-121/+258
|\
| * i965/fs: Reject copy propagation into SEL if not min/max.Matt Turner2016-12-242-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We shouldn't ever see a SEL with conditional mod other than GE (for max) or L (for min), but we might see one with predication and no conditional mod. total instructions in shared programs: 8241806 -> 8241902 (0.00%) instructions in affected programs: 13284 -> 13380 (0.72%) HURT: 62 total cycles in shared programs: 84165104 -> 84166244 (0.00%) cycles in affected programs: 75364 -> 76504 (1.51%) helped: 10 HURT: 34 Fixes generated code in at least Sanctum 2, Borderlands 2, Goat Simulator, XCOM: Enemy Unknown, and Shogun 2. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92234 Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (cherry picked from commit 7bed52bb5fb4cfd5f91c902a654b3452f921da17)
| * i965/fs: Add unit tests for copy propagation pass.Matt Turner2016-12-242-0/+211
| | | | | | | | | | | | | | | | | | Pretty basic, but it's a start. Acked-by: Jason Ekstrand <jason@jlekstrand.net> (cherry picked from commit 091a8a04adb28a2044e3baadba0af52a185b3bd0) [Emil Velikov: nir_shader_create() has only three arguments] Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
| * i965/fs: Rename opt_copy_propagate -> opt_copy_propagation.Matt Turner2016-12-163-15/+16
| | | | | | | | | | | | | | Matches the vec4 backend, cmod propagation, and saturate propagation. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (cherry picked from commit 6014da50ec41d1ad43fec94a625962ac3f2f10cb)
| * mesa/fbobject: Update CubeMapFace when reusing texturesNanley Chery2016-12-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Framebuffer attachments can be specified through FramebufferTexture* calls. Upon specifying a depth (or stencil) framebuffer attachment that internally reuses a texture, the cube map face of the new attachment would not be updated (defaulting to TEXTURE_CUBE_MAP_POSITIVE_X). Fix this issue by actually updating the CubeMapFace field. This bug manifested itself in BindFramebuffer calls performed on framebuffers whose stencil attachments internally reused a depth texture. When binding a framebuffer, we walk through the framebuffer's attachments and update each one's corresponding gl_renderbuffer. Since the framebuffer's depth and stencil attachments may share a gl_renderbuffer and the walk visits the stencil attachment after the depth attachment, the uninitialized CubeMapFace forced rendering to TEXTURE_CUBE_MAP_POSITIVE_X. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77662 Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com> (cherry picked from commit 63318d34acd4a5edb271d57adf3b01e2e52552f8)
| * i965/mt: Disable aux surfaces after making miptree shareableChad Versace2016-12-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The entire goal of intel_miptree_make_shareable() is to permanently disable the miptree's aux surfaces. So set intel_mipmap_tree:disable_aux_buffers after the function's done with discarding down the aux surfaces. References: https://bugs.freedesktop.org/show_bug.cgi?id=98329 Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: Nanley Chery <nanley.g.chery@intel.com Cc: Haixia Shi <hshi@chromium.org> Cc: mesa-stable@lists.freedesktop.org (cherry picked from commit 1c8be049bea786c2c054a770025976beba5b8636)
| * i965: Allocate at least some URB space even when max_vertices = 0.Kenneth Graunke2016-12-141-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allocating zero URB space is a really bad idea. The hardware has to give threads a handle to their URB space, and threads have to use that to terminate the thread. Having it be an empty region just breaks a lot of assumptions. Hence, why we asserted that it isn't possible. Unfortunately, it /is/ possible prior to Gen8, if max_vertices = 0. In theory a geometry shader could do SSBO/image access and maybe still accomplish something. In reality, this is tripped up by conformance tests. Gen8+ already avoids this problem by placing the vertex count DWord in the URB entry header. This fixes things on earlier generations. Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> Tested-by: Ian Romanick <ian.d.romanick@intel.com> (cherry picked from commit a41f5dcb141a11ca5ca0c765c305027b0f0b609e)
| * mesa: only verify that enabled arrays have backing buffersIlia Mirkin2016-12-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | We were previously also verifying that no backing buffers were available when an array wasn't enabled. This is has no basis in the spec, and it causes GLupeN64 to fail as a result. Fixes: c2e146f487 ("mesa: error out in indirect draw when vertex bindings mismatch") Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com> (cherry picked from commit 7c16552f8dcc869b14cf7ef443a1b5de83b07973)
| * mesa: fix active subroutine uniforms properlyTimothy Arceri2016-12-141-103/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 07fe2d565b introduced a big hack in order to return NumSubroutineUniforms when querying ACTIVE_RESOURCES for <shader>_SUBROUTINE_UNIFORM interfaces. However this is the wrong fix we are meant to be returning the number of active resources i.e. the count of subroutine uniforms in the resource list which is what the code was previously doing, anything else will cause trouble when trying to retrieve the resource properties based on the ACTIVE_RESOURCES count. The real problem is that NumSubroutineUniforms was counting array elements as separate uniforms but the innermost array is always considered a single uniform so we fix that count instead which was counted incorrectly in 7fa0250f9. Idealy we could probably completely remove NumSubroutineUniforms and just compute its value when needed from the resource list but this works for now. Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Cc: 13.0 <mesa-stable@lists.freedesktop.org> (cherry picked from commit 0303201dfb73c16751d5519cca7480fa678d429a) [Emil Velikov: LinkStatus is in gl_shader_program] Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Conflicts: src/mesa/main/program_resource.c
* | Merge remote-tracking branch 'mesa/13.0' into nougat-x86Chih-Wei Huang2016-11-259-69/+41
|\ \ | |/
| * i965/hsw: Set integer mode in sampling state for stencil texturingJordan Justen2016-11-242-18/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: ES31-CTS.functional.texture.border_clamp.formats.depth24_stencil8_sample_stencil.nearest_size_pot ES31-CTS.functional.texture.border_clamp.formats.depth24_stencil8_sample_stencil.nearest_size_npot ES31-CTS.functional.texture.border_clamp.formats.depth32f_stencil8_sample_stencil.nearest_size_pot ES31-CTS.functional.texture.border_clamp.formats.depth32f_stencil8_sample_stencil.nearest_size_npot ES31-CTS.functional.texture.border_clamp.unused_channels.depth24_stencil8_sample_stencil ES31-CTS.functional.texture.border_clamp.unused_channels.depth32f_stencil8_sample_stencil Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (cherry picked from commit 44c5ed02d1b173c061c3188e245d384fd4c0abba)
| * i965: Fix GS push inputs with enhanced layouts.Kenneth Graunke2016-11-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | We weren't taking first_component into account when handling GS push inputs. We hardly ever push GS inputs, so this was not caught by existing tests. When I started using component qualifiers for the gl_ClipDistance arrays, glsl-1.50-transform-feedback-type-and-size started catching this. Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (cherry picked from commit c4be6e0b8d91746eccf334b9e20861af4036d06a)
| * mesa: fix empty program log lengthTapani Pälli2016-11-242-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case we have empty log (""), we should return 0. This fixes Khronos WebGL conformance test 'program-infolog'. From OpenGL ES 3.1 (and OpenGL 4.5 Core) spec: "If pname is INFO_LOG_LENGTH , the length of the info log, including a null terminator, is returned. If there is no info log, zero is returned." v2: apply same fix for get_shaderiv and _mesa_GetProgramPipelineiv (Ian) Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> (v1) Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97321 Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit ec4e71f75e9b8a1c427994efa32a61593e3172f9)
| * mesa: Drop PATH_MAX usage.Kenneth Graunke2016-11-242-34/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GNU/Hurd does not define PATH_MAX since it doesn't have such arbitrary limitation, so this failed to compile. Apparently glibc does not enforce PATH_MAX restrictions anyway, so it's kind of a hoax: https://www.gnu.org/software/libc/manual/html_node/Limits-for-Files.html MSVC uses a different name (_MAX_PATH) as well, which is annoying. We don't really need it. We can simply asprintf() the filenames. If the filename exceeds an OS path limit, presumably fopen() will fail, and we already check that. (We actually use ralloc_asprintf because Mesa provides that everywhere, and it doesn't look like we've provided an implementation of GNU's asprintf() for all platforms.) Fixes the build on GNU/Hurd. Cc: "13.0" <mesa-stable@lists.freedesktop.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98632 Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> (cherry picked from commit 9bfee7047b70cb0aa026ca9536465762f96cb2b1) [Emil Velikov: s|prog->Id|base->Id|] Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Conflicts: src/mesa/main/arbprogram.c
| * i965: Fix compute shader crash.Kenneth Graunke2016-11-241-1/+1
| | | | | | | | | | | | | | | | | | Fixes crashes when starting Deus Ex: Mankind Divided. Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> (cherry picked from commit ca76e6b5213c92432b9f3a641cb26f5861d53e09)
| * Fix races during _mesa_HashWalk().Steinar H. Gunderson2016-11-241-11/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is currently no protection against walking a hash (using _mesa_HashWalk()) and modifying it at the same time, for instance by inserting or deleting elements. This leads to segfaults in multithreaded code if e.g. someone calls glTexImage2D (which may have to walk the list of FBOs) while another thread is calling glDeleteFramebuffers on another thread with the two contexts sharing lists. The reason for this is that _mesa_HashWalk() doesn't actually take the mutex that normally protects the hash; it takes an entirely different mutex. Thus, walks are only protected against other walks, and there is also no outer lock taking this. There is an old comment saying that this is to fix problems with deadlock if the callback needs to take a mutex; we solve this by changing the mutex to be recursive. A demonstration Helgrind hit from a real application: ==13412== Possible data race during write of size 8 at 0x3498C6A8 by thread #1 ==13412== Locks held: 2, at addresses 0x1AF09530 0x2B3DF400 ==13412== at 0x1F040C99: _mesa_hash_table_remove (hash_table.c:395) ==13412== by 0x1EE98174: _mesa_HashRemove_unlocked (hash.c:350) ==13412== by 0x1EE98174: _mesa_HashRemove (hash.c:365) ==13412== by 0x1EE2372D: _mesa_DeleteFramebuffers (fbobject.c:2669) ==13412== by 0x6105AA4: movit::ResourcePool::cleanup_unlinked_fbos(void*) (resource_pool.cpp:473) ==13412== by 0x610615B: movit::ResourcePool::release_fbo(unsigned int) (resource_pool.cpp:442) [...] ==13412== This conflicts with a previous read of size 8 by thread #20 ==13412== Locks held: 2, at addresses 0x1AF09558 0x1AF73318 ==13412== at 0x1F040CD9: _mesa_hash_table_next_entry (hash_table.c:415) ==13412== by 0x1EE982A8: _mesa_HashWalk (hash.c:426) ==13412== by 0x1EED6DFD: _mesa_update_fbo_texture.part.33 (teximage.c:2683) ==13412== by 0x1EED9410: _mesa_update_fbo_texture (teximage.c:3043) ==13412== by 0x1EED9410: teximage (teximage.c:3073) ==13412== by 0x1EEDA28F: _mesa_TexImage2D (teximage.c:3105) ==13412== by 0x166A68: operator() (mixer.cpp:454) There are many more interactions than just these two possible. Cc: 11.2 12.0 13.0 <mesa-stable@lists.freedesktop.org> Signed-off-by: Steinar H. Gunderson <steinar+mesa@gunderson.no> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com> (cherry picked from commit 2e2562cabbe9a1d3fb997ccaccc20ba31b2006c3)
| * i965/gs: Allow primitive id to be a system valueJason Ekstrand2016-11-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows for gl_PrimitiveId to come in as a system value rather than as an input. This is the way it will come in from SPIR-V. We keeps the input path working for now so we don't break GL. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit a5e88e66e633aaeb587b274d80e21cd46c8ee2cb) [Emil Velikov: nir_shader::info is not a pointer in branch] Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Conflicts: src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
* | android: re-generate git_sha1.h if ORIG_HEAD updatedChih-Wei Huang2016-11-221-1/+1
| | | | | | | | | | | | | | The git HEAD may not be updated if we are on a named branch. Use ORIG_HEAD instead. Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
* | Revert "Add the RGBA8888 and RGBX8888 back to Intel screen config"Chih-Wei Huang2016-11-221-2/+0
| | | | | | | | | | This reverts commit bc29cb5b656423a1212bada7d626df412c55959b since it breaks HDMI display.
* | Merge remote-tracking branch 'mesa/13.0' into nougat-x86Chih-Wei Huang2016-11-169-39/+52
|\ \ | |/
| * i965: Fix GPU hang related to multiple render targets and alpha testingAnuj Phogat2016-11-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch should have been the part of commit e592f7df. In a situation when there are multiple render targets with alpha testing enabled, if fragment shader doesn't write to draw buffer zero, it causes the GPU hang on SKL. No GPU hang is seen on HSW. Simulator gives a warning for all gen6+ h/w: "Illegal render target write message length 0xa expected 0xc" This patch fixes the GPU hang as well as the simulator warning with new piglit test fbo-mrt-alphatest-no-buffer-zero-write: https://patchwork.freedesktop.org/patch/118212 No regressions in Jenkins CI system. Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Ben Widawsky <ben@bwidawsk.net> (cherry picked from commit b9df2251c17e3ce52fa55c81f492591e08c3ee04)
| * st/mesa: fix the layer of VDPAU surface samplersNicolai Hähnle2016-11-093-17/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A (latent) bug in VDPAU interop was exposed by commit e5cc84dd43be066c1dd418e32f5ad258e31a150a. Before that commit, the st_vdpau code created samplers with first_layer == last_layer == 1 that the general texture handling code would immediately delete and re-create, because the layer does not match the information in the GL texture object. This was correct behavior at least in the DMABUF case, because the imported resource is supposed to have the correct offset already applied. In the non-DMABUF case, this was just plain wrong but apparently nobody noticed. After that commit, the state tracker assumes that an existing sampler is correct at all times. Existing samplers are supposed to be deleted when they may become invalid, and they will be created on-demand. This meant that the sampler with first_layer == last_layer == 1 stuck around, leading to rendering artefacts (on radeonsi), command stream failures (on r600), and assertions (in debug builds everywhere). This patch fixes the problem by simply not creating a sampler at all in st_vdpau_map_surface. We rely on the generic texture code to do the right thing, adding the layer_override to make the non-DMABUF case work. v2: add the layer_override Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98512 Cc: 13.0 <mesa-stable@lists.freedesktop.org> Cc: Christian König <deathsimple@vodafone.de> Cc: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1) Reviewed-by: Christian König <christian.koenig@amd.com> (cherry picked from commit 322483f71b068b3bbf69e5434e888f3fd3f4589e)
| * st/glsl_to_tgsi: fix dvec[34] loads from SSBONicolai Hähnle2016-11-091-6/+4
| | | | | | | | | | | | | | | | | | | | | | When splitting up loads, we have to add 16 bytes to the offset for the high components, just like already happens for stores. Fixes arb_gpu_shader_fp64@shader_storage@layout-std140-fp64-shader. Cc: 13.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com> (cherry picked from commit e4b378800eff13752dcfe1f5c6b640444208d543)
| * mesa/glsl: delete previously linked shaders earlier when linkingTimothy Arceri2016-11-093-15/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves the delete linked shaders call to _mesa_clear_shader_program_data() which makes sure we delete them before returning due to any validation problems. It also reduces some code duplication. From the OpenGL 4.5 Core spec: "If LinkProgram failed, any information about a previous link of that program object is lost. Thus, a failed link does not restore the old state of program. ... If one of these commands is called with a program for which LinkProgram failed, no error is generated unless otherwise noted. Implementations may return information on variables and interface blocks that would have been active had the program been linked successfully. In cases where the link failed because the program required too many resources, these commands may help applications determine why limits were exceeded." Therefore it's expected that we shouldn't be able to query the program that failed to link and retrieve information about a previously successful link. Before this change the linker was doing validation before freeing the previously linked shaders and therefore could exit on failure before they were freed. This change also fixes an issue in compat profile where a program with no shaders attached is expect to fall back to fixed function but was instead trying to relink IR from a previous link. Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97715 Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit d2861d682a235993844989f7742c9539c3e10245)
| * intel/blorp: Pass a brw_stage_prog_data to upload_shaderJason Ekstrand2016-11-091-1/+2
| | | | | | | | | | | | | | | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98012 Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 4306c10a885bdd833328a2a4eeb0079aa4f4bae3)
* | HACK: i915: enable image external samplingMauro Rossi2016-11-011-0/+1
| | | | | | | | | | | | | | | | | | This hack is the alternative way of enabling GL_OES_EGL_image_external as opposed to defining mesa environment variable in init.rc As a reference this hack works on i915 also because of commit "android: a workaround for GL_INVALID_OPERATION (0x502) error" which allows for external image being mapped despited not being dma-buf
* | i915: add mock implementation of GL_OES_EGL_image_external (v2)Mauro Rossi2016-11-015-0/+6
| | | | | | | | | | | | | | | | | | | | | | This is similar to commit 7420c9dab4aaf87e6b840410226c296c4668a48f but for the i915 driver, as neeeded in android-x86. In version v2, as per i965 implementation, the extension GL_OES_EGL_image_external is not enabled by default. The by-the-book way to enable the extension is mesa environment variable MESA_EXTENSION_OVERRIDE="+GL_OES_EGL_image_external" to be set in init.rc
* | Add the RGBA8888 and RGBX8888 back to Intel screen configXu, Randy2016-11-011-0/+2
| | | | | | | | | | | | Otherwise the OGLES native app may cause primary screen format mismatch Signed-off-by: Xu, Randy <randy.xu@intel.com>
* | android: st/mesa: fix building error in libmesa_st_mesaMauro Rossi2016-11-011-1/+3
| | | | | | | | Fixes building error due to dependency on nir generated headers
* | android: support swrastWuZhen2016-11-012-3/+3
| | | | | | | | | | | | | | | | | | | | System boots up with gles_mesa/softpipe/llvmpipe. NO_REF_TASK Tested: local run Change-Id: I629ed0ca9fad12e32270eb8e8bfa9f7681b68474 Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
* | android: enable x86 asm and sse4 for x86 and x86_64WuZhen2016-11-016-36/+44
| | | | | | | | | | | | | | | | | | | | Support multilib compilation use runtime feature selection. NO_REF_TASK Tested: local run Change-Id: Iee7961effdecde09cfbdaf09455bfb0912699ae3 Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
* | android: print debug info to logcatWuZhen2016-11-011-0/+8
| | | | | | | | | | | | | | | | | | | | Redirect logs printed to stderr to logcat. NO_REF_TASK Tested: local run Change-Id: I58e3966a608af361b86c54b4c95a92561b711968 Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
* | android: re-generate git_sha1.h if git HEAD updatedChih-Wei Huang2016-11-011-1/+1
| | | | | | | | | | | | | | The git_sha1.h has to depend on the git HEAD otherwise it will never be updated. Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
* | android: a workaround for GL_INVALID_OPERATION (0x502) errorChih-Wei Huang2016-11-011-0/+2
| | | | | | | | | | | | | | | | Inspired by the nice work of Paulo Sergio (pstglia): "Bypass a check for external target enabled only for images created with EGL_EXT_image_dma_buf_import - this makes Android graphical components receive a GL_INVALID_OPERATION (0x502)."
* | i915: Support Android RGBX8888 format for EGL generated imagesSean V Kelley2016-11-013-0/+4
| | | | | | | | | | | | | | | | | | | | | | Enabled MESA_FORMAT_R8G8B8X8_UNORM (formerly MESA_FORMAT_RGBX8888_REV) for RGBX with i915. Android software requires RGBX8888 format to be supported for software rendering. Previously had done so for i965 but have requests for i915 support. Change-Id: I87c3a8e3f206d75d58b63182ed94851749740762 Signed-off-by: Sean V Kelley <sean.v.kelley@linux.intel.com>
* | i915: enable GL_APPLE_texture_2D_limited_npot in mesa 11.1Mauro Rossi2016-11-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | This is the port of Chia-I Wu commit 79ac0e to mesa 11.1 branch, where the extensions went to a dedicated file extensions_table.h Original commit message: "Enable GL_ARB_texture_non_power_of_two for GLESv1 to advertise GL_APPLE_texture_2D_limited_npo. The former is actually a superset of the latter, but we really want to enable NPOT support in some way."
* | android: advertise GL_ARB_texture_non_power_of_two in mesa 11.1Mauro Rossi2016-11-011-1/+1
|/ | | | | | | | | | This is the port of Chia-I Wu commit 62873a to mesa 11.1 branch, where the extensions went to a dedicated file extensions_table.h Original commit message: "It maps to DisplayHardware::NPOT_EXTENSION in SurfaceFlinger. Does not seem to matter when EGL_ANDROID_image_native_buffer is available."
* i965/fs/generator: Don't use the address immediate for MOV_INDIRECTJason Ekstrand2016-11-011-28/+27
| | | | | | | | | | | | | | The address immediate field is only 9 bits and, since the value is in bytes, the highest GRF we can point to with it is g15. This makes it pretty close to useless for MOV_INDIRECT. There were already piles of restrictions preventing us from using it prior to Broadwell, so let's get rid of the gen8+ code path entirely. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97779 Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Matt Turner <mattst88@gmail.com> (cherry picked from commit 2a4a86862c949055c71637429f6d5f2e725d07d8)
* mesa/program: Add _mesa_symbol_table_replace_symbol()Samuel Iglesias Gonsálvez2016-10-272-0/+18
| | | | | | | | | | | | This function allows to modify an existing symbol. v2: - Remove namespace usage now that it was deleted. Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com> (cherry picked from commit dfbdb2c0b3559c46d93f10d636a88b9541304fc7) Nominated-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
* glsl/mesa: remove unused namespace support from the symbol tableTimothy Arceri2016-10-274-254/+117
| | | | | | | | | | | | | | | | | | | | Namespace support seems to have been unused for a very long time. Previously the hash table entry was never removed and the symbol name wasn't freed until the symbol table was destroyed. In theory this could reduced the number of times we need to copy a string as duplicate names are reused. However in practice there is likely only a limited number of symbols that are the same and this is likely to cause other less than optimal behaviour such as the hash_table continuously growing. Along with dropping namespace support this change removes entries from the hash table as they become unused. Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> (cherry picked from commit 6dbe8a1b9fd750b4c1bb600a0bb43129d95e6eca) Nominated-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
* st/mesa: allow multiple concurrent waiters in ClientWaitSyncMarek Olšák2016-10-271-4/+22
| | | | | | | | | | | so->fence can be unreferenced by one thread while another thread is somewhere in ClientWaitSync and expecting so->fence to be non-NULL. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98172 Cc: 12.0 13.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (cherry picked from commit b687f766fddb7b39479cd9ee0427984029ea3559)
* st/mesa: unduplicate st_check_sync codeMarek Olšák2016-10-271-20/+6
| | | | | | | | | It's the same as st_client_wait_sync. Discovered by Michel. This is needed to make the following fix simpler. Cc: 12.0 13.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (cherry picked from commit f240ad98bc05281ea7013d91973cb5f932ae9434)
* mesa: fix error handling in DrawBuffersTapani Pälli2016-10-271-34/+37
| | | | | | | | | | | | | | | | | | | | | | | Patch rearranges error checking so that enum checking provided via destmask happens before other checks. It needs to be done in this order because other error checks do not work properly if there were invalid enums passed. Patch also refines one existing check and it's documentation to match GLES 3.0 spec (also in later specs). This was somewhat mysteriously referring to desktop GL but had a check for gles3. Fixes following dEQP tests: dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.draw_buffers no CI regressions observed. Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98134 Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> (cherry picked from commit a1652a059edc5a5f0f4b0836ba310a22e094bd85)
* i965: Drop nir_inputs from fs_visitor.Kenneth Graunke2016-10-271-1/+0
| | | | | | | | | It's unused. Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com> (cherry picked from commit 41034abfe63012784c9e9e36856d878928cecd99)
* i965: Don't use nir_assign_var_locations for VS/TES/GS outputs.Kenneth Graunke2016-10-275-62/+12
| | | | | | | | | | | | Fixes spec/arb_enhanced_layouts/execution/component-layout/vs-fs-array-dvec3. v2: Remove nir_outputs field from fs_visitor (caught by Tim and Iago). Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com> (cherry picked from commit 59864e8e02057cc6fa0448a8af067a3cf53389da)
* i965: Make split_virtual_grfs() call compact_virtual_grfs().Kenneth Graunke2016-10-271-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Post-splitting, VGRFs have a maximum size (MAX_VGRF_SIZE). This is required by the register allocator, as we have to create classes for each size of VGRF. We can (and do) allocate virtual registers larger than MAX_VGRF_SIZE, but we must ensure that they are splittable. split_virtual_grfs() asserts that the post-splitting register size is in range. Unfortunately, these trip for completely dead registers which are too large - we only set split points for live registers. So dead ones are never split, and if they happened to be too large, they'd trip asserts. To fix this, call compact_virtual_grfs() to eliminate dead registers before splitting. v2: Add a comment written by Iago. Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com> (cherry picked from commit 27715c73ff84349466f62df0023863acd477f262)
* i965: Drop unnecessary switch statement in nir_setup_outputs()Kenneth Graunke2016-10-271-12/+3
| | | | | | | | | | | TCS and FS are skipped above. CS has no output variables. All remaining cases take the same path. Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com> (cherry picked from commit 3728ee000aecb19793dec56d45aff9d6cfce3e5b)
* st/mesa: cleanup and fix primitive restart for indirect drawsNicolai Hähnle2016-10-271-17/+28
| | | | | | | | | | | | | | | | | There are three intended functional changes here: 1. OpenGL 4.5 clarifies that primitive restart should only apply with index buffers, so make that change explicit in the indirect draw path. 2. Make PrimitiveRestartFixedIndex work with indirect draws. 3. The change where primitive_restart is only set when the restart index can actually have an effect (based on the size of indices) is also applied for indirect draws. Cc: 13.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com> (cherry picked from commit 3d6b5dee3a0c9c077d68e5567b95f22b627be07e)
* st/mesa: only set primitive_restart when the restart index is in rangeNicolai Hähnle2016-10-241-2/+13
| | | | | | | | | | | | | | Even when enabled, primitive restart has no effect when the restart index is larger than the representable values in the index buffer. Fixes GL45-CTS.gtf31.GL3Tests.primitive_restart.primitive_restart_upconvert for radeonsi VI. v2: add an explanatory comment Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1) (cherry picked from commit bfa50f88cea2ba9f4dc4b825828d2c8f02866fc3)
* st/glsl_to_tgsi: sort input and output decls by TGSI indexNicolai Hähnle2016-10-241-0/+28
| | | | | | | | | Fixes a regression introduced by commit 777dcf81b. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98307 Reviewed-by: Marek Olšák <marek.olsak@amd.com> Cc: 13.0 <mesa-stable@lists.freedesktop.org> (cherry picked from commit 3d9b57e49304f9690c4a2b50afb8cdd4d253a1df)