Bug 89015

Summary: [radeonsi] unvanquished & nexuiz crash after switching AA
Product: Mesa Reporter: Arek Ruśniak <arek.rusi>
Component: Drivers/Gallium/radeonsiAssignee: Default DRI bug account <dri-devel>
Status: RESOLVED FIXED QA Contact: Default DRI bug account <dri-devel>
Severity: normal    
Priority: medium CC: farmboy0+freedesktop
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: unvanquished.log
nexuiz.log
glxinfo for xf86-video-modesetting
glxinfo for xf86-video-ati
somewhere between mesa 10.2.x & 10.3

Description Arek Ruśniak 2015-02-06 16:40:03 UTC
Created attachment 113233 [details]
unvanquished.log

Without AA everything looks good. Atfer turn on antialliasing both games crash with log:

EE r600_texture.c:326 r600_texture_get_fmask_info - Got error in surface_init while allocating FMASK

and 

"_name_of_process_":dri2.c:547: dri2_allocate_textures: Assertion `drawable->msaa_textures[statt]' failed.
Comment 1 Arek Ruśniak 2015-02-06 16:48:27 UTC
Created attachment 113234 [details]
nexuiz.log

sw:
linux:drm-next-3.20
mesa: git-d4a461c
llvm: r228386
xorg: 1.17.0 + modesetting instead radeon

hw:
capeverde
Comment 2 Arek Ruśniak 2015-02-06 20:25:57 UTC
i've tried this with xf86-video-ati and it looks like the problem is in modesetting ddx. 
With radeon AA works fine. 

Should i fill new bug in xorg/modesetting thread?
Comment 3 Michel Dänzer 2015-02-09 09:02:06 UTC
Please attach the output of glxinfo from using the modesetting and radeon drivers.
Comment 4 Arek Ruśniak 2015-02-09 10:49:37 UTC
Created attachment 113279 [details]
glxinfo for xf86-video-modesetting
Comment 5 Arek Ruśniak 2015-02-09 10:52:05 UTC
Created attachment 113280 [details]
glxinfo for xf86-video-ati
Comment 6 Michel Dänzer 2015-02-10 06:34:12 UTC
Somebody needs to track down why radeon_surface_init returns a non-0 value. I think it most likely comes from si_surface_sanity, but I'm not sure.

For now, let's assume this is a radeonsi driver bug.
Comment 7 Igor Ulyanov 2015-02-19 09:40:40 UTC
Please check your kernel version and if it is outdated test with at least 3.19 and rebuilded xf86-video-ati.
Comment 8 Igor Ulyanov 2015-02-19 11:01:30 UTC
kernel 3.19 and xf86-video-ati current git version fixed similar problem for me.
Comment 9 Arek Ruśniak 2015-02-19 16:01:18 UTC
Igor, i use 1-day old git/svn for mesa/llvm/kenel except for xf86-video-ati, i don't use it at all. If your distribution use xorg-1.17.x you may try xf86-video-modesetting. It would be really nice if you can. As I wrote before, for xf86-video-ati the problem doesn't exist ...at least for me.

Could you tell which version of radeon ddx failed for unvanquished + AA.
Comment 10 Arek Ruśniak 2015-02-19 20:23:07 UTC
Created attachment 113672 [details]
somewhere between mesa 10.2.x & 10.3

I've tested some tags of mesa with: llvm-3.5.1 & xorg 1.17.1+modesetting & drm_next.

1)mesa 10.2.9 - looks ok
2)mesa 10.3.(0,1)&10.4.4 - looks like a crap (see pic) but not fails (play music,  can screen shot, can escape with ALT+F4)
3)mesa dev-10.(5,6) - crashes
Comment 11 Arek Ruśniak 2015-02-19 22:35:42 UTC
between stage 2&3 the winner is:

3da735cc4c478b0ab2ecc2164899cf9d77dc671a is the first bad commit
commit 3da735cc4c478b0ab2ecc2164899cf9d77dc671a
Author: Jason Ekstrand <jason.ekstrand@intel.com>
Date:   Sat Aug 23 10:45:00 2014 -0700

    main: Add a concept of an array format
    
    An array format is a 32-bit integer format identifier that can represent
    any format that can be represented as an array of standard GL datatypes.
    Whie the MESA_FORMAT enums provide several of these, they don't account for
    all of them.
    
    v2 by Iago Toral Quiroga <itoral@igalia.com>:
     - Implement mesa_array_format as a plain bitfiled uint32_t type instead of
       using a struct inside a union to access the various components packed in
       it. This is necessary to support bigendian properly, as pointed out by
       Ian.
     - Squashed: Make float types normalized
    
    v3 by Iago Toral Quiroga <itoral@igalia.com>:
      - Include compiler.h in formats.h, which is necessary to build in MSVC as
        indicated by Brian Paul.
    
    Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>

:040000 040000 87f8588bd2eeda5fbf0669360f2ff66564c93a3c f2b353b9593f085e196f184a2d6ebee2e2194dea M	src


for stages 1&2... wip
Comment 12 Arek Ruśniak 2015-02-20 00:11:20 UTC
and for 1->2 trigger is:
27c686309e035d211c7cf38d1c0902f1bf2886c5 is the first bad commit
commit 27c686309e035d211c7cf38d1c0902f1bf2886c5
Author: Axel Davy <axel.davy@ens.fr>
Date:   Wed Jun 18 23:27:30 2014 -0400

    gallium: Add __DRIimageDriverExtension support to gallium
    
    __DRIimageDriverExtension is used by GLX DRI3 and Wayland.
    
    This patch is a rewrite of
    http://lists.freedesktop.org/archives/mesa-dev/2014-May/060318.html
    and
    http://lists.freedesktop.org/archives/mesa-dev/2014-May/060317.html
    
    Previous patches were:
    Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>
    
    Signed-off-by: Axel Davy <axel.davy@ens.fr>
    Reviewed-by: Marek Olšák <marek.olsak@amd.com>
    Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

:040000 040000 bed5212b498ec77bf272f1caa433442a3e897601 d1b1be3159255a47c2fa21e2ad0735798cbc78b7 M	src
Comment 13 smoki 2015-02-20 16:25:25 UTC
 modesetting in dri2 mode is fine here :). Probably, but do you use xserver's modesetting driver in dri3 mode?

 There are whole bunch of piglit crashes and gpu lockups here with anything dri3 related - be it with xserver's modeseting or radeon ddx (i tried this patched radeon https://github.com/iXit/xf86-video-ati/commits/master and it suffer from the same issues like modesetting)
Comment 14 Arek Ruśniak 2015-02-21 11:06:47 UTC
Is there any way to switch dri mode? As far i know xorg1.17+modesseting just uses dri3. There is no log with dmesg/xorg/systemd when dri3 is used. 
So answer for your question is: so probably yes, but i don't know for sure. 

DDX from https://github.com/iXit/xf86-video-ati/ has the same symptoms like modeseting but looks worse a lot (this is why i never like it)
Comment 15 Arek Ruśniak 2015-02-21 12:59:24 UTC
I've just tried new mesa/master and it doesn't crash anymore. Problem goes back to stage 2 (see pics), but:
-----
EE r600_texture.c:326 r600_texture_get_fmask_info - Got error in surface_init while allocating FMASK.
-----
is still present. 

Probably is like smoki said, dri3 is problem here and if there's no official support for dri3, should we really care about it for now?
Comment 16 Marek Olšák 2015-02-21 13:51:19 UTC
Apparently, MSAA doesn't work with DRI3. I think it's a bug in st/dri.
Comment 17 smoki 2015-08-09 07:04:21 UTC
 This works fine for me in current ddx and mesa in DRI3 mode.

 Please recheck with current mesa.
Comment 18 Marek Olšák 2015-08-09 10:10:56 UTC
This might have fixed this:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6611f65047575054a38ce83ebfe0331e39e1774f
Comment 19 Marek Olšák 2015-08-24 22:23:21 UTC
(In reply to smoki from comment #17)
>  This works fine for me in current ddx and mesa in DRI3 mode.
> 
>  Please recheck with current mesa.

(In reply to Marek Olšák from comment #18)
> This might have fixed this:
> http://cgit.freedesktop.org/mesa/mesa/commit/
> ?id=6611f65047575054a38ce83ebfe0331e39e1774f

Closing.

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.