Mesa (master): nouveau/nvc0: Extract common tile mode macro

Thierry Reding tagr at kemper.freedesktop.org
Fri Mar 9 10:49:35 UTC 2018


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

Author: Thierry Reding <treding at nvidia.com>
Date:   Wed Oct 11 14:41:26 2017 +0200

nouveau/nvc0: Extract common tile mode macro

Add a new macro that can be used to extract the tiling mode from a
tile_mode value. This is will be used to determine the number of GOBs
used in block linear mode.

Acked-by: Emil Velikov <emil.velikov at collabora.com>
Tested-by: Andre Heider <a.heider at gmail.com>
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
Signed-off-by: Thierry Reding <treding at nvidia.com>

---

 src/gallium/drivers/nouveau/nvc0/nvc0_resource.h | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_resource.h b/src/gallium/drivers/nouveau/nvc0/nvc0_resource.h
index 0d5f026d6e..c68a509483 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_resource.h
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_resource.h
@@ -6,14 +6,17 @@
 
 #define NVC0_RESOURCE_FLAG_VIDEO (NOUVEAU_RESOURCE_FLAG_DRV_PRIV << 0)
 
+#define NVC0_TILE_MODE_X(m) (((m) >> 0) & 0xf)
+#define NVC0_TILE_MODE_Y(m) (((m) >> 4) & 0xf)
+#define NVC0_TILE_MODE_Z(m) (((m) >> 8) & 0xf)
 
-#define NVC0_TILE_SHIFT_X(m) ((((m) >> 0) & 0xf) + 6)
-#define NVC0_TILE_SHIFT_Y(m) ((((m) >> 4) & 0xf) + 3)
-#define NVC0_TILE_SHIFT_Z(m) ((((m) >> 8) & 0xf) + 0)
+#define NVC0_TILE_SHIFT_X(m) (NVC0_TILE_MODE_X(m) + 6)
+#define NVC0_TILE_SHIFT_Y(m) (NVC0_TILE_MODE_Y(m) + 3)
+#define NVC0_TILE_SHIFT_Z(m) (NVC0_TILE_MODE_Z(m) + 0)
 
-#define NVC0_TILE_SIZE_X(m) (64 << (((m) >> 0) & 0xf))
-#define NVC0_TILE_SIZE_Y(m) ( 8 << (((m) >> 4) & 0xf))
-#define NVC0_TILE_SIZE_Z(m) ( 1 << (((m) >> 8) & 0xf))
+#define NVC0_TILE_SIZE_X(m) (64 << NVC0_TILE_MODE_X(m))
+#define NVC0_TILE_SIZE_Y(m) ( 8 << NVC0_TILE_MODE_Y(m))
+#define NVC0_TILE_SIZE_Z(m) ( 1 << NVC0_TILE_MODE_Z(m))
 
 /* it's ok to mask only in the end because max value is 3 * 5 */
 




More information about the mesa-commit mailing list