[Mesa-dev] drm/i915 fails to prepare buffer map with large textures

Anuj Phogat anuj.phogat at gmail.com
Thu Feb 2 20:16:39 PST 2012


>
> > >> width, height parameter of 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)
>> > >>
>> > >> 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 at gmail.com>
>> > >> ---
>> > >>   src/mesa/main/teximage.c |   22 +++++++++++-----------
>> > >>   1 files changed, 11 insertions(+), 11 deletions(-)
>> > >>
>> > >> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
>> > >> index d11425d..018aca0 100644
>> > >> --- a/src/mesa/main/teximage.c
>> > >> +++ b/src/mesa/main/teximage.c
>> > >> @@ -1179,7 +1179,7 @@ _mesa_test_proxy_teximage(struct gl_context
>> > >> *ctx, GLenum target, GLint level,
>> > >>      switch (target) {
>> > >>      case GL_PROXY_TEXTURE_1D:
>> > >>         maxSize = 1<<  (ctx->Const.MaxTextureLevels - 1);
>> > >> -      if (width<  2 * border || width>  2 + maxSize)
>> > >> +      if (width<  2 * border || width>  maxSize)
>> > >
>> > > Anuj,
>> > >
>> > > I may be missing something, but I'm still unsure about this,
>> > > because this will create problems for drivers that do support
>> > > borders.
>> >
>> > AFAIK, the only desktop graphics hardware that ever supported borders
>> > is
>> > NVIDIA.  Their driver follows the convention (width + 2 * border) <
>> > maxSize, and their driver advertises a maximum size of 2^n.  I tried
>> > creating a proxy texture that was the full 2^n plus a border on their
>> > closed-source Linux driver, and it was rejected.  A proxy texture
>> > 2^n-2
>> > plus a border was accepted.
>> >
>> > Based on that, I believe this patch is correct.
>>
>> Fair enough. Sounds good to me then!
>
>
> patch in commit 15986d21ebaaeedb234b066edba5cf7f6ea87a3c made the intel oglconform test to pass. But the errors reported in oglconform failure stays unfixed. This is confirmed by a piglit test case I developed to reproduce the errors. Test case (validate-texture-size) is posted on piglit mailing list for review.
>
> Driver throws assertion failure or segfaults with large textures even much below the maximum supported size.
>
> https://bugs.freedesktop.org/show_bug.cgi?id=44970
>
> Further debugging  shows an error while preparing buffer map in
 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" .
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120202/8ea60496/attachment.html>


More information about the mesa-dev mailing list