Mesa (master): nv50: apply layout_mask to tile_flags

Christoph Bumiller chrisbmr at kemper.freedesktop.org
Fri Oct 15 13:59:20 UTC 2010


Module: Mesa
Branch: master
Commit: 9c439e3c7af7fd1704d44e3ba1a013de7febde37
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9c439e3c7af7fd1704d44e3ba1a013de7febde37

Author: Xavier Chantry <chantry.xavier at gmail.com>
Date:   Fri Oct 15 15:53:13 2010 +0200

nv50: apply layout_mask to tile_flags

The tile_flags now store more than just nv50 page table entry bits.

---

 src/gallium/drivers/nv50/nv50_context.h  |    3 +++
 src/gallium/drivers/nv50/nv50_surface.c  |    2 +-
 src/gallium/drivers/nv50/nv50_transfer.c |   10 +++++-----
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h
index ac69c78..bf6a577 100644
--- a/src/gallium/drivers/nv50/nv50_context.h
+++ b/src/gallium/drivers/nv50/nv50_context.h
@@ -26,6 +26,9 @@
 #define NOUVEAU_MSG(fmt, args...) \
 	fprintf(stderr, "nouveau: "fmt, ##args);
 
+#define nouveau_bo_tile_layout(nvbo) \
+	((nvbo)->tile_flags & NOUVEAU_BO_TILE_LAYOUT_MASK)
+
 /* Constant buffer assignment */
 #define NV50_CB_PMISC		0
 #define NV50_CB_PVP		1
diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c
index 3f31662..f70c138 100644
--- a/src/gallium/drivers/nv50/nv50_surface.c
+++ b/src/gallium/drivers/nv50/nv50_surface.c
@@ -92,7 +92,7 @@ nv50_surface_set(struct nv50_screen *screen, struct pipe_surface *ps, int dst)
  		return 1;
 	}
 
- 	if (!bo->tile_flags) {
+	if (!nouveau_bo_tile_layout(bo)) {
  		BEGIN_RING(chan, eng2d, mthd, 2);
  		OUT_RING  (chan, format);
  		OUT_RING  (chan, 1);
diff --git a/src/gallium/drivers/nv50/nv50_transfer.c b/src/gallium/drivers/nv50/nv50_transfer.c
index f973cf2..0cc2f4a 100644
--- a/src/gallium/drivers/nv50/nv50_transfer.c
+++ b/src/gallium/drivers/nv50/nv50_transfer.c
@@ -45,7 +45,7 @@ nv50_transfer_rect_m2mf(struct pipe_screen *pscreen,
 
 	WAIT_RING (chan, 14);
 
-	if (!src_bo->tile_flags) {
+	if (!nouveau_bo_tile_layout(src_bo)) {
 		BEGIN_RING(chan, m2mf,
 			NV50_MEMORY_TO_MEMORY_FORMAT_LINEAR_IN, 1);
 		OUT_RING  (chan, 1);
@@ -64,7 +64,7 @@ nv50_transfer_rect_m2mf(struct pipe_screen *pscreen,
 		OUT_RING  (chan, sz); /* copying only 1 zslice per call */
 	}
 
-	if (!dst_bo->tile_flags) {
+	if (!nouveau_bo_tile_layout(dst_bo)) {
 		BEGIN_RING(chan, m2mf,
 			NV50_MEMORY_TO_MEMORY_FORMAT_LINEAR_OUT, 1);
 		OUT_RING  (chan, 1);
@@ -95,14 +95,14 @@ nv50_transfer_rect_m2mf(struct pipe_screen *pscreen,
 			NV04_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN, 2);
 		OUT_RELOCl(chan, src_bo, src_offset, src_reloc);
 		OUT_RELOCl(chan, dst_bo, dst_offset, dst_reloc);
-		if (src_bo->tile_flags) {
+		if (nouveau_bo_tile_layout(src_bo)) {
 			BEGIN_RING(chan, m2mf,
 				NV50_MEMORY_TO_MEMORY_FORMAT_TILING_POSITION_IN, 1);
 			OUT_RING  (chan, (sy << 16) | (sx * cpp));
 		} else {
 			src_offset += (line_count * src_pitch);
 		}
-		if (dst_bo->tile_flags) {
+		if (nouveau_bo_tile_layout(dst_bo)) {
 			BEGIN_RING(chan, m2mf,
 				NV50_MEMORY_TO_MEMORY_FORMAT_TILING_POSITION_OUT, 1);
 			OUT_RING  (chan, (dy << 16) | (dx * cpp));
@@ -280,7 +280,7 @@ nv50_upload_sifc(struct nv50_context *nv50,
 
 	MARK_RING (chan, 32, 2); /* flush on lack of space or relocs */
 
-	if (bo->tile_flags) {
+	if (nouveau_bo_tile_layout(bo)) {
 		BEGIN_RING(chan, eng2d, NV50_2D_DST_FORMAT, 5);
 		OUT_RING  (chan, dst_format);
 		OUT_RING  (chan, 0);




More information about the mesa-commit mailing list