[Mesa-dev] [PATCH 2/2] radeonsi: Use pointers rather than resource descriptors for shader constants v3
Laurent Carlier
lordheavym at gmail.com
Tue Aug 6 02:12:39 PDT 2013
Le mardi 6 août 2013 01:11:44 vous avez écrit :
> Le lundi 5 août 2013 14:58:44 Tom Stellard a écrit :
> > From: Tom Stellard <thomas.stellard at amd.com>
> >
> > The TGSI->LLVM pass for radeonsi preloads constants and relies on LLVM's
> > sinking pass to reduce SGPR usage by lowering constant reads to an
> > optimal place in the code. However, LLVM's machine sink pass will not
> > lower instructions that have been selected from llvm.SI.load.const
> > intrinsics, because these instructions do not have a MachineMemOperand,
> > which LLVM needs in order to determine whether or not it is safe to sink
> > a load. Replacing this intrinsic with a real load instruction will
> > enable the sinking optimization and probably a few others.
> >
> > The other advantages of using pointers are:
> > + Reduced register usage (pointers take 2 registers, descriptors take 4)
> > + More code sharing with compute
> >
> > This should also fix some crashes due to the compiler running out of
> > registers like in this bug:
> >
> > https://bugs.freedesktop.org/show_bug.cgi?id=66805
> >
> > v2:
> > - Mark constant loads as invariant, so the machine sink pass will
> >
> > actually lower them.
> >
> > v3:
> > - Correctly specify the invariant.load metadata
> >
> > ---
>
> Both patches are working properly with Portal, but got these with Dungeon
> Defenders (game segfault before the game menu):
>
> si_state_draw.c:242:si_pipe_shader_ps: Assertion `num_sgprs <= 104' failed.
> si_state_draw.c:242:si_pipe_shader_ps: Assertion `num_sgprs <= 104' failed.
> Steam: An X Error occurred
> X Error of failed request: BadWindow (invalid Window parameter)
> Major opcode of failed request: 40 (X_TranslateCoords)
> Resource id in failed request: 0x1cfa9cb
> Serial number of failed request: 116812
> xerror_handler: X failed, continuing
> Game removed: AppID 65800 "Dungeon Defenders", ProcID 1078
And in the kernel log:
Aug 06 11:08:12 archMain kernel: DungeonDefender: page allocation failure:
order:4, mode:0x10c0d0
Aug 06 11:08:12 archMain kernel: CPU: 5 PID: 15921 Comm: DungeonDefender
Tainted: G C 3.11.0-14-agd5f #1
Aug 06 11:08:12 archMain kernel: Hardware name: Gigabyte Technology Co., Ltd.
GA-890GPA-UD3H/GA-890GPA-UD3H, BIOS FF 11/24/2010
Aug 06 11:08:12 archMain kernel: 0000000000000000 ffff880076d538e8 ffffffff814d9628
000000000010c0d0
Aug 06 11:08:12 archMain kernel: ffff880076d53970 ffffffff81136b70 00000000ffffffff
ffff88022fffab38
Aug 06 11:08:12 archMain kernel: 000000000000000e ffff880076d53940 ffffffff00000040
0000000000000005
Aug 06 11:08:12 archMain kernel: Call Trace:
Aug 06 11:08:12 archMain kernel: [<ffffffff814d9628>] dump_stack+0x54/0x8d
Aug 06 11:08:12 archMain kernel: [<ffffffff81136b70>]
warn_alloc_failed+0xf0/0x140
Aug 06 11:08:12 archMain kernel: [<ffffffff8113af54>]
__alloc_pages_nodemask+0x864/0xa70
Aug 06 11:08:12 archMain kernel: [<ffffffff81177529>]
alloc_pages_current+0xa9/0x160
Aug 06 11:08:12 archMain kernel: [<ffffffff81135d4e>] __get_free_pages+0xe/0x50
Aug 06 11:08:12 archMain kernel: [<ffffffff8117ea3e>]
kmalloc_order_trace+0x2e/0xe0
Aug 06 11:08:12 archMain kernel: [<ffffffff81182576>] __kmalloc+0x266/0x2b0
Aug 06 11:08:12 archMain kernel: [<ffffffffa08a7168>] ?
radeon_cs_parser_init+0x178/0x640 [radeon]
Aug 06 11:08:12 archMain kernel: [<ffffffffa08a77e9>] ?
radeon_cs_ioctl+0xf9/0x9c0 [radeon]
Aug 06 11:08:12 archMain kernel: [<ffffffffa08a7811>] radeon_cs_ioctl+0x121/0x9c0
[radeon]
Aug 06 11:08:12 archMain kernel: [<ffffffffa06d51a2>] drm_ioctl+0x532/0x660 [drm]
Aug 06 11:08:12 archMain kernel: [<ffffffff810c2cc9>] ? do_futex+0x109/0xad0
Aug 06 11:08:12 archMain kernel: [<ffffffff811b2c95>] ? d_free+0x55/0x60
Aug 06 11:08:12 archMain kernel: [<ffffffff8108f0d4>] ?
lg_global_unlock+0x44/0x90
Aug 06 11:08:12 archMain kernel: [<ffffffff811bb2d0>] ?
mntput_no_expire+0x100/0x150
Aug 06 11:08:12 archMain kernel: [<ffffffffa0930a14>]
radeon_kms_compat_ioctl+0x14/0x30 [radeon]
Aug 06 11:08:12 archMain kernel: [<ffffffff811ed871>]
compat_sys_ioctl+0xd1/0x11f0
Aug 06 11:08:12 archMain kernel: [<ffffffff810c3ab1>] ?
compat_SyS_futex+0x71/0x140
Aug 06 11:08:12 archMain kernel: [<ffffffff814e1729>] ?
do_device_not_available+0x19/0x20
Aug 06 11:08:12 archMain kernel: [<ffffffff814ea0ac>] cstar_dispatch+0x7/0x21
Aug 06 11:08:12 archMain kernel: Mem-Info:
Aug 06 11:08:12 archMain kernel: Node 0 DMA per-cpu:
Aug 06 11:08:12 archMain kernel: CPU 0: hi: 0, btch: 1 usd: 0
Aug 06 11:08:12 archMain kernel: CPU 1: hi: 0, btch: 1 usd: 0
Aug 06 11:08:12 archMain kernel: CPU 2: hi: 0, btch: 1 usd: 0
Aug 06 11:08:12 archMain kernel: CPU 3: hi: 0, btch: 1 usd: 0
Aug 06 11:08:12 archMain kernel: CPU 4: hi: 0, btch: 1 usd: 0
Aug 06 11:08:12 archMain kernel: CPU 5: hi: 0, btch: 1 usd: 0
Aug 06 11:08:12 archMain kernel: Node 0 DMA32 per-cpu:
Aug 06 11:08:12 archMain kernel: CPU 0: hi: 186, btch: 31 usd: 0
Aug 06 11:08:12 archMain kernel: CPU 1: hi: 186, btch: 31 usd: 0
Aug 06 11:08:12 archMain kernel: CPU 2: hi: 186, btch: 31 usd: 0
Aug 06 11:08:12 archMain kernel: CPU 3: hi: 186, btch: 31 usd: 0
Aug 06 11:08:12 archMain kernel: CPU 4: hi: 186, btch: 31 usd: 0
Aug 06 11:08:12 archMain kernel: CPU 5: hi: 186, btch: 31 usd: 0
Aug 06 11:08:12 archMain kernel: Node 0 Normal per-cpu:
Aug 06 11:08:12 archMain kernel: CPU 0: hi: 186, btch: 31 usd: 0
Aug 06 11:08:12 archMain kernel: CPU 1: hi: 186, btch: 31 usd: 0
Aug 06 11:08:12 archMain kernel: CPU 2: hi: 186, btch: 31 usd: 0
Aug 06 11:08:12 archMain kernel: CPU 3: hi: 186, btch: 31 usd: 28
Aug 06 11:08:12 archMain kernel: CPU 4: hi: 186, btch: 31 usd: 0
Aug 06 11:08:12 archMain kernel: CPU 5: hi: 186, btch: 31 usd: 0
Aug 06 11:08:12 archMain kernel: active_anon:1319503 inactive_anon:448794
isolated_anon:0
active_file:13755 inactive_file:13477
isolated_file:0
unevictable:37 dirty:722 writeback:0
unstable:0
free:35116 slab_reclaimable:16819
slab_unreclaimable:24942
mapped:34099 shmem:13836 pagetables:15410
bounce:0
free_cma:0
Aug 06 11:08:12 archMain kernel: Node 0 DMA free:15872kB min:128kB low:160kB
high:192kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB
unevictable:0kB isolated(anon):0kB isolated(file):0kB present:15972kB
managed:158
Aug 06 11:08:12 archMain kernel: lowmem_reserve[]: 0 3233 7968 7968
Aug 06 11:08:12 archMain kernel: Node 0 DMA32 free:61444kB min:27372kB
low:34212kB high:41056kB active_anon:2058304kB inactive_anon:957380kB
active_file:12504kB inactive_file:12020kB unevictable:132kB isolated(anon):0kB
isolated(file):0k
Aug 06 11:08:12 archMain kernel: lowmem_reserve[]: 0 0 4734 4734
Aug 06 11:08:12 archMain kernel: Node 0 Normal free:63148kB min:40076kB
low:50092kB high:60112kB active_anon:3219708kB inactive_anon:837796kB
active_file:42516kB inactive_file:41888kB unevictable:16kB isolated(anon):0kB
isolated(file):0k
Aug 06 11:08:12 archMain kernel: lowmem_reserve[]: 0 0 0 0
Aug 06 11:08:12 archMain kernel: Node 0 DMA: 0*4kB 0*8kB 0*16kB 0*32kB 2*64kB
(U) 1*128kB (U) 1*256kB (U) 0*512kB 1*1024kB (U) 1*2048kB (R) 3*4096kB (M) =
15872kB
Aug 06 11:08:12 archMain kernel: Node 0 DMA32: 1194*4kB (UEM) 115*8kB (UEM)
3105*16kB (UEM) 202*32kB (M) 1*64kB (M) 0*128kB 0*256kB 0*512kB 0*1024kB
0*2048kB 0*4096kB = 61904kB
Aug 06 11:08:12 archMain kernel: Node 0 Normal: 15004*4kB (UEM) 260*8kB (UM)
65*16kB (UM) 7*32kB (UM) 1*64kB (M) 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB
0*4096kB = 63424kB
Aug 06 11:08:12 archMain kernel: Node 0 hugepages_total=0 hugepages_free=0
hugepages_surp=0 hugepages_size=2048kB
Aug 06 11:08:12 archMain kernel: 188367 total pagecache pages
Aug 06 11:08:12 archMain kernel: 147293 pages in swap cache
Aug 06 11:08:12 archMain kernel: Swap cache stats: add 2106427, delete
1959134, find 1134141/1247396
Aug 06 11:08:12 archMain kernel: Free swap = 19736044kB
Aug 06 11:08:12 archMain kernel: Total swap = 22557396kB
Aug 06 11:08:12 archMain kernel: 2097151 pages RAM
Aug 06 11:08:12 archMain kernel: 52600 pages reserved
Aug 06 11:08:12 archMain kernel: 1482060 pages shared
Aug 06 11:08:12 archMain kernel: 1899474 pages non-shared
Aug 06 11:08:12 archMain kernel: [drm:radeon_cs_ioctl] *ERROR* Failed to parse
relocation -12!
Aug 06 11:08:14 archMain kernel: traps: DungeonDefender[15927] trap int3
ip:f5756ad4 sp:f06fe050 error:0
--
Laurent Carlier
ArchLinux Developer
http://www.archlinux.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130806/0de35aad/attachment.pgp>
More information about the mesa-dev
mailing list