[Mesa-dev] [PATCH 4/6] nvc0: Add NVC0_RESOURCE_FLAG_VIDEO
Maarten Lankhorst
m.b.lankhorst at gmail.com
Thu Dec 1 16:05:00 PST 2011
Video buffers require a specific tiling mode.
Signed-off-by: Maarten Lankhorst <m.b.lankhorst at gmail.com>
---
src/gallium/drivers/nvc0/nvc0_miptree.c | 2 ++
src/gallium/drivers/nvc0/nvc0_resource.h | 1 +
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/gallium/drivers/nvc0/nvc0_miptree.c b/src/gallium/drivers/nvc0/nvc0_miptree.c
index a9d2c85..ba34095 100644
--- a/src/gallium/drivers/nvc0/nvc0_miptree.c
+++ b/src/gallium/drivers/nvc0/nvc0_miptree.c
@@ -213,6 +213,8 @@ nvc0_miptree_init_layout_tiled(struct nv50_miptree *mt)
lvl->offset = mt->total_size;
lvl->tile_mode = nvc0_tex_choose_tile_dims(nbx, nby, d);
+ if (unlikely(pt->flags & NVC0_RESOURCE_FLAG_VIDEO))
+ lvl->tile_mode = 0x10;
tsx = NVC0_TILE_SIZE_X(lvl->tile_mode); /* x is tile row pitch in bytes */
tsy = NVC0_TILE_SIZE_Y(lvl->tile_mode);
diff --git a/src/gallium/drivers/nvc0/nvc0_resource.h b/src/gallium/drivers/nvc0/nvc0_resource.h
index 6d946c8..1d68029 100644
--- a/src/gallium/drivers/nvc0/nvc0_resource.h
+++ b/src/gallium/drivers/nvc0/nvc0_resource.h
@@ -4,6 +4,7 @@
#include "nv50/nv50_resource.h"
+#define NVC0_RESOURCE_FLAG_VIDEO (NOUVEAU_RESOURCE_FLAG_DRV_PRIV << 0)
#define NVC0_TILE_SHIFT_X(m) ((((m) >> 0) & 0xf) + 6)
#define NVC0_TILE_SHIFT_Y(m) ((((m) >> 4) & 0xf) + 3)
--
1.7.7.3
More information about the mesa-dev
mailing list