summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2014-05-29nv50/ir/tgsi: TGSI_OPCODE_POW replicates its resultChristoph Bumiller1-1/+5
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 2f2d1b3d9b090aeba316d6c425c23e92340b5502)
2014-05-29nv50,nvc0: set constbufs dirty on pipe context switchChristoph Bumiller2-0/+5
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 49eccef06b0b4ca7d7cef0d76c2c251dd679c3bc)
2014-05-29nv50: setup scissors on clear_render_target/depth_stencilChristoph Bumiller1-2/+18
[imirkin: add logic to also clear the "regular" scissors] Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 200382be8576c43a668724c77b0f1b5a80b3adba)
2014-05-29nv50,nvc0: always pull out bufctx on context destructionChristoph Bumiller2-9/+7
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 7d11b761f248ebf5cc2c6732e67656f828afb110)
2014-05-23Merge remote-tracking branch 'robclark/freedreno-10.2' into 10.2Ian Romanick29-229/+1847
2014-05-23i965: Properly return *RESET* status in glGetGraphicsResetStatusARBPavel Popov1-5/+13
The glGetGraphicsResetStatusARB from ARB_robustness extension always returns GUILTY_CONTEXT_RESET_ARB and never returns NO_ERROR for guilty context with LOSE_CONTEXT_ON_RESET_ARB strategy. This is because Mesa returns GUILTY_CONTEXT_RESET_ARB if batch_active !=0 whereas kernel driver never reset batch_active and this variable always > 0 for guilty context. The same behaviour also can be observed for batch_pending and INNOCENT_CONTEXT_RESET_ARB. But ARB_robustness spec says: If a reset status other than NO_ERROR is returned and subsequent calls return NO_ERROR, the context reset was encountered and completed. If a reset status is repeatedly returned, the context may be in the process of resetting. 8. How should the application react to a reset context event? RESOLVED: For this extension, the application is expected to query the reset status until NO_ERROR is returned. If a reset is encountered, at least one *RESET* status will be returned. Once NO_ERROR is encountered, the application can safely destroy the old context and create a new one. The main problem is the context may be in the process of resetting and in this case a reset status should be repeatedly returned. But looks like the kernel driver returns nonzero active/pending only if the context reset has already been encountered and completed. For this reason the *RESET* status cannot be repeatedly returned and should be returned only once. The reset_count and brw->reset_count variables can be used to control that glGetGraphicsResetStatusARB returns *RESET* status only once for each context. Note the i915 triggers reset_count twice which allows to return correct reset count immediately after active/pending have been incremented. v2 (idr): Trivial reformatting of comments. Signed-off-by: Pavel Popov <pavel.e.popov@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 8dc4a98c44a824630f3cc234136833dbac9a1f4c)
2014-05-23targets/egl-static: add missing line break in ldflagsEmil Velikov1-1/+1
Accidently omitted by commit 7b7944ee1cedeaf. Cc: "10.2" <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> (cherry picked from commit e0372239a5b716de21b5f4c7a4a7d8b4a74a51cb)
2014-05-23mesa: Fix unbinding GL_DEPTH_STENCIL_ATTACHMENTJames Legg1-0/+6
glFramebufferRender(..., GL_DEPTH_STENCIL_ATTACHMENT, ..., 0) only detached the depth buffer and not the stencil buffer. Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=79115 Reviewed-by: Brian Paul <brianp@vmware.com> Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 846c715abb17e13a5d39c565d0995404b6178d98)
2014-05-23meta blit: Set Z texcoord during meta blit to sample the correct layerJordan Justen1-1/+8
If the source renderbuffer has a depth > 0, then send a Z texcoord which is set to the source attachment Z offset. This fixes piglit's gl-3.2-layered-rendering-gl-layer-render with the GL_TEXTURE_2D_MULTISAMPLE_ARRAY case test on i965/gen8. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 57876fee3872f4f224feeeb56eea6d2e10858fe9)
2014-05-23i965: Listen to BRW_NEW_FRAGMENT_PROGRAM for 3DSTATE_PS_BLEND.Kenneth Graunke2-2/+3
brw_color_buffer_write_enabled depends on brw->fragment_program, which means we have to listen to BRW_NEW_FRAGMENT_PROGRAM. On most generations, this was only called from a function that already subscribed. However, on Broadwell, we failed to listen to the necessary event in the atom that emits 3DSTATE_PS_BLEND. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 746921cbb474f2df85232a8f0c10cde8df3349e9)
2014-05-23i965: Use WE_all for FB write header setup on Broadwell.Kenneth Graunke1-6/+7
I forgot to disable writemasking on the OR and MOV which set the render target index and "source 0 alpha present to render target" bit. Using get_element_ud is equivalent and avoids a line-wrap. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 7d3985ca6cdd5f2f7ff68b269798d69394164dec)
2014-05-23meta: Use gl_FragColor to output color values to all the draw buffersAnuj Phogat1-11/+4
_mesa_meta_setup_blit_shader() currently generates a fragment shader which, irrespective of the number of draw buffers, writes the color to only one 'out' variable. Current shader rely on an undefined behavior and possibly works by chance. From OpenGL 4.0 spec, page 256: "If a fragment shader writes to gl_FragColor, DrawBuffers specifies a set of draw buffers into which the single fragment color defined by gl_FragColor is written. If a fragment shader writes to gl_FragData, or a user-defined varying out variable, DrawBuffers specifies a set of draw buffers into which each of the multiple output colors defined by these variables are separately written. If a fragment shader writes to none of gl_FragColor, gl_FragData, nor any user defined varying out variables, the values of the fragment colors following shader execution are undefined, and may differ for each fragment color." OpenGL 4.4 spec, page 463, added an additional line in this section: "If some, but not all user-defined output variables are written, the values of fragment colors corresponding to unwritten variables are similarly undefined." V2: Write color output to gl_FragColor instead of writing to multiple 'out' variables. This'll avoid recompiling the shader every time draw buffers count is updated. Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit 46737cebd337200f8b88ba9081796fa0f94e9143)
2014-05-23meta: Refactor _mesa_meta_setup_blit_shader() to avoid duplicate shader codeAnuj Phogat1-53/+48
Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit bee2915210e53585bca27c9c5f7d7407f61bcc0f)
2014-05-23tgsi: add GS_INVOCATIONS to property names arrayIlia Mirkin1-1/+2
In commit 4be146b1, I neglected to add the new property to the strings array. This leads to the string '(null)' to be printed instead when converting a GS shader to text. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> Reviewed-by: Roland Scheidegger <sroland@vmware.com> (cherry picked from commit cdeb7004e03afbd5305913b5ae35d72529623507)
2014-05-23nv50,nvc0: fix 3d blits with mipmap levelsIlia Mirkin2-11/+19
Make sure to normalize the z coordinates as well as the x/y ones when there are mipmaps present. Fixes 3d mipmap generation, which now uses the blit path. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> Reviewed-by: Ben Skeggs <bskeggs@redhat.com> (cherry picked from commit 28360fcad75a6917db6af42fb17b81572850ec0d)
2014-05-23nv50/ir: fix constant folding for OP_MUL subop HIGHIlia Mirkin1-4/+43
These instructions can come in either through IMUL_HI/UMUL_HI TGSI opcodes, or from OP_DIV constant folding. Also make sure that the constant foldings which delete the original instruction still get counted as having done something. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org> Reviewed-by: Ben Skeggs <bskeggs@redhat.com> (cherry picked from commit d2a3de19c6aa5881228734c73df706483a4aecf9)
2014-05-23nv50/ir: fix s32 x s32 -> high s32 multiply logicIlia Mirkin2-11/+82
Retrieving the high 32 bits of a signed multiply is rather annoying. It appears that the simplest way to do this is to compute the absolute value of the arguments, and perform a u32 x u32 -> u64 operation. If the arguments' signs differ, then negate the result. Since there is no u64 support in the cvt instruction, we have the perform the 2's complement negation "by hand". This logic can come into use by the IMUL_HI instruction (very unlikely to be seen), as well as from constant folding of division by a constant. Fixes dolphin's divisions by 255. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org> Reviewed-by: Ben Skeggs <bskeggs@redhat.com> (cherry picked from commit d3a5cf052c38087b395871b5b46776e2a7d4a7d7)
2014-05-23meta: Avoid _swrast_BlitFramebuffer in the meta CopyTexSubImage code.Kenneth Graunke1-6/+6
This is a replacement for bd44ac8b5ca08016bb064b37edaec95eccfdbcd5 that should actually work. Fixes Piglit's copyteximage-border on swrast, as well as one of es3conform's packed_pixels_pixelstore test. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78546 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77705 Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 2ecc7268bacf5d240ddd4d341360bfb31f4dd04f)
2014-05-23meta: Split _swrast_BlitFramebuffer out of the meta blit path.Kenneth Graunke8-25/+56
Separating the software fallbacks from the rest of the meta path (which is usually hardware accelerated) gives callers better control over their blitting options. For example, i965 might want to try meta blit, hardware blits, then swrast as a last resort. Splitting it makes that possible. This updates all callers to maintain the existing behavior (even in the few cases where it isn't desirable behavior - later patches can change that). Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 54540ea691e926b36a81a9b1e27b8f035995d07d)
2014-05-23meta: Drop unnecessary early returns in _mesa_meta_BlitFramebuffer.Kenneth Graunke1-8/+0
These aren't necessary - all of the following code is predicated on mask being non-zero, so no code will get executed anyway. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Courtney Goeltzenleuchter <courtney@lunarg.com> Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit d89ce333ccc585ef88fe10e61de17b885e03eab4)
2014-05-23Revert "i965: Don't _swrast_BlitFramebuffer when doing CopyTexSubImage."Kenneth Graunke1-1/+1
This reverts commit bd44ac8b5ca08016bb064b37edaec95eccfdbcd5. Fixes: Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78842 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78843 Re-breaks: Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77705 but that will be fixed properly in a few commits. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 2fa3796bc1f42c24f0db6632d9a32e77d19f4b3e)
2014-05-23i965/fbo: Only try stencil meta blits on gen >= 8Topi Pohjolainen1-2/+4
I don't have an ILK at hand but the fix should be trivial. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78872 Cc: "10.2" <mesa-stable@lists.freedesktop.org> Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com> Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit 21dddb22c12614c1d4a4f3d1664a3f38678cfbb1)
2014-05-23mesa: Disable GL_EXT_framebuffer_multisample_blit_scaled on Broadwell.Kenneth Graunke1-1/+2
It's not properly implemented in the meta code, and we don't have time to fix it for 10.2. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Cc: "10.2" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 0b96d362bf3f01b2b16d9216153fa3a1543bc2f5)
2014-05-23nv50/ir: fix integer mul lowering for u32 x u32 -> high u32Ilia Mirkin1-3/+4
UNION appears to expect that all of its sources are conditionally defined. Otherwise it inserts an unpredicated mov instruction which overwrites the desired result. This fixes tests that use UMUL_HI, and much less directly, unsigned integer division by a constant, which uses this functionality in a peephole pass. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org> Reviewed-by: Ben Skeggs <bskeggs@redhat.com> (cherry picked from commit 5b8f1a0f7c5b1412577a913d374192a2329fa615)
2014-05-23nv50/ir: make sure that texprep/texquerylod's args get coalescedIlia Mirkin1-0/+2
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2" <mesa-stable@lists.freedesktop.org> Reviewed-by: Ben Skeggs <bskeggs@redhat.com> (cherry picked from commit 4ebaabcccb125e3d29ab6e6ac3d23897287d7574)
2014-05-20darwin: Fix test for kCGLPFAOpenGLProfile support at runtimeJeremy Huddleston Sequoia1-5/+9
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> (cherry picked from commit 7a109268ab5b3544e7f7b99e84ef1fdf54023fb4)
2014-05-20freedreno: don't advertise texture arrays for nowRob Clark1-1/+1
I think a3xx and later should support (it is part of GLES3), but this isn't needed for the time being and still needs to be reversed. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a3xx: shadow sampler supportRob Clark2-3/+46
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a3xx/compiler: refactor trans_samp()Rob Clark1-47/+90
Split it up into some smaller fxns so it doesn't grow into a huge monster as we add things. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno: update generated headersRob Clark4-4/+10
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a3xx: use util_format_compose_swizzles()Rob Clark1-9/+9
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a3xx/compiler: 1D texturesRob Clark1-4/+25
Gallium already gives us height==1 for these, so the texture state is already setup correctly to emulate 1D textures as a Nx1 2D texture. We just need to supply the .y coord. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno: fix capsRob Clark1-2/+2
In particular, we want mesa to emulate primitive restart for us. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno: fix index buffer offsetRob Clark1-1/+1
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a3xx: add sRBG texture supportRob Clark2-0/+15
That was easy. Turns out it is just a matter of setting one bit. Enable sampling from sRGB texture, and therefore enable GL 2.1 :-) Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno: update generated headersRob Clark4-20/+21
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a3xx: fix write to bogus registerRob Clark1-2/+2
The loops for updating the multiple packed fields in SP_VS_OUT[] and SP_VS_VPC_DST[] will zero out one register beyond the last that on required. Which is normally not a problem (and is kinda convenient when looking at cmdstream dumps) unless we have maximum (16) varyings. Fix loop termination condition so that this does not happen. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a3xx: account for special inputs/outputsRob Clark1-2/+2
We need to size input/output tables big enough for special inputs/ outputs (gl_Position, gl_FrontFacing, etc) which, while they don't count towards the hw limit of 16 attributes or 16 varyings, we do still need to track them all the same. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a3xx: fix MAX_INPUTS shader capRob Clark3-1/+9
Hardware only supports 16. Which fd3_shader_variant properly reflected, but the pipe cap did not, leading to array overflow (and shaders that could not possibly work). Also a bunch of asserts to make problems like this easier to see. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a3xx/compiler: add KILL_IFRyan Houdek1-1/+35
The KILL_IF opcode could potentially be merged in to the regular KILL opcode function. It was a pain to do so, so I've left is separated for cleanliness. Signed-off-by: Ryan Houdek <Sonicadvance1@gmail.com> Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a3xx/compiler: start adding integer supportRyan Houdek1-0/+169
Adds a large sum of TGSI opcodes to the a3xx compiler. For integer opcodes we have 28 opcodes added. Adds 4 floating point compare opcodes If GLSL 1.30 is enabled, this allows the GLSL 1.30 piglits to have a completion amount of 432/641. Signed-off-by: Ryan Houdek <Sonicadvance1@gmail.com> Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a3xx: occlusion query supportRob Clark5-3/+185
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno: add support for hw queriesRob Clark10-8/+734
Real GPU queries need some infrastructure to track samples per tile and accumulate the results. But fortunately this can be shared across GPU generation. See: https://github.com/freedreno/freedreno/wiki/Queries#hardware-queries Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/query: allow multiple query implementationsRob Clark6-107/+269
Split out fd_query into an abstract base class, to allow multiple implementations. The current sw based queries are moved into fd_sw_query. Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a3xx: add point-sizeRob Clark1-4/+14
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno: update generated headersRob Clark4-54/+252
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20freedreno/a2xx: fix compiler warningRob Clark1-1/+1
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-20glapi: Avoid heap corruption in _glapi_tableJeremy Huddleston Sequoia1-1/+1
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> Reviewed-by: Chia-I Wu <olv@lunarg.com> (cherry picked from commit ff5456d1acf6f627a6837be3f3f37c6a268c9e8e)
2014-05-16mesa: fix double-freeing of dispatch tables inside glBegin/End.Brian Paul1-2/+2
We allocate dispatch tables for BeginEnd and OutsideBeginEnd. But when we destroy the context we were freeing the BeginEnd and Exec tables. If Exec==BeginEnd we did a double-free. This would happen if the context was destroyed while inside a glBegin/End pair. Now free the BeginEnd and OutsideBeginEnd pointers. Cc: "10.1", "10.2" <mesa-stable@lists.freedesktop.org> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> (cherry picked from commit ef6b6658f91bd5871739bdb71a08042f26abe389)
2014-05-16glsl_to_tgsi: Make sure the 'shader' member is always initializedMichel Dänzer1-0/+3
Fixes the valgrind report below and random crashes with piglit on radeonsi. ==30005== Conditional jump or move depends on uninitialised value(s) ==30005== at 0xB13584E: st_translate_program (st_glsl_to_tgsi.cpp:5100) ==30005== by 0xB14698B: st_translate_fragment_program (st_program.c:747) ==30005== by 0xB14777D: st_get_fp_variant (st_program.c:824) ==30005== by 0xB11219C: get_color_fp_variant (st_cb_drawpixels.c:1042) ==30005== by 0xB1131AE: st_DrawPixels (st_cb_drawpixels.c:1154) ==30005== by 0xAFF8806: _mesa_DrawPixels (drawpix.c:162) ==30005== by 0x4EB86DB: stub_glDrawPixels (generated_dispatch.c:6640) ==30005== by 0x4F1DF08: piglit_visualize_image (piglit-util-gl.c:1574) ==30005== by 0x40691D: draw_image_to_window_system_fb(int, bool) (draw-buffers-common.cpp:733) ==30005== by 0x406C8B: draw_reference_image(bool, bool) (draw-buffers-common.cpp:854) ==30005== by 0x40722A: piglit_display (alpha-to-coverage-dual-src-blend.cpp:117) ==30005== by 0x4EA7168: run_test (piglit_fbo_framework.c:52) Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> (cherry picked from commit 2bab95973d8ad3a84f62670143d6f26c230d9582)