summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2014-04-23mesa: Add an error condition in glGetFramebufferAttachmentParameteriv()Anuj Phogat1-0/+13
From the OpenGL 4.4 spec page 275: "If pname is FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE, param will contain the format of components of the specified attachment, one of FLOAT, INT, UNSIGNED_INT, SIGNED_NORMALIZED, or UNSIGNED_NORMALIZED for floating-point, signed integer, unsigned integer, signed normalized fixedpoint, or unsigned normalized fixed-point components respectively. If no data storage or texture image has been specified for the attachment, param will contain NONE. This query cannot be performed for a combined depth+stencil attachment, since it does not have a single format." Fixes Khronos CTS test: packed_depth_stencil_parameters.test Khronos Bug# 9170 Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (cherry picked from commit bd1880dfe8fe1eea12eeb573df34ef328b96013e)
2014-04-23mesa: Add error condition for integer formats in glGetTexImage()Anuj Phogat1-0/+5
OpenGL 4.0 spec, page 306 suggests an INVALID_OPERATION in glGetTexImage if : "format is one of the integer formats in table 3.3 and the internal format of the texture image is not integer, or format is not one of the integer formats in table 3.3 and the internal format is integer." V2: Use helper function _mesa_is_format_integer() Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com> (cherry picked from commit cb6566f9df61bfc84c27b382ba3e494bbac782d9)
2014-04-23mesa: Add helper function _mesa_is_format_integer()Anuj Phogat2-0/+12
This function will be used in the following patch. Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com> (cherry picked from commit 313566825405c33f26a0471a997ec4c79fae6b08)
2014-04-23i965: Fix component mask and varying_to_slot mapping for gl_ViewportIndexAnuj Phogat1-1/+5
gl_ViewportIndex doesn't get its own varying slot. It is stored in VARYING_SLOT_PSIZ.z. This patch fixes the issue for both gen7 and gen8 because gen7_upload_3dstate_so_decl_list() is shared between them. Fixes failures in OpenGL Khronos CTS test transform_feedback_builtins. Makes new piglit test glsl-1.50-transform-feedback-builtins pass for 'gl_ViewportIndex'. Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit 48fc2703e5d1c0a022a35fd77475d31d17c09177)
2014-04-23i965: Fix component mask and varying_to_slot mapping for gl_LayerAnuj Phogat1-4/+14
gl_Layer doesn't get its own varying slot. It is stored in VARYING_SLOT_PSIZ.y. This patch fixes the issue for both gen7 and gen8 because gen7_upload_3dstate_so_decl_list() is shared between them. Fixes failures in OpenGL Khronos CTS test transform_feedback_builtins. Makes new piglit test glsl-1.50-transform-feedback-builtins pass for 'gl_Layer'. Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit 7928b9c249b2059c926d58a30f9f38bceafefb77)
2014-04-23i965: Put an assertion to check valid varying_to_slot[varying]Anuj Phogat1-0/+1
Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit 969b461c2b28efbf44ea02cd09c8c6593f4c7343)
2014-04-23mesa: fix GetStringi error message with correct function nameBenjamin Bellec1-1/+1
Signed-off-by: Benjamin Bellec <b.bellec@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com> Cc: <mesa-stable@lists.freedesktop.org> (cherry picked from commit 9b3b9c613f186a09a0cc1080cc196c7a677dfc3c)
2014-04-23mesa: Fix error condition for multisample proxy texture targetsAnuj Phogat1-3/+13
Fixes failures in Khronos OpenGL CTS test proxy_textures_invalid_samples Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit ee10e893cbd616da295dc46ca37ece664cd91d1a) Conflicts: src/mesa/main/teximage.c
2014-04-21swrast: Add glBlitFramebuffer to commands affected by conditional renderingAnuj Phogat1-0/+8
Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com> (cherry picked from commit 8ed42ddd7d31b6c9c65c735ad27ca2873859129e)
2014-04-21st/xa: Cache render target surfaceThomas Hellstrom1-3/+15
Otherwise it will trick the gallium driver into thinking that the render target has actually changed (due to different pipe_surface pointing to same underlying pipe_resource). This is really badness for tiling GPUs like adreno. This also appears to fix a rendering error with Motif on vmwgfx. Why that is is still under investigation. Based on an idea by Rob Clark. Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Rob Clark <robclark@freedesktop.org> (cherry picked from commit 09cd376353f534611323da9bedb9b88242b6e4fa)
2014-04-21mesa: fix check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()Samuel Iglesias Gonsalvez1-2/+1
According to the spec: <renderbuffertarget> must be RENDERBUFFER and <renderbuffer> should be set to the name of the renderbuffer object to be attached to the framebuffer. <renderbuffer> must be either zero or the name of an existing renderbuffer object of type <renderbuffertarget>, otherwise an INVALID_OPERATION error is generated. This patch changes the previous returned GL_INVALID_VALUE to GL_INVALID_OPERATION. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76894 Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> (cherry picked from commit 9927180714662456ff7b895221f67112f2567a53)
2014-04-21mesa: Fix glGetVertexAttribi(GL_VERTEX_ATTRIB_ARRAY_SIZE)Anuj Phogat1-1/+1
mesa currently returns 4 when GL_VERTEX_ATTRIB_ARRAY_SIZE is queried for a vertex array initially set up with size=GL_BGRA. This patch makes changes to return size=GL_BGRA as required by the spec. Fixes Khronos OpenGL CTS test: vertex_array_bgra_basic.test V2: Use array->Format instead of adding a new variable Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Cc: <mesa-stable@lists.freedesktop.org> (cherry picked from commit fdd8bebc22f167f19d9cafbe2e7c189cb3720bcb)
2014-04-21r600g: Disable LLVM by default at runtime for graphicsMichel Dänzer3-5/+5
For graphics, the LLVM compiler backend currently has many shortcomings compared to the non-LLVM one. E.g. it can't handle geometry shaders yet, but that's just the tip of the iceberg. So building Mesa with --enable-r600-llvm-compiler is currently not recommended for anyone who doesn't want to work on fixing those issues. However, for protection of users who end up enabling it anyway for some reason, let's disable the LLVM backend at runtime by default. It can be enabled with the environment variable R600_DEBUG=llvm. Cc: "10.1" <mesa-stable@lists.freedesktop.org> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> (cherry picked from commit 7286739b9beea4683a29fe91850688a07ce23e1a)
2014-04-18i965: Fix buffer overruns in MSAA MCS buffer clearing.Eric Anholt1-1/+1
This manifested as rendering failures or sometimes GPU hangs in compositors when they accidentally got MSAA visuals due to a bug in the X Server. Today we decided that the problem in compositors was equivalent to a corruption bug we'd noticed recently in resizing MSAA-visual glxgears, and debugging got a lot easier. When we allocate our MCS MT, libdrm takes the size we request, aligns it to Y tile size (blowing it up from 300x300=900000 bytes to 384*320=122880 bytes, 30 pages), then puts it into a power-of-two-sized BO (131072 bytes, 32 pages). Because it's Y tiled, we attach a 384-byte-stride fence to it. When we memset by the BO size in Mesa, between bytes 122880 and 131072 the data gets stored to the first 20 or so scanlines of each of the 3 tiled pages in that row, even though only 2 of those pages were allocated by libdrm. In the glxgears case, the missing 3rd page happened to consistently be the static VBO that got mapped right after the first MCS allocation, so corruption only appeared once window resize made us throw out the old MCS and then allocate the same BO to back the new MCS. Instead, just memset the amount of data we actually asked libdrm to allocate for, which will be smaller (more efficient) and not overrun. Thanks go to Kenneth for doing most of the hard debugging to eliminate a lot of the search space for the bug. Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77207 Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit 7ae870211ddc40ef6ed209a322c3a721214bb737)
2014-04-18i965: Avoid dependency hints on math opcodesMike Stroyan1-0/+8
Putting NoDDClr and NoDDChk dependency control on instruction sequences that include math opcodes can cause corruption of channels. Treat math opcodes like send opcodes and suppress dependency hinting. Signed-off-by: Mike Stroyan <mike@LunarG.com> Tested-by: Tony Bertapelli <anthony.p.bertapelli@intel.com> Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Matt Turner <mattst88@gmail.com> (cherry picked from commit 602510395a96a1f6ca29189e4f5cfb3f07f21d23)
2014-04-18glsl: Try vectorizing when seeing a repeated assignment to a channel.Kenneth Graunke1-0/+1
When considering assignment expressions like: v.x += u.x; v.x += u.x; the vectorizer would incorrectly keep going, attempting to find more instructions to vectorize. It would overwrite the saved assignment to point at the second one, and increment channels a second time, resulting in try_vectorize thinking the expression was a vec2 instead of a float. Instead, if we see a repeated assignment to a channel, just try to vectorize everything we've found so far. This clears the saved state so it will start over. Fixes Piglit's repeated-channel-assignments.vert. Cc: "10.1" <mesa-stable@lists.freedesktop.org> Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com> (cherry picked from commit ae2a03b5736037128fb071595717f300d5b3afd5)
2014-04-18glsl: Propagate explicit binding information from the AST all the way to the ↵Ian Romanick4-2/+30
linker Information about the binding was not being properly communicated from the front-end compiler to the linker. As a result, the linker never knew that any UBOs had explicit bindings! Fixes the piglit test arb_shading_language_420pack-binding-layout. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323 Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Tested-by: github@socker.lepus.uberspace.de [v0] Cc: "10.1" <mesa-stable@lists.freedesktop.org> Cc: github@socker.lepus.uberspace.de (cherry picked from commit 625cf8c874950a38e7afb404345611f0fad4d490)
2014-04-18linker: Set binding for all elements of UBO arrayIan Romanick1-2/+34
Previously, a UBO like layout(binding=2) uniform U { ... } my_constants[4]; wouldn't get any bindings set. The code would try to set the binding of U, but that would fail. It should instead set the bindings for U[0], U[1], ... Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323 Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "10.1" <mesa-stable@lists.freedesktop.org> Cc: github@socker.lepus.uberspace.de (cherry picked from commit 25a66568750c5826a077cbf549de92546c5fc6cf)
2014-04-18linker: Set block bindings based on UniformBlocks rather than UniformStorageIan Romanick1-11/+21
For blocks, gl_shader_program::UniformStorage isn't very useful. The names stored there are the names of the elements of the block, so finding blocks with an instance name is hard. There is also only one entry in ::UniformStorage for each element of a block array, and that is a deal breaker. Using ::UniformBlocks is what _mesa_GetUniformBlockIndex does. I contemplated sharing code between set_block_binding and _mesa_GetUniformBlockIndex, but building the stand-alone compiler and the unit tests make this hard. I plan to return to this effort shortly. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323 Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "10.1" <mesa-stable@lists.freedesktop.org> Cc: github@socker.lepus.uberspace.de (cherry picked from commit cc42717b50bd46c82ac7925c397cd105ac82d091)
2014-04-18linker: Clean up "unused parameter" warningsIan Romanick1-8/+4
../../src/glsl/link_uniform_initializers.cpp:87:1: warning: unused parameter 'mem_ctx' [-Wunused-parameter] ../../src/glsl/link_uniform_initializers.cpp:87:1: warning: unused parameter 'type' [-Wunused-parameter] ../../src/glsl/link_uniform_initializers.cpp:127:1: warning: unused parameter 'mem_ctx' [-Wunused-parameter] ../../src/glsl/link_uniform_initializers.cpp:127:1: warning: unused parameter 'type' [-Wunused-parameter] Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323 Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "10.1" <mesa-stable@lists.freedesktop.org> Cc: github@socker.lepus.uberspace.de (cherry picked from commit 157391a41bc3e0222888d0450405867139ab4c9d)
2014-04-18glsl: Allow explicit binding on atomics againCarl Worth1-1/+3
As of 943b2d52bf5, layout(binding) on an atomic would fail the assertion here. Signed-off-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit 92840aabf7a96583619a01a8257ef6f117f0ca50) Conflicts: src/glsl/link_uniform_initializers.cpp
2014-04-16linker: Fold set_uniform_binding into call siteIan Romanick1-21/+12
In the next patch, we'll see that using gl_shader_program::UniformStorage is not correct for uniform blocks. That means we can't use ::UniformStorage to select between the sampler path and the block path. Instead we want to just use the type of the variable. That's never passed to set_uniform_binding, and it's easier to just remove the function (especially for later patches in the series) than to add another parameter. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323 Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "10.1" <mesa-stable@lists.freedesktop.org> Cc: github@socker.lepus.uberspace.de (cherry picked from commit 943b2d52bf5df6adde3c0abcb91d9a3899476ab0)
2014-04-16linker: Various trivial clean-ups in set_sampler_bindingIan Romanick1-18/+18
- Remove the spurious block left from the previous commit and re-indent. - Constify elements. - Make the spec reference in the code look like other spec references in the compiler. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323 Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "10.1" <mesa-stable@lists.freedesktop.org> Cc: github@socker.lepus.uberspace.de (cherry picked from commit 881c52f13f4a8ca1c80ca1766238d5100ddf283b)
2014-04-16linker: Split set_uniform_binding into separate functions for blocks and ↵Ian Romanick1-3/+39
samplers The two code paths are quite different, and there are some problems in the handling of uniform blocks. Future changes will cause these paths to diverge further. Ultimately, selecting between the two functions will happen at the set_uniform_binding call site, and set_uniform_binding will be deleted. NOTE: This patch just moves code around. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323 Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "10.1" <mesa-stable@lists.freedesktop.org> Cc: github@socker.lepus.uberspace.de (cherry picked from commit 6e2f63b69e37c365094ce9bf7e2f9cd118cea01a)
2014-04-15i965/fs: Don't propagate saturation modifiers if there are source modifiers.Matt Turner1-0/+2
Which would lead to translating mad vgrf9:F, vgrf3:F, u0:F, vgrf6:F mov.sat vgrf7:F, -vgrf9:F into mad.sat vgrf9:F, vgrf3:F, u0:F, vgrf6:F mov vgrf7:F, -vgrf9:F Fixes some lighting effects in Dota2. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76749 Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (cherry picked from commit 92d03f7f2878b15a41077e1ea11962a47c1d9b29)
2014-04-15i965/fs: Don't propagate saturate modifiers into partial writes.Matt Turner1-1/+2
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (cherry picked from commit 7a7b8a02bed5a113fd0f8e45acc0eafdd7227b55)
2014-04-15i965/fs: Fix off-by-one in saturate propagation.Matt Turner1-1/+1
ip needs to be initialized to start_ip - 1, since the first thing in the main loop is ip++. Otherwise we would incorrectly propagate the saturate from the mov to the mad: mad a, b, c, d mov.sat x, a add y, z, a Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (cherry picked from commit 86ae6f477d24169cbc27d53c57d5d024d73e4e4a)
2014-04-15haiku: Fix build through scons corrections and viewport fixesAlexander von Gluck IV1-3/+9
* Add HAVE_PTHREAD, we do have pthread support wrappers now for non-native Haiku threaded applications. * Viewport changed behavior recently breaking the build. We fix this by looking at the gl_context ViewportArray (Thanks Brian for the idea) Acked-by: Brian Paul <brianp@vmware.com> (cherry picked from commit 7683fce8781ef0169333c5ee1276392d058cfaa8)
2014-04-14egl/dri2: use drm macros to construct device nameJonathan Gray1-1/+6
Don't hardcode /dev/dri/card0 but instead use the drm macros which allows the correct /dev/drm0 device to be opened on OpenBSD. v2: use snprintf and fallback to /dev/dri/card0 v3: check for snprintf truncation Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Cc: "10.1" <mesa-stable@lists.freedesktop.org> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com> (cherry picked from commit c973e440d5b4057d93b4ce1298da77c3449c9f33)
2014-04-14r600g: implement edge flagsMarek Olšák3-3/+52
Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 1337da51152db7fa1a71ac86b61b51a42d29d595) Conflicts: src/gallium/drivers/r600/evergreen_state.c src/gallium/drivers/r600/r600_shader.c src/gallium/drivers/r600/r600_shader.h
2014-04-14r600g: Don't leak bytecode on shader compile failureMichel Dänzer1-7/+12
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74868 Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Marek Olšák <marek.olsak@amd.com> (cherry picked from commit ee2bcf38a4c8930d8f9cecfac580030a45c41dae)
2014-04-14glx: drop obsolete _XUnlock_Mutex in __glXInitialize error pathEmil Velikov1-3/+1
With commit 1f1928db001(glx: Drop _Xglobal_lock while we create and initialize glx display) we've split the big _Xglobal_lock handling in a more fine grained manner. Unfortunatelly we forgot to drop the unlock_mutex on the error paths, leading to undefined behaviour as the mutex is already unlocked. Cc: Kristian Høgsberg <krh@bitplanet.net> Cc: "9.2 10.0 10.1" <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (cherry picked from commit f9832f960fa8edcee0eb6866698cc5f9f25bd8f9)
2014-04-14svga: move LIST_INITHEAD(dirty_buffers) earlier in svga_context_create()Brian Paul1-2/+2
Fixes a crash in svga_context_flush_buffers() if we use the 'draw' module for AA lines (when the device doesn't support that feature). We need to initialize this list before we setup the swtnl pieces. Found/fixed by Charmaine Lee. Cc: "10.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> (cherry picked from commit e853ade5441e8bf8f862ecf379c231cb439c5c00) Conflicts: src/gallium/drivers/svga/svga_context.c
2014-04-14i965: Stop advertising GL_MESA_ycbcr_texture.Kenneth Graunke1-1/+0
The "new" fragment shader backend has never supported the necessary color conversion code for this to work. We began using the new backend in Mesa 7.10 for GLSL (commit a81d423d93f22a948f3aa4bf73, October 2010), and for ARB_fragment_program in Mesa 9.1 (commit 97615b2d8c7c3cea6fd3a4, August 2012). I haven't heard any complaints, so I don't think anyone will miss this feature. I believe mplayer used it at one point, but these days defaults to other paths anyway. Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <idr@freedesktop.org> Reviewed-by: Eric Anholt <eric@anholt.net> (cherry picked from commit 26ae030fcc364a4cfcdec0cbac2ca87d096c6cd0)
2014-04-14mesa: add bounds checking to eliminate buffer overrunCourtney Goeltzenleuchter1-24/+54
Decompressing ETC2 textures was causing intermitent segfault by copying resulting 4x4 texel block to the destination texture regardless of the size of the destination texture. Issue found via application crash in GLBenchmark 3.0's Manhattan test. v2: add more detail comment. Compute limit outside inner loops. v3: add bugzilla reference v4: Correct cc syntax in commit log v5: really grab the right patch Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74988 Cc: "9.2 10.0 10.1" <mesa-stable@lists.freedesktop.org> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1, suggested v2-3] (cherry picked from commit cb4ad1368551b64756c7b6e2007588e34739b188)
2014-04-14svga: replace sampler assertion with conditionalBrian Paul2-5/+33
For TEX instructions, the set of samplers and sampler views should be consistent. The XA state tracker sometimes passes an inconsistent set of samplers and sampler views. Rather than assert and die, issue a warning. v2: add debugging code to detect inconsistent state. v3: also check for null sampler in svga_state_tss.c Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> (cherry picked from commit 9bb2ec6fd1464d92f44b8aa693616edda9724312)
2014-04-14i965/vec4: fix record clearing in copy propagationChia-I Wu1-5/+16
Given mov vgrf7, vgrf9.xyxz add vgrf9.xyz, vgrf4.xyzw, vgrf5.xyzw add vgrf10.x, vgrf6.xyzw, vgrf7.wwww the last instruction would be wrongly changed to add vgrf10.x, vgrf6.xyzw, vgrf9.zzzz during copy propagation. The issue is that when deciding if a record should be cleared, the old code checked for inst->dst.writemask & (1 << ch) instead of inst->dst.writemask & (1 << BRW_GET_SWZ(src->swizzle, ch)) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76749 Signed-off-by: Chia-I Wu <olv@lunarg.com> Cc: Jordan Justen <jljusten@gmail.com> Cc: Matt Turner <mattst88@gmail.com> Reviewed-by: Ian Romainck <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net> Cc: "10.1" <mesa-stable@freedesktop.org> (cherry picked from commit 4ddf51db6af36736d5d42c1043eeea86e47459ce)
2014-04-14glsl: Fix lack of i2u in lower_ubo_reference.Kenneth Graunke1-3/+7
ir_binop_ubo_load takes unsigned integer operands. However, the array index used to compute these offsets may be a signed integer. (For example, see Piglit's spec/glsl-1.40/uniform_buffer/fs-bvec-array). For some reason, we were missing an ir_binop_i2u cast, and ir_validator was failing to catch that. Without this change, ir_builder's type inference code broke for me when writing a new optimization pass. Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com> (cherry picked from commit e14b93371cc8394bd69622f6b60cfdf8ba177360)
2014-04-14st/xa: Make sure unused samplers are set to NULLThomas Hellstrom1-2/+3
renderer_copy_prepare was setting the first sampler but never telling the cso code how many samplers were actually used. Fix this. Cc: "10.1" <mesa-stable@freedesktop.org> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> (cherry picked from commit 47f60cbb7197bd9f8bb27ca3a2b160e8a563619a)
2014-04-14st/xa: Bind destination before setting new stateThomas Hellstrom1-3/+3
Binding a new destination may cause the svga driver to emit draw calls while propagating the surface. Make sure this doesn't happen in the middle of sampler state setup where state may be incosistent. In practice, surface propagation should never happen here and even if it did, it wouldn't be a valid reason for the svga driver to emit partially set up state, but to avoid future uncertainties, make sure this doesn't happen anyway. Found while auditing the state tracker for inconsistent sampler state / sampler view setup. Cc: "10.1" <mesa-stable@freedesktop.org> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> (cherry picked from commit e5d2c5b89944007d69347fd419789312be573d0c)
2014-04-14nouveau: fix firmware check on nvd7/nvd9Ilia Mirkin1-3/+3
The kernel driver expects the class to be based on chipset generation rather than VP generation. Make sure to pass 90b1 for NVDX chipsets instead of 95b1. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77102 Fixes: 40dd777b33073 Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.1 10.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@ubunutu.com> (cherry picked from commit 89c5b56be6c242d1489cf5c06b04c8b7a668d6f9)
2014-04-14winsys/svga: Fix prime surface references also for guest-backed surfacesThomas Hellstrom3-6/+81
Implement guest-backed surface sharing using prime fds. Previously only legacy surfaces could use this functionality. Also use the vmwgfx 2.6 single-ioctl prime fd reference if available. Cc: "10.1" <mesa-stable@lists.freedesktop.org> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> (cherry picked from commit 2f6fcd65f2401695427bcbf1f2bd428d466ecda0)
2014-04-14winsys/svga: Update the vmwgfx_drm.h header to latest version from kernelThomas Hellstrom1-1/+12
Cc: "10.1" <mesa-stable@lists.freedesktop.org> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> (cherry picked from commit 0887b499e95b0103fa01614cbc9988f0b15c75d6)
2014-04-14egl/dri2: don't require libudev to build drm/wayland platformsJonathan Gray1-2/+0
After the loader changes libudev is no longer required to build gbm or the egl drm/wayland platforms. Remove a libudev ifdef which allows the the drm egl driver to be loaded on OpenBSD. Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Cc: "10.1" <mesa-stable@lists.freedesktop.org> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> (cherry picked from commit 0295953c5de6a4b2394530235ca1d61cf16f4e8c)
2014-04-14megadriver_stub.c: don't use _GNU_SOURCE to gate the compat codeJonathan Gray1-2/+2
_GNU_SOURCE is only set/required for linux*|*-gnu*|gnu*) and as the functionality is available on other systems check for RTLD_DEFAULT instead. Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Cc: "10.1" <mesa-stable@lists.freedesktop.org> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> (cherry picked from commit 1cc742d912b76b2cbf97a5a44f271b4f41037bec)
2014-04-14loader: don't limit the non-udev path to only androidJonathan Gray1-1/+1
Platforms that lack libudev (OpenBSD and possibly others) need this change in order to load the correct dri driver. Under linux we unconditionally require libudev, thus this code will never get build. v2: Add commit message (Emil Velikov) Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Cc: "10.1" <mesa-stable@lists.freedesktop.org> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> (cherry picked from commit 380f05ccc305bad7568ce19ea7e27cae39998d08)
2014-04-14loader: use 0 instead of FALSE which isn't definedJonathan Gray1-2/+2
Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Cc: "10.1" <mesa-stable@lists.freedesktop.org> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> (cherry picked from commit 727f54a76e03d61462914862d3111afe798547f5)
2014-04-14cso: fix sampler view count in cso_set_sampler_views()Brian Paul1-3/+4
We want to call pipe->set_sampler_views() with count being the maximum of the old number of sampler views and the new number. This makes sure we null-out any old sampler views. We already do the same thing for sampler states in single_sampler_done(). Fixes some assertions seen in the VMware driver with XA tracker. Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Tested-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> (cherry picked from commit 2355a6441435b8e66a032c44f0794066338e30a3)
2014-04-14winsys/svga: Replace the query mm buffer pool with a slab pool v3Thomas Hellstrom1-5/+13
This is to avoid running out of query buffer space due to winsys limitations. Instead of a fixed size per screen pool of query buffers, use a slab allocator that allocates a new slab if we run out of space in the first one. v2: Correct email addresses. v3: s/8192/VMW_QUERY_POOL_SIZE/. Improve documentation and log message. Reported-and-tested-by: Brian Paul <brianp@vmware.com> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Cc: "10.1" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 5dc206525b6ff799870f880469a985f3d944eb77)
2014-04-14mesa: fix glMultiDrawArrays inside a display listBrian Paul1-3/+4
The underlying glDrawArrays() calls weren't getting compiled into the display list. We simply need to use the current dispatch table so the CALL_DrawArrays() is routed to the display list save function. This patch also fixes glMultiModeDrawArraysIBM and glMultiModeDrawElementsIBM. Fixes the new piglit gl-1.4-dlist-multidrawarrays test. Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org> Reviewed-by: José Fonseca <jfonseca@vmware.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (cherry picked from commit e3418562940f7021b6d4d981666918964c84abb7)