nouveau: don't emit reloc markers for bo's that are mapped
PATCH 1/1 nouveau: don't emit reloc markers for bo's that are mapped
--- src/gallium/drivers/nouveau/nouveau_stateobj.h | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
src/gallium/drivers/nouveau/nouveau_stateobj.h +9 -0
@@ -163,6 +163,15 @@ so_emit_reloc_markers(struct nouveau_channel *chan, struct nouveau_stateobj *so) for (i = 0; i < so->cur_reloc; i++) { struct nouveau_stateobj_reloc *r = &so->reloc[i]; + /* This is probably a vbo which has caused a pushbuf flush + * before mapping. Don't try to reloc it again, it will cause + * problems, because important stuff is skipped. + */ + if (r->bo->map) { + pb->remaining += 2; + continue; + } + if ((ret = nouveau_pushbuf_emit_reloc(chan, pb->cur++, r->bo, r->packet, 0, (r->flags & (NOUVEAU_BO_VRAM |
Signature · 1 line
1.6.5.4
A message that is not in the archive (sent off-list or not yet received): 1261098373-27809-1-git-send-email-madman2003-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Quoted 10 lines · Maarten Maathuis
Signed-off-by Maarten Maathuis <[email protected]>--- src/gallium/drivers/nouveau/nouveau_stateobj.h | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)src/gallium/drivers/nouveau/nouveau_stateobj.h +0
-0
src/gallium/drivers/nouveau/nouveau_stateobj.h so_emit_reloc_markers(struct nouveau_channel *chan, struct nouveau_stateobj *so) · line 167
Quoted 5 lines
src/gallium/drivers/nouveau/nouveau_stateobj.h +2
-0@@ -163,6 +163,15 @@ so_emit_reloc_markers(struct nouveau_channel *chan, struct nouveau_stateobj *so)for (i =0 ; i < so->cur_reloc; i++) {struct nouveau_stateobj_reloc *r = &so->reloc[i]; +/* This is probably a vbo which has caused a pushbuf flush +* before mapping. Don't try to reloc it again, it will cause
don't you mean un-mapping here ?
src/gallium/drivers/nouveau/nouveau_stateobj.h so_emit_reloc_markers(struct nouveau_channel *chan, struct nouveau_stateobj *so) · line 174
Quoted 7 lines
src/gallium/drivers/nouveau/nouveau_stateobj.h +7
-0+* problems, because important stuff is skipped. +*/ +if (r->bo->map) { + pb->remaining +=2 ; +continue ; + } +
Should that be able to happen ?
I mean, the state tracker probably should have unmapped the VBOs again before making us to use them for drawing (or doesn't it ?), and if *we* mapped the VBO because we're using the VERTEX_DATA immediate mode, there should be no relocation in any of the state objects we emit relocation markers for.
Btw. in case of an error in the immediate path (i.e. if the vertex element is invalid) I forgot to unmap the vbufs again, and there might be double unmap in in nv50_map_vbufs because I didn't check if map was NULL there.
src/gallium/drivers/nouveau/nouveau_stateobj.h so_emit_reloc_markers(struct nouveau_channel *chan, struct nouveau_stateobj *so) · line 177
Quoted 3 lines
src/gallium/drivers/nouveau/nouveau_stateobj.h +0
-0if ((ret = nouveau_pushbuf_emit_reloc(chan, pb->cur++, r->bo, r->packet, 0, (r->flags & (NOUVEAU_BO_VRAM |
Christoph
(sorry, forgot to CC to the list in first send)
A message that is not in the archive (sent off-list or not yet received): 4B2B5227.7040906-oe7qfRrRQffzPE21tAIdciO7C/[email protected]
Quoted 39 lines · Christoph Bumiller
Quoted 10 lines · Maarten Maathuis
Signed-off-by Maarten Maathuis <[email protected]>---
src/gallium/drivers/nouveau/nouveau_stateobj.h | 9 +++++++++1 files changed, 9 insertions(+), 0 deletions(-)src/gallium/drivers/nouveau/nouveau_stateobj.h +0
-0src/gallium/drivers/nouveau/nouveau_stateobj.h so_emit_reloc_markers(struct nouveau_channel *chan, struct nouveau_stateobj *so) · line 167
Quoted 5 lines
src/gallium/drivers/nouveau/nouveau_stateobj.h +2
-0@@ -163,6 +163,15 @@ so_emit_reloc_markers(struct nouveau_channel *chan, struct nouveau_stateobj *so) for (i = 0; i < so->cur_reloc; i++) { struct nouveau_stateobj_reloc *r = &so->reloc[i]; + /* This is probably a vbo which has caused a pushbuf flush +* before mapping. Don't try to reloc it again, it will cause don't you mean un-mapping here ?
src/gallium/drivers/nouveau/nouveau_stateobj.h so_emit_reloc_markers(struct nouveau_channel *chan, struct nouveau_stateobj *so) · line 174
Quoted 7 lines
src/gallium/drivers/nouveau/nouveau_stateobj.h +7
-0+* problems, because important stuff is skipped. +*/ + if (r->bo->map) { + pb->remaining += 2; + continue; + } +Should that be able to happen ?
I mean, the state tracker probably should have unmapped the VBOs again before making us to use them for drawing (or doesn't it ?), and if *we* mapped the VBO because we're using theVERTEX_DATAimmediate mode, there should be no relocation in any of the state objects we emit relocation markers for.Btw. in case of an error in the immediate path (i.e. if the vertex element is invalid) I forgot to unmap the vbufs again, and there might be double unmap in in
nv50_map_vbufsbecause I didn't check if map was NULL there.Quoted 3 lines
src/gallium/drivers/nouveau/nouveau_stateobj.h +0
-0if ((ret = nouveau_pushbuf_emit_reloc(chan, pb->cur++, r->bo, r->packet, 0,(r->flags & (
NOUVEAU_BO_VRAM|
Quoted 7 lines
Christoph
(sorry, forgot to CC to the list in first send)
_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau
What i think is happening here (a bit of a guess, adjusted as i wrote it here, because my first idea was wrong). VBO is used, vbo is filled, vbo state is emitted, vbo/pipe buffer is mapped (by the statetracker), but libdrm_nouveau realizes that the pushbuf needs a flush. At that point reloc markers in flush notify is fine, since it happens before the map. But if the pushbuf gets flushed again, the the reloc markers will try to emit a buffer that is mapped.
This is the only thing i can think off, but i admit i still see kernel warnings about trying to emit buffers which are mapped by same process sometimes. So i will have a closer look at the vbo code soon.
Maarten.