[PATCH 3/3] nv50: invert y coordinates in transfers if needed

Christoph Bumiller e0425955 at student.tuwien.ac.at
Sun Jul 12 06:51:16 PDT 2009


When the state tracker assumes Y_0_BOTTOM (i.e. when rendering
to an OpenGL FBO), we need to invert the y coordinates as well,
since for M2MF, y = 0 is the beginning of the memory area.
---
 src/gallium/drivers/nv50/nv50_transfer.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_transfer.c b/src/gallium/drivers/nv50/nv50_transfer.c
index d0b7f0b..f6a8a47 100644
--- a/src/gallium/drivers/nv50/nv50_transfer.c
+++ b/src/gallium/drivers/nv50/nv50_transfer.c
@@ -76,13 +76,13 @@ nv50_transfer_rect_m2mf(struct pipe_screen *pscreen, struct nouveau_bo *src_bo,
 		OUT_RELOCl(chan, dst_bo, dst_offset, dst_reloc);
 		if (src_bo->tile_flags) {
 			BEGIN_RING(chan, m2mf, 0x0218, 1);
-			OUT_RING  (chan, (dy << 16) | sx);
+			OUT_RING  (chan, (sy << 16) | sx);
 		} else {
 			src_offset += (line_count * src_pitch);
 		}
 		if (dst_bo->tile_flags) {
 			BEGIN_RING(chan, m2mf, 0x0234, 1);
-			OUT_RING  (chan, (sy << 16) | dx);
+			OUT_RING  (chan, (dy << 16) | dx);
 		} else {
 			dst_offset += (line_count * dst_pitch);
 		}
@@ -112,6 +112,9 @@ nv50_transfer_new(struct pipe_screen *pscreen, struct pipe_texture *pt,
 	unsigned image = 0;
 	int ret;
 
+	if (!(pt->tex_usage & PIPE_TEXTURE_USAGE_DISPLAY_TARGET))
+		y = pt->height[level] - y - h;
+
 	if (pt->target == PIPE_TEXTURE_CUBE)
 		image = face;
 	else
-- 
1.6.3.3


--------------050205000506050205030809--


More information about the Nouveau mailing list