Bug 88385 - [SNB+ Bisected]Ogles3conform ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels core dumped
Summary: [SNB+ Bisected]Ogles3conform ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels...
Status: VERIFIED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: high normal
Assignee: Tapani Pälli
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-14 02:42 UTC by lu hua
Modified: 2015-01-26 07:34 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
patch to fix the issue (1.38 KB, patch)
2015-01-14 11:27 UTC, Tapani Pälli
Details | Splinter Review
patch to fix the issue (4.30 KB, patch)
2015-01-16 09:34 UTC, Tapani Pälli
Details | Splinter Review

Description lu hua 2015-01-14 02:42:25 UTC
System Environment:
--------------------------
Platform: HSW
Libdrm:		(master)libdrm-2.4.58-21-gd7c0a08bc576deb07df6c3f91f393ca8edd0c4bf
Mesa:		(master)bed6f20f28af8bf531c14e3cab12a00354a313fc
Xserver:	(master)xorg-server-1.16.99.901-128-g4e12d7b6f4489fa06475465993a3e1e1d896390b
Xf86_video_intel:(master)2.99.917-26-gee79d1885509a2a94acb80e0c416cb276ba7c453
Libva:		(master)e97ac9e78cd475a13e722c455e34d5d39d0f059d
Libva_intel_driver:(master)1a4e98338b8b498895eabe3a151f48e5c624bb63
Kernel:   (drm-intel-nightly)823e7150631cb1059edc9c57fc4c6f8454e1700e

Bug detailed description:
---------------------------
It fails on SNB+ platforms with mesa master branch, works well on 10.4 branch.
Following cases also fail with the same bisect commit:
ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels_pbo
ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels_pixelstore

Bisect shows: 8ec6534b266549cdc2798e2523bf6753924f6cde is the first bad commit
Author:     Iago Toral Quiroga <itoral@igalia.com>
AuthorDate: Wed Oct 15 13:42:11 2014 +0200
Commit:     Iago Toral Quiroga <itoral@igalia.com>
CommitDate: Mon Jan 12 11:20:29 2015 +0100

    mesa: Use _mesa_format_convert to implement texstore_rgba.

    Notice that _mesa_format_convert does not handle byte-swapping scenarios,
    GL_COLOR_INDEX or MESA_FORMAT_YCBCR(_REV), so these must be handled
    separately.

    Also, remove all the code that goes unused after using _mesa_format_convert.

    Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>

output:
dEQP Core GL-CTS-2.0 (0x0052484b) starting..
  target implementation = 'X11'

Test case 'ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels'..
glcts: ../../src/mesa/main/glformats.c:2682: _mesa_format_from_format_and_type: Assertion `!"Unsupported format"' failed.
Aborted (core dumped)


(gdb) bt
#0  0x0000003820a35819 in raise () from /usr/lib64/libc.so.6
#1  0x0000003820a36f28 in abort () from /usr/lib64/libc.so.6
#2  0x0000003820a2e7f6 in __assert_fail_base () from /usr/lib64/libc.so.6
#3  0x0000003820a2e8a2 in __assert_fail () from /usr/lib64/libc.so.6
#4  0x00007ffff5ffda77 in _mesa_format_from_format_and_type (format=format@entry=6407, type=type@entry=33640) at ../../src/mesa/main/glformats.c:2682
#5  0x00007ffff6059c6d in texstore_rgba (srcPacking=0x7ffff5acb720, srcAddr=0x1e2d6d0, srcType=33640, srcFormat=6407, srcDepth=1, srcHeight=3, srcWidth=7,
    dstSlices=0x7fffffffd4c8, dstRowStride=64, dstFormat=MESA_FORMAT_B10G10R10A2_UNORM, baseInternalFormat=6407, dims=0, ctx=0x0) at ../../src/mesa/main/texstore.c:1007
#6  _mesa_texstore (ctx=ctx@entry=0x7ffff5ab0038, dims=dims@entry=2, baseInternalFormat=6407, dstFormat=MESA_FORMAT_B10G10R10A2_UNORM, dstRowStride=64,
    dstSlices=dstSlices@entry=0x7fffffffd4c8, srcWidth=srcWidth@entry=7, srcHeight=srcHeight@entry=3, srcDepth=srcDepth@entry=1, srcFormat=srcFormat@entry=6407,
    srcType=srcType@entry=33640, srcAddr=srcAddr@entry=0x1e2d6d0, srcPacking=srcPacking@entry=0x7ffff5acb720) at ../../src/mesa/main/texstore.c:1142
#7  0x00007ffff605a592 in store_texsubimage (ctx=ctx@entry=0x7ffff5ab0038, texImage=texImage@entry=0x1e33270, xoffset=xoffset@entry=0, yoffset=yoffset@entry=0,
    zoffset=zoffset@entry=0, width=7, height=3, depth=1, format=format@entry=6407, type=type@entry=33640, pixels=pixels@entry=0x1e2d6d0, packing=packing@entry=0x7ffff5acb720,
    caller=caller@entry=0x7ffff62f32c0 "glTexImage") at ../../src/mesa/main/texstore.c:1280
#8  0x00007ffff605a781 in _mesa_store_teximage (ctx=ctx@entry=0x7ffff5ab0038, dims=dims@entry=2, texImage=texImage@entry=0x1e33270, format=format@entry=6407,
    type=type@entry=33640, pixels=pixels@entry=0x1e2d6d0, packing=packing@entry=0x7ffff5acb720) at ../../src/mesa/main/texstore.c:1327
#9  0x00007ffff62bdbc0 in intelTexImage (ctx=0x7ffff5ab0038, dims=2, texImage=0x1e33270, format=6407, type=33640, pixels=0x1e2d6d0, unpack=0x7ffff5acb720)
    at intel_tex_image.c:204
#10 0x00007ffff6048fbf in teximage (ctx=0x7ffff5ab0038, compressed=compressed@entry=0 '\000', dims=dims@entry=2, target=target@entry=3553, level=0, internalFormat=31666800,
    width=7, height=3, depth=depth@entry=1, border=0, format=format@entry=6407, type=type@entry=33640, imageSize=imageSize@entry=0, pixels=pixels@entry=0x1e2d6d0)
    at ../../src/mesa/main/teximage.c:3269
#11 0x00007ffff604a2b4 in _mesa_TexImage2D (target=3553, level=<optimized out>, internalFormat=<optimized out>, width=<optimized out>, height=<optimized out>,
    border=<optimized out>, format=6407, type=33640, pixels=0x1e2d6d0) at ../../src/mesa/main/teximage.c:3308
#12 0x0000000000f666f2 in glwTexImage2D ()
#13 0x000000000096629f in packedPixelsPixelRectangleInner ()
#14 0x0000000000966449 in packedPixelsPixelRectangle ()
#15 0x0000000000966644 in GTFTestGL3_packed_pixels_Apply ()
#16 0x00000000008bedec in GTFTestGL3VirtualCallApply ()
#17 0x00000000008b78d1 in GTFTestGL3Apply ()
#18 0x0000000000866b41 in GTFTestEncapsulateApply ()
#19 0x0000000000812907 in GTFRunTest ()
#20 0x000000000080ae9b in gtf::TestCase::iterate() ()
#21 0x0000000000f00a97 in tcu::TestCaseWrapper::iterateTestCase(tcu::TestCase*) ()
#22 0x00000000007da1a1 in glcts::TestCaseWrapper::iterateTestCase(tcu::TestCase*) ()
#23 0x0000000000f02190 in tcu::TestExecutor::iterate() ()
#24 0x0000000000ef5141 in tcu::App::iterate() ()
#25 0x0000000000541638 in main ()

Reproduce steps:
-------------------------
1. xinit
2. ./glcts --deqp-case=ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels
Comment 1 Tapani Pälli 2015-01-14 08:53:59 UTC
I'll take a look at this
Comment 2 Tapani Pälli 2015-01-14 10:20:42 UTC
We have GL_UNSIGNED_INT_2_10_10_10_REV and GL_RGB which is not handled by the switch there, but it wasn't even before the commit .. so changes in texstore.c are probably the guilty bits.
Comment 3 Tapani Pälli 2015-01-14 11:27:05 UTC
Created attachment 112210 [details] [review]
patch to fix the issue

This fixes the issue, will do further testing to catch possible regressions.
Comment 4 lu hua 2015-01-15 08:02:54 UTC
(In reply to Tapani Pälli from comment #3)
> Created attachment 112210 [details] [review] [review]
> patch to fix the issue
> 
> This fixes the issue, will do further testing to catch possible regressions.

Fixed by this patch.
Comment 5 Tapani Pälli 2015-01-15 15:14:24 UTC
I'w working on a better fix now ..
Comment 6 Tapani Pälli 2015-01-16 09:34:33 UTC
Created attachment 112332 [details] [review]
patch to fix the issue

new patch!
Comment 7 Tapani Pälli 2015-01-16 09:38:43 UTC
CC Iago
Comment 8 Iago Toral 2015-01-16 09:57:15 UTC
Comment on attachment 112332 [details] [review]
patch to fix the issue

Review of attachment 112332 [details] [review]:
-----------------------------------------------------------------

::: src/mesa/main/formats.c
@@ +972,4 @@
>        return;
>  
>     case MESA_FORMAT_B10G10R10A2_UNORM:
> +   case MESA_FORMAT_R10G10B10X2_UNORM:

There is a "case MESA_FORMAT_B10G10R10X2_UNORM" a bit below, it is the same code, but maybe it makes more sense to move the "case MESA_FORMAT_R10G10B10X2_UNORM" down there so we keep formats with X bits together.

@@ +1727,5 @@
>     case MESA_FORMAT_A2R10G10B10_UNORM:
>        return format == GL_BGRA && type == GL_UNSIGNED_INT_10_10_10_2;
>  
> +   case MESA_FORMAT_R10G10B10X2_UNORM:
> +      return format == GL_RGB && type == GL_UNSIGNED_INT_2_10_10_10_REV;

I think this might be wrong: looking at other formats with X bits in this same function, they all return FALSE...
Comment 9 Tapani Pälli 2015-01-16 10:29:12 UTC
(In reply to Iago Toral from comment #8)
> Comment on attachment 112332 [details] [review] [review]
> patch to fix the issue
> 
> Review of attachment 112332 [details] [review] [review]:
> -----------------------------------------------------------------
> 
> ::: src/mesa/main/formats.c
> @@ +972,4 @@
> >        return;
> >  
> >     case MESA_FORMAT_B10G10R10A2_UNORM:
> > +   case MESA_FORMAT_R10G10B10X2_UNORM:
> 
> There is a "case MESA_FORMAT_B10G10R10X2_UNORM" a bit below, it is the same
> code, but maybe it makes more sense to move the "case
> MESA_FORMAT_R10G10B10X2_UNORM" down there so we keep formats with X bits
> together.

OK, will do
 
> @@ +1727,5 @@
> >     case MESA_FORMAT_A2R10G10B10_UNORM:
> >        return format == GL_BGRA && type == GL_UNSIGNED_INT_10_10_10_2;
> >  
> > +   case MESA_FORMAT_R10G10B10X2_UNORM:
> > +      return format == GL_RGB && type == GL_UNSIGNED_INT_2_10_10_10_REV;
> 
> I think this might be wrong: looking at other formats with X bits in this
> same function, they all return FALSE...

True, thanks for a quick review, I'll send a fixed version to list!
Comment 10 Tapani Pälli 2015-01-19 06:13:56 UTC
fixed in mesa master (since d74a817)
Comment 11 lu hua 2015-01-26 07:34:24 UTC
Verified.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.