Compilation error in nouveau_exa.c
Dear nouveau team,
compilation of the Nouveau driver is currently failing for me with the following error:
Quoted 18 lines
gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include/xorg -I/usr/local/include -I/usr/local/include/drm -I/usr/pkg/include/pixman-1 -I/usr/pkg/include -I/usr/pkg/include/X11/dri -I/usr/local/include -I/usr/local/include/drm -I/usr/local/include/nouveau -g -O2 -Wall -minline-all-stringops -I/usr/local/include/xorg -I/usr/local/include -I/usr/local/include/drm -I/usr/pkg/include/pixman-1 -I/usr/pkg/include -I/usr/pkg/include/X11/dri -MT nouveau_exa.lo -MD -MP -MF .deps/nouveau_exa.Tpo -c
nouveau_exa.c-fPIC -DPIC -o.libs/nouveau_exa.o
In file included from nv_include.h:72,from nouveau_exa.c:23:
nouveau_hw.h: In function 'NVRead':
nouveau_hw.h:43: warning: value computed is not usednouveau_exa.c: In function 'NVAccelDownloadM2MF':
nouveau_exa.c:92: error: 'structnouveau_bo' has no member named 'tile_mode'nouveau_exa.c: In function 'NVAccelUploadM2MF':
nouveau_exa.c:213: error: 'structnouveau_bo' has no member named 'tile_mode'nouveau_exa.c: In function 'nouveau_exa_mph_broken_should_die':
nouveau_exa.c:441: warning: implicit declaration of function 'nouveau_bo_new_tile'nouveau_exa.c: In function 'nouveau_exa_pixmap_is_tiled':
nouveau_exa.c:475: error: 'structnouveau_bo' has no member named 'tile_flags'nouveau_exa.c: In function 'nouveau_exa_pixmap_map':
nouveau_exa.c:493: error: 'structnouveau_bo' has no member named 'tile_flags'nouveau_exa.c: In function 'nouveau_exa_pixmap_unmap':
nouveau_exa.c:521: error: 'structnouveau_bo' has no member named 'tile_flags' *** Error code 1
It used to compile without any problems. I am using:
- NetBSD 5.0 stable
- xorg-server 1.5.3
- libX11 1.1.5
- libxcb 1.1
- Mesa 7.4
- libdrm 2.4.7
Hints?
Signature · 1 line
khorben
Quoted 5 lines · On Wed, 10 Jun 2009 14:11:55 +0200 Pierre Pronchery…
Dear nouveau team,
compilation of the Nouveau driver is currently failing for me with the following error:
<snip>
Quoted 10 lines
It used to compile without any problems. I am using:
- NetBSD 5.0 stable
- xorg-server 1.5.3
- libX11 1.1.5
- libxcb 1.1
- Mesa 7.4
- libdrm 2.4.7Hints?
Yes. Use libdrm and DRM kernel modules from drm.git master, the latest revision.
Signature · 2 lines
Pekka Paalanen http://www.iki.fi/pq/
Am Wed, 10 Jun 2009 16:45:12 +0300
schrieb Pekka Paalanen <[email protected]>:
Quoted 18 lines
Quoted 5 lines · On Wed, 10 Jun 2009 14:11:55 +0200 Pierre Pronchery…
Dear nouveau team,
compilation of the Nouveau driver is currently failing for me with the following error:
<snip>
Quoted 9 lines
It used to compile without any problems. I am using:
- NetBSD 5.0 stable
- xorg-server 1.5.3
- libX11 1.1.5
- libxcb 1.1
- Mesa 7.4
- libdrm 2.4.7
Quoted 5 lines
Quoted 1 line
Hints?
Yes. Use libdrm and DRM kernel modules from drm.git master, the latest revision.
Same error here. ArchLinux kernel 2.6.30, libdrm 2.4.11 release, git drm module and current git nouveau shot.
I've seen commits nv50 related to "tile" stuff. May this be the breaker?
-Andy
Quoted 23 lines · Andreas Radke
Am Wed, 10 Jun 2009 16:45:12 +0300
schrieb Pekka Paalanen <[email protected]>:Quoted 20 lines
Quoted 5 lines · On Wed, 10 Jun 2009 14:11:55 +0200 Pierre Pronchery…
Dear nouveau team,
compilation of the Nouveau driver is currently failing for me with the following error:
<snip>
Quoted 10 lines
It used to compile without any problems. I am using:
- NetBSD 5.0 stable
- xorg-server 1.5.3
- libX11 1.1.5
- libxcb 1.1
- Mesa 7.4
- libdrm 2.4.7Hints?
Quoted 8 lines
Quoted 3 lines
Yes. Use libdrm and DRM kernel modules from drm.git master, the latest revision.
Same error here. ArchLinux kernel 2.6.30, libdrm 2.4.11 release, git drm module and current git nouveau shot.
I've seen commits nv50 related to "tile" stuff. May this be the breaker?
You missed the "Use libdrm from drm.git master" in the previous message.
Ben.
Quoted 6 lines
-Andy
_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau
PATCH 1/1 nv50/gallium patch series 2
In reply to a message not in the archiveHere's some patches for nv50 shaders again, at least the first two shouldn't be crap.
The changes introduced in 0008 are probably a crazy/dumb idea, I'd like to have a better implementation of the register setting stuff.
I haven't extensively tested them yet (probably still need to make some modifications), but from running some demos nothing seems to have broken.
The GLSL brick shader demo should work now (except that no normals are produced, workaround: put gl_Normal to e_z (0, 0, 1) in the vertex shader).
If I've created too many hacks, I'll be happy when other people have time to start making better nice & clean Gallium3d code :-)
Now, time to fix some bugs, instead of introducing new stuff like these patches do.
Christoph
From 5fd08781d99bb15f0e882fb1fbd20277a4a6b2b6 Mon Sep 17 00:00:00 2001
From: Christoph Bumiller <e0425955-oe7qfRrRQffzPE21tAIdciO7C/[email protected]>
Date: Sun, 21 Jun 2009 17:28:49 +0200
Subject: [PATCH] nvXX: format_supported needs to check DEPTH_STENCIL usage
See commit 0342229289c3bd5ed7bc595db4fc88003430209e. An earlier commit also caused us being given an unsupported depth buffer format.
--- src/gallium/drivers/nv04/nv04_screen.c | 7 +++++++ src/gallium/drivers/nv10/nv10_screen.c | 7 +++++++ src/gallium/drivers/nv20/nv20_screen.c | 7 +++++++ src/gallium/drivers/nv30/nv30_screen.c | 7 +++++++ src/gallium/drivers/nv40/nv40_screen.c | 7 +++++++ src/gallium/drivers/nv50/nv50_screen.c | 7 +++++++ 6 files changed, 42 insertions(+), 0 deletions(-)
src/gallium/drivers/nv04/nv04_screen.c +7 -0
@@ -79,6 +79,13 @@ nv04_screen_is_format_supported(struct pipe_screen *screen,switch (format) {case PIPE_FORMAT_A8R8G8B8_UNORM :case PIPE_FORMAT_R5G6B5_UNORM : +return TRUE; +default : +break ; + } + }else +if (tex_usage &PIPE_TEXTURE_USAGE_DEPTH_STENCIL ) { +switch (format) {case PIPE_FORMAT_Z16_UNORM :return TRUE;default :
src/gallium/drivers/nv10/nv10_screen.c +7 -0
@@ -74,6 +74,13 @@ nv10_screen_is_format_supported(struct pipe_screen *screen,switch (format) {case PIPE_FORMAT_A8R8G8B8_UNORM :case PIPE_FORMAT_R5G6B5_UNORM : +return TRUE; +default : +break ; + } + }else +if (tex_usage &PIPE_TEXTURE_USAGE_DEPTH_STENCIL ) { +switch (format) {case PIPE_FORMAT_Z24S8_UNORM :case PIPE_FORMAT_Z16_UNORM :return TRUE;
src/gallium/drivers/nv20/nv20_screen.c +7 -0
@@ -74,6 +74,13 @@ nv20_screen_is_format_supported(struct pipe_screen *screen,switch (format) {case PIPE_FORMAT_A8R8G8B8_UNORM :case PIPE_FORMAT_R5G6B5_UNORM : +return TRUE; +default : +break ; + } + }else +if (tex_usage &PIPE_TEXTURE_USAGE_DEPTH_STENCIL ) { +switch (format) {case PIPE_FORMAT_Z24S8_UNORM :case PIPE_FORMAT_Z16_UNORM :return TRUE;
src/gallium/drivers/nv30/nv30_screen.c +7 -0
@@ -85,6 +85,13 @@ nv30_screen_surface_format_supported(struct pipe_screen *pscreen,switch (format) {case PIPE_FORMAT_A8R8G8B8_UNORM :case PIPE_FORMAT_R5G6B5_UNORM : +return TRUE; +default : +break ; + } + }else +if (tex_usage &PIPE_TEXTURE_USAGE_DEPTH_STENCIL ) { +switch (format) {case PIPE_FORMAT_Z24S8_UNORM :case PIPE_FORMAT_Z16_UNORM :return TRUE;
src/gallium/drivers/nv40/nv40_screen.c +7 -0
@@ -86,6 +86,13 @@ nv40_screen_surface_format_supported(struct pipe_screen *pscreen,switch (format) {case PIPE_FORMAT_A8R8G8B8_UNORM :case PIPE_FORMAT_R5G6B5_UNORM : +return TRUE; +default : +break ; + } + }else +if (tex_usage &PIPE_TEXTURE_USAGE_DEPTH_STENCIL ) { +switch (format) {case PIPE_FORMAT_Z24S8_UNORM :case PIPE_FORMAT_Z16_UNORM :return TRUE;
src/gallium/drivers/nv50/nv50_screen.c +7 -0
@@ -37,6 +37,13 @@ nv50_screen_is_format_supported(struct pipe_screen *pscreen,switch (format) {case PIPE_FORMAT_A8R8G8B8_UNORM :case PIPE_FORMAT_R5G6B5_UNORM : +return TRUE; +default : +break ; + } + }else +if (tex_usage &PIPE_TEXTURE_USAGE_DEPTH_STENCIL ) { +switch (format) {case PIPE_FORMAT_Z24S8_UNORM :case PIPE_FORMAT_Z16_UNORM :return TRUE;
Signature · 1 line
1.6.0.6
From fc699035d9f6f3b616ee4ab997c76f10ffb1f537 Mon Sep 17 00:00:00 2001
From: Christoph Bumiller <e0425955-oe7qfRrRQffzPE21tAIdciO7C/[email protected]>
Date: Mon, 15 Jun 2009 14:01:20 +0200
Subject: [PATCH] nv50: fix HPOS mapping when there are no FP attrs
--- src/gallium/drivers/nv50/nv50_program.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
src/gallium/drivers/nv50/nv50_program.c +3 -2
@@ -1796,6 +1796,8 @@ nv50_program_tx_prep(struct nv50_pc *pc)if (pc->p->type ==PIPE_SHADER_FRAGMENT ) { pc->p->cfg.fp.regs[0 ] =0x01000404 ; pc->p->cfg.fp.regs[1 ] =0x00000400 ; + pc->p->cfg.fp.map[0 ] =0x03020100 ; + pc->p->cfg.fp.high_map =1 ; }tgsi_parse_init (&p, pc->p->pipe.tokens);
@@ -1954,9 +1956,8 @@ nv50_program_tx_prep(struct nv50_pc *pc) &mid, &aid, &oid); oid =0 ; pc->p->cfg.fp.regs[1 ] |= (mask <<24 ); - pc->p->cfg.fp.map[0 ] =0x04040404 * fcrd; + pc->p->cfg.fp.map[0 ] +=0x04040404 * fcrd; } - pc->p->cfg.fp.map[0 ] +=0x03020100 ;/* should do MAD fcrd.xy, fcrd, SOME_CONST, fcrd */
Signature · 1 line
1.6.0.6
From 53d1ed91ed780102b39761cbac7b790a9e906d83 Mon Sep 17 00:00:00 2001
From: Christoph Bumiller <e0425955-oe7qfRrRQffzPE21tAIdciO7C/[email protected]>
Date: Sun, 21 Jun 2009 18:00:48 +0200
Subject: [PATCH] nv50: select shader program through VP/FP_START_ID
Instead of specifying the program buffer address on every program change, just set an offset in a shared program buffer, like the binary driver does.
--- src/gallium/drivers/nv50/nv50_context.h | 6 ++ src/gallium/drivers/nv50/nv50_program.c | 78 +++++++++++------------------ src/gallium/drivers/nv50/nv50_program.h | 1 + src/gallium/drivers/nv50/nv50_screen.c | 27 ++++++++++- src/gallium/drivers/nv50/nv50_screen.h | 2 + src/gallium/drivers/nv50/nv50_transfer.c | 12 +++++ 6 files changed, 77 insertions(+), 49 deletions(-)
src/gallium/drivers/nv50/nv50_context.h +6 -0
@@ -198,4 +198,10 @@ extern boolean nv50_state_validate(struct nv50_context *nv50);/* nv50_tex.c */ extern void nv50_tex_validate (struct nv50_context *); +/* nv50_transfer.c */ +extern void nv50_transfer_gart_vram (struct pipe_screen *pscreen, +struct nouveau_bo *dst,unsigned dst_off, +struct nouveau_bo *src,unsigned src_off, +unsigned size); +#endif
src/gallium/drivers/nv50/nv50_program.c +30 -48
137 lines not on this page · raw message
src/gallium/drivers/nv50/nv50_program.h +1 -0
@@ -27,6 +27,7 @@ struct nv50_program {struct nouveau_resource *data[2 ];unsigned data_start[2 ]; +struct nouveau_resource *code;struct nouveau_bo *bo;float *immd;
src/gallium/drivers/nv50/nv50_screen.c +26 -1
@@ -266,7 +266,7 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)so_ref (NULL , &so);/* Static tesla init */ - so =so_new (256 ,20 ); + so =so_new (256 ,24 );so_method (so, screen->tesla,0x1558 ,1 );so_data (so,1 );
@@ -290,6 +290,31 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)so_method (so, screen->tesla,0x16b8 ,1 );so_data (so,8 ); +/* create VRAM buffers for shader programs */ +for (i =0 ; i <2 ; i++) { + ret =nouveau_bo_new (dev,NOUVEAU_BO_VRAM ,0x100 ,0x10000 , + &screen->sprogbuf_code[i]); +if (ret ||nouveau_resource_init ( + &screen->code_heap[i],0 ,0x10000 )) { +NOUVEAU_ERR ("Failed to initialize program buffers." ); +nv50_screen_destroy (pscreen); +return NULL ; + } + } + +/* set program buffer addresses */ +so_method (so, screen->tesla,NV50TCL_VP_ADDRESS_HIGH ,2 ); +so_reloc (so, screen->sprogbuf_code[0 ],0 ,NOUVEAU_BO_VRAM | +NOUVEAU_BO_RD |NOUVEAU_BO_HIGH ,0 ,0 ); +so_reloc (so, screen->sprogbuf_code[0 ],0 ,NOUVEAU_BO_VRAM | +NOUVEAU_BO_RD |NOUVEAU_BO_LOW ,0 ,0 ); + +so_method (so, screen->tesla,NV50TCL_FP_ADDRESS_HIGH ,2 ); +so_reloc (so, screen->sprogbuf_code[1 ],0 ,NOUVEAU_BO_VRAM | +NOUVEAU_BO_RD |NOUVEAU_BO_HIGH ,0 ,0 ); +so_reloc (so, screen->sprogbuf_code[1 ],0 ,NOUVEAU_BO_VRAM | +NOUVEAU_BO_RD |NOUVEAU_BO_LOW ,0 ,0 ); +/* constant buffers for immediates and VP/FP parameters */ ret =nouveau_bo_new (dev,NOUVEAU_BO_VRAM ,0 ,128 *4 *4 , &screen->constbuf_misc[0 ]);
src/gallium/drivers/nv50/nv50_screen.h +2 -0
@@ -17,9 +17,11 @@ struct nv50_screen {struct nouveau_bo *constbuf_misc[1 ];struct nouveau_bo *constbuf_parm[2 ]; +struct nouveau_bo *sprogbuf_code[2 ];struct nouveau_resource *immd_heap[1 ];struct nouveau_resource *parm_heap[2 ]; +struct nouveau_resource *code_heap[2 ];struct nouveau_bo *tic;struct nouveau_bo *tsc;
src/gallium/drivers/nv50/nv50_transfer.c +12 -0
@@ -99,6 +99,18 @@ nv50_transfer_rect_m2mf(struct pipe_screen *pscreen, struct nouveau_bo *src_bo, } } +void +nv50_transfer_gart_vram (struct pipe_screen *pscreen, +struct nouveau_bo *dst,unsigned dst_offset, +struct nouveau_bo *src,unsigned src_offset, +unsigned size) +{ +nv50_transfer_rect_m2mf (pscreen, + src, src_offset, size,0 ,0 ,0 ,0 , + dst, dst_offset, size,0 ,0 ,0 ,0 , +1 , size,1 ,NOUVEAU_BO_GART ,NOUVEAU_BO_VRAM ); +} +static struct pipe_transfer * nv50_transfer_new(struct pipe_screen *pscreen, struct pipe_texture *pt, unsigned face, unsigned level, unsigned zslice,
Signature · 1 line
1.6.0.6
From 67ab4faa42e5e45f64349a4d0de75dbaafd9f793 Mon Sep 17 00:00:00 2001
From: Christoph Bumiller <e0425955-oe7qfRrRQffzPE21tAIdciO7C/[email protected]>
Date: Sun, 21 Jun 2009 17:49:08 +0200
Subject: [PATCH] nv50: use ctor_reg to initialize nv50_regs
--- src/gallium/drivers/nv50/nv50_program.c | 102 ++++++++++++++---------------- 1 files changed, 48 insertions(+), 54 deletions(-)
src/gallium/drivers/nv50/nv50_program.c +48 -54
189 lines not on this page · raw message
Signature · 1 line
1.6.0.6
From de5864598aa5b6042a79ca8886d74c6e7027a32c Mon Sep 17 00:00:00 2001
From: Christoph Bumiller <e0425955-oe7qfRrRQffzPE21tAIdciO7C/[email protected]>
Date: Sun, 21 Jun 2009 17:50:37 +0200
Subject: [PATCH] nv50: use register count from tgsi program info
--- src/gallium/drivers/nv50/nv50_program.c | 57 +++++++++++++++++-------------- 1 files changed, 31 insertions(+), 26 deletions(-)
src/gallium/drivers/nv50/nv50_program.c +31 -26
103 lines not on this page · raw message
Signature · 1 line
1.6.0.6
From c79799803e461263373be23592ac861c7b19f018 Mon Sep 17 00:00:00 2001
From: Christoph Bumiller <e0425955-oe7qfRrRQffzPE21tAIdciO7C/[email protected]>
Date: Sat, 20 Jun 2009 20:48:48 +0200
Subject: [PATCH] nv50: move some stuff into nv50_program_tx_postprocess
The _postprocess function is called in nv50_program_tx and performs moving of FP outputs, will append clipping distance calculations, and converts unpaired half insn to long.
--- src/gallium/drivers/nv50/nv50_program.c | 91 ++++++++++++++++--------------- 1 files changed, 48 insertions(+), 43 deletions(-)
src/gallium/drivers/nv50/nv50_program.c +48 -43
114 lines not on this page · raw message
Signature · 1 line
1.6.0.6
From 7356ccfe976cb61a30e480a315daf37f84b3f533 Mon Sep 17 00:00:00 2001
From: Christoph Bumiller <e0425955-oe7qfRrRQffzPE21tAIdciO7C/[email protected]>
Date: Sun, 21 Jun 2009 18:03:29 +0200
Subject: [PATCH] nv50: add support for two-sided lighting
--- src/gallium/drivers/nv50/nv50_context.h | 1 + src/gallium/drivers/nv50/nv50_program.c | 171 ++++++++++++++++++------ src/gallium/drivers/nv50/nv50_program.h | 1 + src/gallium/drivers/nv50/nv50_state_validate.c | 3 + 4 files changed, 138 insertions(+), 38 deletions(-)
src/gallium/drivers/nv50/nv50_context.h +1 -0
@@ -190,6 +190,7 @@ extern void nv50_clear(struct pipe_context *pipe, unsigned buffers,/* nv50_program.c */ extern void nv50_vertprog_validate (struct nv50_context *nv50);extern void nv50_fragprog_validate (struct nv50_context *nv50); +extern void nv50_linkage_validate (struct nv50_context *nv50);extern void nv50_program_destroy (struct nv50_context *nv50,struct nv50_program *p);/* nv50_state_validate.c */
src/gallium/drivers/nv50/nv50_program.c +133 -38
269 lines not on this page · raw message
src/gallium/drivers/nv50/nv50_program.h +1 -0
@@ -39,6 +39,7 @@ struct nv50_program {unsigned high_result;struct {unsigned attr[2 ]; +unsigned bcol; } vp;struct {unsigned regs[4 ];
src/gallium/drivers/nv50/nv50_state_validate.c +3 -0
@@ -199,6 +199,9 @@ nv50_state_validate(struct nv50_context *nv50)if (nv50->dirty & (NV50_NEW_FRAGPROG |NV50_NEW_FRAGPROG_CB ))nv50_fragprog_validate (nv50); +if (nv50->dirty & (NV50_NEW_VERTPROG |NV50_NEW_FRAGPROG )) +nv50_linkage_validate (nv50); +if (nv50->dirty &NV50_NEW_RASTERIZER )so_ref (nv50->rasterizer->so, &nv50->state.rast);
Signature · 1 line
1.6.0.6
From 8bd2ef6b2dc165d76b6ad30893bc62d894dafac1 Mon Sep 17 00:00:00 2001
From: Christoph Bumiller <e0425955-oe7qfRrRQffzPE21tAIdciO7C/[email protected]>
Date: Sun, 21 Jun 2009 18:16:52 +0200
Subject: [PATCH] nv50: introduce linkage stateobj
An attempt to improve performance, since assembling the VP output to FP input map became a mess.
This probably makes it even worse: It creates VP, FP stateobjs only once and introduces a third shader related stateobj, called linkage, which is stored in a list object that is obtained or created on validation. For each configuration (VP, FP, BFC, PTSZ) there is an extra object.
--- src/gallium/drivers/nv50/nv50_context.h | 1 + src/gallium/drivers/nv50/nv50_program.c | 143 +++++++++++++++++++----- src/gallium/drivers/nv50/nv50_program.h | 10 ++ src/gallium/drivers/nv50/nv50_state_validate.c | 2 + 4 files changed, 129 insertions(+), 27 deletions(-)
src/gallium/drivers/nv50/nv50_context.h +1 -0
@@ -117,6 +117,7 @@ struct nv50_state {unsigned miptree_nr;struct nouveau_stateobj *vertprog;struct nouveau_stateobj *fragprog; +struct nouveau_stateobj *plinkage;struct nouveau_stateobj *vtxfmt;struct nouveau_stateobj *vtxbuf; };
src/gallium/drivers/nv50/nv50_program.c +116 -27
177 lines not on this page · raw message
src/gallium/drivers/nv50/nv50_program.h +10 -0
@@ -15,6 +15,13 @@ struct nv50_program_exec { } param; }; +struct nv50_linkage { +struct nv50_linkage *next[2 ]; +struct nouveau_stateobj *so; +void *prog[2 ]; +unsigned cfg; +}; +struct nv50_program {struct pipe_shader_state pipe;struct tgsi_shader_info info;
@@ -34,6 +41,9 @@ struct nv50_program {unsigned immd_nr;unsigned param_nr; +struct nouveau_stateobj *so; +struct nv50_linkage *ln; +struct {unsigned high_temp;unsigned high_result;
src/gallium/drivers/nv50/nv50_state_validate.c +2 -0
@@ -150,6 +150,8 @@ nv50_state_emit(struct nv50_context *nv50)so_emit (chan, nv50->state.vertprog);if (nv50->state.dirty &NV50_NEW_FRAGPROG )so_emit (chan, nv50->state.fragprog); +if (nv50->state.dirty & (NV50_NEW_VERTPROG |NV50_NEW_FRAGPROG )) +so_emit (chan, nv50->state.plinkage);if (nv50->state.dirty &NV50_NEW_RASTERIZER )so_emit (chan, nv50->state.rast);if (nv50->state.dirty &NV50_NEW_BLEND_COLOUR )
Signature · 1 line
1.6.0.6
From 9a4c0166cbfff6402e14f79b622357d7228ae3d4 Mon Sep 17 00:00:00 2001
From: Christoph Bumiller <e0425955-oe7qfRrRQffzPE21tAIdciO7C/[email protected]>
Date: Sun, 21 Jun 2009 18:25:25 +0200
Subject: [PATCH] nv50: support for user clip planes
--- src/gallium/drivers/nv50/nv50_context.h | 1 + src/gallium/drivers/nv50/nv50_program.c | 95 ++++++++++++++++++++++++++++--- src/gallium/drivers/nv50/nv50_program.h | 2 + src/gallium/drivers/nv50/nv50_state.c | 4 + 4 files changed, 94 insertions(+), 8 deletions(-)
src/gallium/drivers/nv50/nv50_context.h +1 -0
@@ -140,6 +140,7 @@ struct nv50_context {struct pipe_poly_stipple stipple;struct pipe_scissor_state scissor;struct pipe_viewport_state viewport; +struct pipe_clip_state clip;struct pipe_framebuffer_state framebuffer;struct nv50_program *vertprog;struct nv50_program *fragprog;
src/gallium/drivers/nv50/nv50_program.c +87 -8
183 lines not on this page · raw message
src/gallium/drivers/nv50/nv50_program.h +2 -0
@@ -50,6 +50,8 @@ struct nv50_program {struct {unsigned attr[2 ];unsigned bcol; +unsigned clip_ctrl; +struct pipe_clip_state ucp; } vp;struct {unsigned regs[4 ];
src/gallium/drivers/nv50/nv50_state.c +4 -0
@@ -549,6 +549,10 @@ static void nv50_set_clip_state(struct pipe_context *pipe, const struct pipe_clip_state *clip) { + struct nv50_context *nv50 = nv50_context(pipe); + + nv50->clip = *clip; + nv50->dirty |=NV50_NEW_VERTPROG_CB ; } static void
Signature · 1 line
1.6.0.6
From fd28b304a8cc49eb97955b820f84bb8c76a08dd1 Mon Sep 17 00:00:00 2001
From: Christoph Bumiller <e0425955-oe7qfRrRQffzPE21tAIdciO7C/[email protected]>
Date: Sun, 21 Jun 2009 14:22:43 +0200
Subject: [PATCH] nv50: support point_size_per_vertex
--- src/gallium/drivers/nv50/nv50_program.c | 9 +++++++++ src/gallium/drivers/nv50/nv50_program.h | 1 + 2 files changed, 10 insertions(+), 0 deletions(-)
src/gallium/drivers/nv50/nv50_program.c +9 -0
@@ -1845,6 +1845,9 @@ nv50_program_tx_prep(struct nv50_pc *pc)if (pc->p->type ==PIPE_SHADER_VERTEX ) bcol[c] = first;break ; +case TGSI_SEMANTIC_PSIZE : + pc->p->cfg.vp.ptsz = first *4 ; +break ;default :break ; }
@@ -2645,6 +2648,12 @@ nv50_linkage_create(struct nv50_context *nv50) map[m /4 ] |= k << (8 * (m %4 )); } +if (nv50->rasterizer->pipe.point_size_per_vertex) { + map[m /4 ] |= vp->cfg.vp.ptsz << (8 * (m %4 )); + regs[3 ] |= (m <<4 ) |1 ; + m++; + } +so_method (so, tesla,0x16ac ,2 );so_data (so, m);so_data (so, vp->cfg.high_temp);
src/gallium/drivers/nv50/nv50_program.h +1 -0
@@ -50,6 +50,7 @@ struct nv50_program {struct {unsigned attr[2 ];unsigned bcol; +unsigned ptsz;unsigned clip_ctrl;struct pipe_clip_state ucp; } vp;
Signature · 1 line
1.6.0.6
From 3f4008a60551335324d9b9a874e9df31c57e415c Mon Sep 17 00:00:00 2001
From: Christoph Bumiller <e0425955-oe7qfRrRQffzPE21tAIdciO7C/[email protected]>
Date: Sun, 21 Jun 2009 19:07:09 +0200
Subject: [PATCH] nv50: better insn generation
Don't use extra TEMPs unnecessarily in some cases.
--- src/gallium/drivers/nv50/nv50_program.c | 120 +++++++++++++++--------------- 1 files changed, 60 insertions(+), 60 deletions(-)
src/gallium/drivers/nv50/nv50_program.c +60 -60
215 lines not on this page · raw message
Signature · 1 line
1.6.0.6
From 406a4f6d0f59190c8695763ece51fbf631abece4 Mon Sep 17 00:00:00 2001
From: Christoph Bumiller <e0425955-oe7qfRrRQffzPE21tAIdciO7C/[email protected]>
Date: Sun, 21 Jun 2009 18:40:39 +0200
Subject: [PATCH] nv50: initial support for IF, ELSE, ENDIF insns
--- src/gallium/drivers/nv50/nv50_program.c | 162 +++++++++++++++++++++++++------ src/gallium/drivers/nv50/nv50_program.h | 1 + 2 files changed, 132 insertions(+), 31 deletions(-)
src/gallium/drivers/nv50/nv50_program.c +131 -31
270 lines not on this page · raw message
src/gallium/drivers/nv50/nv50_program.h +1 -0
@@ -13,6 +13,7 @@ struct nv50_program_exec {unsigned mask;unsigned shift; } param; +unsigned bra; };struct nv50_linkage {
Signature · 1 line
1.6.0.6
From 77789c8ef0bc2271d2bfa1b4c961d32261b3b87d Mon Sep 17 00:00:00 2001
From: Christoph Bumiller <e0425955-oe7qfRrRQffzPE21tAIdciO7C/[email protected]>
Date: Sun, 21 Jun 2009 16:14:29 +0200
Subject: [PATCH] nv50: support for SLE, SNE, SEQ, SGT
--- src/gallium/drivers/nv50/nv50_program.c | 118 +++++++++++++++++++++---------- 1 files changed, 80 insertions(+), 38 deletions(-)
src/gallium/drivers/nv50/nv50_program.c +80 -38
194 lines not on this page · raw message
Signature · 1 line
1.6.0.6
From 5773a80dad3041a7a9c10579b8045c09c618f519 Mon Sep 17 00:00:00 2001
From: Christoph Bumiller <e0425955-oe7qfRrRQffzPE21tAIdciO7C/[email protected]>
Date: Sun, 21 Jun 2009 19:01:33 +0200
Subject: [PATCH] nv50: don't allocate in the param buffer
Since we upload all parameters on every program / constbuf change, we don't have to reserve space and can just use the whole buffer.
Doesn't apply to the buffer holding immediates.
--- src/gallium/drivers/nv50/nv50_program.c | 39 ++++++++---------------------- src/gallium/drivers/nv50/nv50_program.h | 6 ++-- 2 files changed, 14 insertions(+), 31 deletions(-)
src/gallium/drivers/nv50/nv50_program.c +11 -28
@@ -2433,7 +2433,7 @@ static void nv50_program_validate_data(struct nv50_context *nv50, struct nv50_program *p) { struct pipe_screen *pscreen = nv50->pipe.screen; -unsigned cbuf, start, count; +unsigned cbuf, count;if (!p->data[0 ] && p->immd_nr) {struct nouveau_resource *heap = nv50->screen->immd_heap[0 ];
@@ -2457,23 +2457,10 @@ nv50_program_validate_data(struct nv50_context *nv50, struct nv50_program *p)if (!p->param_nr)return ; -if (!p->data[1 ]) { -struct nouveau_resource *heap = - nv50->screen->parm_heap[p->type]; - -if (nouveau_resource_alloc (heap, p->param_nr, p, &p->data[1 ])) { -while (heap->next && heap->size < p->param_nr) { -struct nv50_program *evict = heap->next->priv; -nouveau_resource_free (&evict->data[1 ]); - } - -if (nouveau_resource_alloc (heap, p->param_nr, p, - &p->data[1 ])) -assert (0 ); - } - } - - start = p->data[1 ]->start; +/* we can use the whole buffer for parameters as we upload them +* all everytime anyway +*/ +assert (p->param_nr <=128 );if (p->type ==PIPE_SHADER_VERTEX ) { count = p->param_nr - p->cfg.vp.ucp.nr *4 ;
@@ -2486,15 +2473,13 @@ nv50_program_validate_data(struct nv50_context *nv50, struct nv50_program *p)if (count) {float *map =pipe_buffer_map (pscreen, nv50->constbuf[p->type],PIPE_BUFFER_USAGE_CPU_READ ); -nv50_program_upload_data (nv50, map, start, count, cbuf); +nv50_program_upload_data (nv50, map,0 , count, cbuf);pipe_buffer_unmap (pscreen, nv50->constbuf[p->type]); }if (p->param_nr > count) { - start += count; - count = p->cfg.vp.ucp.nr *4 ;nv50_program_upload_data (nv50, &p->cfg.vp.ucp.ucp[0 ][0 ], - start, count, cbuf); + count, p->cfg.vp.ucp.nr *4 , cbuf); } }
@@ -2526,8 +2511,7 @@ nv50_program_validate_code(struct nv50_context *nv50, struct nv50_program *p)assert (!"No more space in program VRAM buffer." ); } -if ((p->data[0 ] && p->data[0 ]->start != p->data_start[0 ]) || - (p->data[1 ] && p->data[1 ]->start != p->data_start[1 ])) +if (p->data[0 ] && p->data[0 ]->start != p->data_start[0 ]) upload = TRUE;if (upload) {
@@ -2546,7 +2530,9 @@ nv50_program_validate_code(struct nv50_context *nv50, struct nv50_program *p) bs = (e->inst[1 ] >>22 ) &0x07 ;assert (bs <2 ); ei = e->param.shift >>5 ; - ci = e->param.index + p->data[bs]->start; + ci = e->param.index; +if (bs ==0 ) + ci += p->data[bs]->start; e->inst[ei] &= ~e->param.mask; e->inst[ei] |= (ci << e->param.shift);
@@ -2554,8 +2540,6 @@ nv50_program_validate_code(struct nv50_context *nv50, struct nv50_program *p)if (p->data[0 ]) p->data_start[0 ] = p->data[0 ]->start; -if (p->data[1 ]) - p->data_start[1 ] = p->data[1 ]->start; }if (!upload)
@@ -2869,7 +2853,6 @@ nv50_program_destroy(struct nv50_context *nv50, struct nv50_program *p)nouveau_bo_ref (NULL , &p->bo);nouveau_resource_free (&p->data[0 ]); -nouveau_resource_free (&p->data[1 ]);nouveau_resource_free (&p->code);while (p->ln)
src/gallium/drivers/nv50/nv50_program.h +3 -3
@@ -32,11 +32,11 @@ struct nv50_program {struct nv50_program_exec *exec_head;struct nv50_program_exec *exec_tail;unsigned exec_size; -struct nouveau_resource *data[2 ]; -unsigned data_start[2 ]; -struct nouveau_resource *code;struct nouveau_bo *bo; +struct nouveau_resource *code; +struct nouveau_resource *data[1 ]; +unsigned data_start[1 ];float *immd;unsigned immd_nr;
Signature · 1 line
1.6.0.6
From fcd949f5771fe47ae1af11e53998d97fa43aa695 Mon Sep 17 00:00:00 2001
From: Christoph Bumiller <e0425955-oe7qfRrRQffzPE21tAIdciO7C/[email protected]>
Date: Sun, 21 Jun 2009 16:54:43 +0200
Subject: [PATCH] nv50: defer FP attribute loading
This might keep the number of used TEMPs down.
--- src/gallium/drivers/nv50/nv50_program.c | 59 ++++++++++++++++++++----------- 1 files changed, 38 insertions(+), 21 deletions(-)
src/gallium/drivers/nv50/nv50_program.c +38 -21
134 lines not on this page · raw message
Signature · 1 line
1.6.0.6
From 1acebc04bb3c0fd562763a777217f88f828be626 Mon Sep 17 00:00:00 2001
From: Christoph Bumiller <e0425955-oe7qfRrRQffzPE21tAIdciO7C/[email protected]>
Date: Sun, 21 Jun 2009 17:11:40 +0200
Subject: [PATCH] nv50: update comments
--- src/gallium/drivers/nv50/nv50_program.c | 92 ++++++++++++++----------------- 1 files changed, 41 insertions(+), 51 deletions(-)
src/gallium/drivers/nv50/nv50_program.c +41 -51
114 lines not on this page · raw message
Signature · 1 line
1.6.0.6
_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau
PATCH 1/1 nv50/gallium patch series 2, fixes
In reply to a message not in the archiveAh, obviously I DID introduce a few regressions in those patches, this should fix what I discovered so far; will be merged into the respective patches later.
Christoph
From c7feb3ab5aaf6a323e842987d6ea5f7637fac79d Mon Sep 17 00:00:00 2001
From: Christoph Bumiller <e0425955-oe7qfRrRQffzPE21tAIdciO7C/[email protected]>
Date: Wed, 24 Jun 2009 22:18:37 +0200
Subject: [PATCH] nv50: fix previous patches
This fixes the previous patches, and add some debugging output if NV50_PROGRAM_DUMP is un-commented.
Will merge this into the patches, later.
--- src/gallium/drivers/nv50/nv50_program.c | 94 +++++++++++++++++++------------ 1 files changed, 58 insertions(+), 36 deletions(-)
src/gallium/drivers/nv50/nv50_program.c +58 -36
@@ -28,11 +28,12 @@#include "pipe/p_shader_tokens.h" #include "tgsi/tgsi_parse.h" #include "tgsi/tgsi_util.h" +#include "tgsi/tgsi_dump.h" #include "nv50_context.h" #define NV50_SU_MAX_TEMP 64 -//#define NV50_PROGRAM_DUMP +/* #define NV50_PROGRAM_DUMP */ /* ARL - gallium craps itself on progs/vp/arl.txt *
@@ -44,7 +45,7 @@* case, if the emit_src() causes the inst to suddenly become long. * * Verify half-insns work where expected - if they are used, they have to -* come in pairs. We cannot branch to between two half insns. +* come in pairs. Also, we cannot branch to between two half insns. * * Watch dst == src vectors, can overwrite components that are needed: * p.e. SUB R0, R0.yzxw, R0
@@ -52,8 +53,8 @@* some cases (notably XPD) may still be bad though. * * Things to check with renouveau: -* FP results: can DEPR be mapped to another registers -* (currently it goes after all color outputs) +* FP results: can DEPR output be mapped to another register ? +* (currently it's index is that of the last color's register + 1) * * 1298 = 0x00000004; or 0x00000005 if DEPR is written *
@@ -444,7 +445,7 @@ set_immd(struct nv50_pc *pc, struct nv50_reg *imm, struct nv50_program_exec *e)#define INTERP_LINEAR 0 -#define INTERP_FLAT 1 +#define INTERP_FLAT 1#define INTERP_PERSPECTIVE 2#define INTERP_CENTROID 4
@@ -1852,6 +1853,10 @@ prep_inspect_insn(struct nv50_pc *pc, const union tgsi_full_token *tok, dst = &insn->FullDstRegisters[0 ].DstRegister; mask = dst->WriteMask; +#ifdef NV50_PROGRAM_DUMP +tgsi_dump_instruction (insn,1 ); +#endif +if (dst->File ==TGSI_FILE_TEMPORARY ) {for (c =0 ; c <4 ; c++) {if (!(mask & (1 << c)))
@@ -1900,13 +1905,14 @@ static unsigned prep_fp_attrib(struct nv50_pc *pc, int i, unsigned *acc, int *p_mid, int *aid, int *p_oid) { - int c, n, oid = *p_oid, mid = *p_mid; + int c, n, oid, mid = *p_mid;unsigned mask =0 ;for (c =0 , n = i *4 ; c <4 ; c++, n++) { pc->attr[n].type =P_TEMP ; pc->attr[n].hw =-1 ; pc->attr[n].index = i; + oid = (*p_oid)++;if (pc->attr[n].acc == acc[n])continue ;
@@ -1915,13 +1921,12 @@ prep_fp_attrib(struct nv50_pc *pc, int i, unsigned *acc, int *p_mid, pc->attr[n].acc = acc[n]; pc->attr[n].rhw = (*aid)++; - pc->p->cfg.fp.map[mid /4 ] |= (oid + c) << (8 * (mid %4 )); + pc->p->cfg.fp.map[mid /4 ] |= oid << (8 * (mid %4 )); mid++; pc->p->cfg.fp.regs[1 ] +=0x00010001 ; } *p_mid = mid; - *p_oid = oid +4 ;return mask; }
@@ -1958,6 +1963,10 @@ nv50_program_tx_prep(struct nv50_pc *pc)const struct tgsi_full_immediate *imm = &p.FullToken.FullImmediate; +#ifdef NV50_PROGRAM_DUMP +tgsi_dump_immediate (imm); +#endif + ctor_immd(pc, imm->u.ImmediateFloat32[0].Float, imm->u.ImmediateFloat32[1].Float, imm->u.ImmediateFloat32[2].Float,
@@ -1973,6 +1982,10 @@ nv50_program_tx_prep(struct nv50_pc *pc) first = d->DeclarationRange.First; last = d->DeclarationRange.Last; +#ifdef NV50_PROGRAM_DUMP +tgsi_dump_declaration (d); +#endif +switch (d->Declaration.File) {case TGSI_FILE_TEMPORARY :break ;
@@ -2094,38 +2107,36 @@ nv50_program_tx_prep(struct nv50_pc *pc)/* position should be loaded first */ if (fcrd !=0xffff ) {unsigned mask; - oid = mid =0 ; + oid =0 ; + mid =0 ; mask =prep_fp_attrib (pc, fcrd, r_usage[1 ], &mid, &aid, &oid); pc->p->cfg.fp.regs[1 ] |= (mask <<24 ); pc->p->cfg.fp.map[0 ] +=0x04040404 * fcrd; + oid =0 ; }/* should do MAD fcrd.xy, fcrd, SOME_CONST, fcrd */ if (perspect_loads) { pc->iv_p =alloc_temp (pc,NULL ); - -if (!(pc->p->cfg.fp.regs[1 ] &0x08000000 )) { - pc->p->cfg.fp.regs[1 ] |=0x08000000 ; + pc->iv_p->rhw = aid -1 ; +if (!(pc->p->cfg.fp.regs[1 ] & (1 <<27 ))) pc->iv_p->rhw = aid++; -emit_interp (pc, pc->iv_p,NULL , -INTERP_LINEAR ); -emit_flop (pc,0 , pc->iv_p, pc->iv_p); - }else { - pc->iv_p->rhw = aid -1 ; -emit_flop (pc,0 , pc->iv_p, - &pc->attr[fcrd *4 +3 ]); - } + pc->p->cfg.fp.regs[1 ] |= (1 <<27 ); +emit_interp (pc, pc->iv_p,NULL ,INTERP_LINEAR ); +emit_flop (pc,0 , pc->iv_p, pc->iv_p); }if (centroid_loads) { pc->iv_c =alloc_temp (pc,NULL ); - pc->iv_c->rhw = pc->iv_p ? aid -1 : aid++; + pc->iv_c->rhw = aid -1 ; +if (!(pc->p->cfg.fp.regs[1 ] & (1 <<27 ))) + pc->iv_c->rhw = aid++; + pc->p->cfg.fp.regs[1 ] |= (1 <<27 );emit_interp (pc, pc->iv_c,NULL ,INTERP_CENTROID );emit_flop (pc,0 , pc->iv_c, pc->iv_c); - pc->p->cfg.fp.regs[1 ] |=0x08000000 ; }/* load colors directly after position - XXX: might
@@ -2301,7 +2312,8 @@ nv50fp_move_outputs(struct nv50_pc *pc)ctor_reg (&out,P_TEMP ,-1 ,-1 );for (i =0 ; i < pc->result_nr *4 ; i++) { -if (pc->result[i].rhw <0 ) +if (pc->result[i].rhw <0 || + pc->result[i].rhw == pc->result[i].hw)continue ; out.hw = pc->result[i].rhw;emit_mov (pc, &out, &pc->result[i]);
@@ -2337,7 +2349,7 @@ static void nv50_program_tx_postprocess(struct nv50_pc *pc)if (pc->p->type ==PIPE_SHADER_FRAGMENT )nv50fp_move_outputs (pc);else -if (pc->p->type ==PIPE_SHADER_VERTEX ) +if (pc->p->type ==PIPE_SHADER_VERTEX && pc->p->cfg.vp.ucp.nr >0 )nv50vp_ucp_append (pc);/* collect branching instructions, we need to adjust their target
@@ -2811,14 +2823,26 @@ nv50_linkage_create(struct nv50_context *nv50)so_ref (so, &ln->so);so_ref (NULL , &so); +#ifdef NV50_PROGRAM_DUMP +fprintf (stderr,"LINKAGE:\n" ); +for (i =0 ; i < n; i++) +fprintf (stderr,"MAP[%i] = 0x%08x\n" ,i,map[i]); +fprintf (stderr,"REG1904 = 0x%08x\n" ,regs[0 ]); +fprintf (stderr,"REG1908 = 0x%08x\n" ,regs[1 ]); +fprintf (stderr,"REG190c = 0x%08x\n" ,regs[2 ]); +fprintf (stderr,"REG1910 = 0x%08x\n" ,regs[3 ]); +fprintf (stderr,"REG1988 = 0x%08x\n" ,regs[4 ]); +fprintf (stderr,"REG19a8 = 0x%08x\n" ,fp->cfg.fp.regs[2 ]); +fprintf (stderr,"REG196c = 0x%08x\n" ,fp->cfg.fp.regs[3 ]); +#endif +return ln; }void nv50_linkage_validate (struct nv50_context *nv50) { -struct nv50_linkage *it, *ln =NULL ; +struct nv50_linkage *ln;struct nv50_program *vp = nv50->vertprog; -struct nv50_program *fp = nv50->fragprog;unsigned cfg; cfg = nv50->rasterizer->pipe.light_twoside;
@@ -2827,20 +2851,18 @@ void nv50_linkage_validate(struct nv50_context *nv50) cfg |= (1 <<2 );if (vp->ln) { - it = vp->ln->next[0 ]; + ln = vp->ln->next[0 ];do { -if (it->prog[1 ] == (void *)fp && it->cfg == cfg) { - ln = it; -break ; +if (ln->prog[1 ] == nv50->fragprog && ln->cfg == cfg) { +so_ref (ln->so, &nv50->state.plinkage); +return ; } - it = it->next[0 ]; - }while (it != vp->ln); + ln = ln->next[0 ]; + }while (ln != vp->ln); } -if (!ln) { - ln =nv50_linkage_create (nv50); - ln->cfg = cfg; - } + ln =nv50_linkage_create (nv50); + ln->cfg = cfg;so_ref (ln->so, &nv50->state.plinkage); }
Signature · 1 line
1.6.0.6
_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau
Re: [PATCH] nv50/gallium patch series 2, fixes
In reply to a message not in the archiveHi there,
I'm getting quite good results, with your patches compared to the git code I went from 12 GLX Visuals and 12 GLXFBConfigs to 36 for both. glxgears magically started working, I can run pretty much all of the demos from /progs/demos except few ones. Thanks for the patches, It would be nice to have them reviewed and merged, it's better than nothing ;).
Quoted 6 lines · Christoph Bumiller
Ah, obviously I DID introduce a few regressions in those patches, this should fix what I discovered so far; will be merged into the respective patches later.
Christoph