Summary: | [i965]oglc max_values(negative.textureSize.textureCube) segfaults | ||
---|---|---|---|
Product: | Mesa | Reporter: | fangxun <xunx.fang> |
Component: | Drivers/DRI/i965 | Assignee: | Anuj Phogat <anuj.phogat> |
Status: | CLOSED FIXED | QA Contact: | Intel 3D Bugs Mailing List <intel-3d-bugs> |
Severity: | major | ||
Priority: | high | CC: | nobled |
Version: | git | ||
Hardware: | All | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Bug Depends on: | |||
Bug Blocks: | 42993 | ||
Attachments: |
piglit test case: validate-texture-size.c
error log with piglit test case |
Description
fangxun
2012-01-19 23:10:21 UTC
This is regression. Bisect fails because some mesa commit build failure. The first bad commit could be any of: 9c76ba04f845077d51912cc11970232cc9160294 37d24a70daa41bbad9c7a85dd432f561a172e858 3c01aefe5f9b8ffb31bbdd9ed5b200e830478a81 8e34021099527868097b2c877fc32f29aa4d7bb6 c661843ab6adc97b54debaccfb29b897b12ab76d a7534d8943d74e81299b2ee4edc462baac9d1331 d45814c925dd6c479cfd383b9b59458fc4359cf7 1981042341c6942bbd4d61508a47226c789bc25b Running in GDB with current master, I get: Largest texture size (queried with glGetIntegerv) for target(GL_TEXTURE_CUBE_MAP) is: 2048 Largest texture size for texture(GL_TEXTURE_CUBE_MAP), with internalFormat(GL_RGBA16) is 2050 (queried with proxy texture) MINOR ERROR: Size reported by texture proxy is greater than reported by glGetIntever using smaller value. Pixelformat: GL_RGBA16 textureSize: 2048 Mesa: User error: GL_OUT_OF_MEMORY in glTexSubImage2D oglconform64: intel_mipmap_tree.c:1038: intel_miptree_map: Assertion `!mt->level[level].slice[slice].map' failed. Program received signal SIGABRT, Aborted. 0x0000003ff0635215 in raise () from /lib64/libc.so.6 It seems that after (correctly) generating a GL_OUT_OF_MEMORY error, we try to use the broken texture. I'm not sure why this would have worked before. Reproduced this issue on Sandybridge. A patch will be posted on mailing list for review. Following commit fixes oglconform failure on SNB: commit 15986d21ebaaeedb234b066edba5cf7f6ea87a3c Author: Anuj Phogat <anuj.phogat@gmail.com> Date: Wed Jan 25 19:05:45 2012 -0800 mesa: fix maximum allowed proxy texture size condition width, height parameter in glTexImage2D() includes: texture image width + 2 * border (if any). So when doing the texture size check in _mesa_test_proxy_teximage() width and height should not exceed maximum supported size for target texture type. i.e. 1 << (ctx->Const.MaxTextureLevels - 1) Texture border is anyway stripped out before it is given to intel or gallium drivers. This patch fixes Intel oglconform test case: max_values Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44970 Note: This is a candidate for mesa 8.0 branch. Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Ian Romanick <idr@freedesktop.org> Reviewed-by: Jose Fonseca <jfonseca@vmware.com> Link for the patch: http://lists.freedesktop.org/archives/mesa-dev/2012-January/018295.html Created attachment 56489 [details]
piglit test case: validate-texture-size.c
Above patch fixes the oglconform test failure. But the errors reported in oglconform failure stays unfixed on mesa master. This is confirmed by a piglit test case (attached) I developed to reproduce errors thrown by oglconform test. test case will also be posted on mailing list for review.
Created attachment 56490 [details]
error log with piglit test case
These errors logs are recorded on Sandybridge. Driver throws assertion failure or segfaults/BUS ERROR with large texture sizes. Error logs change with different texture internal formats and with multiple times execution of the same test. It is observed that driver is unable to handle the texture sizes much below the maximum supported sizes for GL_TEXTURE_2D & GL_TEXTURE_CUBE_MAP.
Fixed on 8.0 branch by: commit b38640082cdf0d271c7d3da83d45dfa5f3a7b8d3 Author: Anuj Phogat <anuj.phogat@gmail.com> Date: Wed Jan 25 19:05:45 2012 -0800 mesa: fix maximum allowed proxy texture size condition width, height parameter in glTexImage2D() includes: texture image width + 2 * border (if any). So when doing the texture size check in _mesa_test_proxy_teximage() width and height should not exceed maximum supported size for target texture type. i.e. 1 << (ctx->Const.MaxTextureLevels - 1) Texture border is anyway stripped out before it is given to intel or gallium drivers. This patch fixes Intel oglconform test case: max_values Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44970 Note: This is a candidate for mesa 8.0 branch. Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Ian Romanick <idr@freedesktop.org> Reviewed-by: Jose Fonseca <jfonseca@vmware.com> (cherry picked from commit 15986d21ebaaeedb234b066edba5cf7f6ea87a3c) max_values(negative.textureSize.textureCube) passes on Sandybridge and ironlake, but max_values(advanced.combinedTexUnits.nonaliased) and max_values(advanced.textureSize.textureCube) still segfaults. Further debugging uncovers an error while preparing buffer map: intel_region_map( ) => drm_intel_gem_bo_map_gtt( ) => drmIoctl() returns -1 "Error preparing buffer map" strerror(errno) = 0x4dd6c234 bo_gem->gtt_virtual=0x0 region->map = 0x0 dstMap = 0x0 in store_texsubimage() which results in error "GL_OUT_OF_MEMORY in glTexSubImage" . Please retest with: commit ca9a7d975af228cabb79c3040ec67f26f94f90a2 Author: Eric Anholt <eric@anholt.net> Date: Tue Apr 2 17:28:41 2013 -0700 intel: Avoid making tiled miptrees we won't be able to blit. (passes before and after on my ivb) oglconform's max-values negative.textureSize.textureCube, advanced.textureSize.textureCube, and advanced.combinedTexUnits.nonaliased all pass with Mesa master on Ivybridge. I'm going to call this fixed. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.