From 7bf678f7ec86c152e22639b47cf038f94912fbc8 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Wed, 9 Jun 2010 11:26:46 +1000 Subject: [PATCH] nv50: use MARK_RING correctly --- src/gallium/drivers/nv50/nv50_surface.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c index 814921f7645..d701c7a75a2 100644 --- a/src/gallium/drivers/nv50/nv50_surface.c +++ b/src/gallium/drivers/nv50/nv50_surface.c @@ -115,7 +115,6 @@ nv50_surface_set(struct nv50_screen *screen, struct pipe_surface *ps, int dst) } if (!bo->tile_flags) { - MARK_RING (chan, 9, 2); /* flush on lack of space or relocs */ BEGIN_RING(chan, eng2d, mthd, 2); OUT_RING (chan, format); OUT_RING (chan, 1); @@ -126,7 +125,6 @@ nv50_surface_set(struct nv50_screen *screen, struct pipe_surface *ps, int dst) OUT_RELOCh(chan, bo, ps->offset, flags); OUT_RELOCl(chan, bo, ps->offset, flags); } else { - MARK_RING (chan, 11, 2); /* flush on lack of space or relocs */ BEGIN_RING(chan, eng2d, mthd, 5); OUT_RING (chan, format); OUT_RING (chan, 0); @@ -162,7 +160,9 @@ nv50_surface_do_copy(struct nv50_screen *screen, struct pipe_surface *dst, struct nouveau_grobj *eng2d = screen->eng2d; int ret; - WAIT_RING (chan, 32); + ret = MARK_RING(chan, 2*16 + 32, 4); + if (ret) + return ret; ret = nv50_surface_set(screen, dst, 1); if (ret) @@ -241,7 +241,9 @@ nv50_clear_render_target(struct pipe_context *pipe, if (format < 0) return; - WAIT_RING (chan, 32); + ret = MARK_RING (chan, 16 + 32, 2); + if (ret) + return; ret = nv50_surface_set(screen, dst, 1); if (ret) -- 2.30.2