Commit 1bd1bf9d authored by Yusuf Khan's avatar Yusuf Khan
Browse files

nvc0/mt: tiling mode and compression support



Signed-off-by: Yusuf Khan's avatarYusuf Khan <yusisamerican@gmail.com>
parent 650597a7
Pipeline #729006 waiting for manual action with stages
......@@ -197,6 +197,36 @@ nvc0_mt_choose_storage_type(struct pipe_screen *pscreen,
return nvc0_choose_tiled_storage_type(pscreen, mt->base.base.format, ms, compressed);
}
static uint32_t
nvc0_mt_choose_tile_mode(struct pipe_screen *pscreen,
const struct nv50_miptree *mt,
bool compressed)
{
if (unlikely(mt->base.base.bind & PIPE_BIND_CURSOR))
return 0;
if (unlikely(mt->base.base.flags & NOUVEAU_RESOURCE_FLAG_LINEAR))
return 0;
if (!compressed)
return 0;
switch (util_format_get_blocksizebits(format)) {
case 16:
return 0x1; /* NOUVEAU_GEM_TILE_16BPP */
case 32:
return 0x2; /* NOUVEAU_GEM_TILE_32BPP */
default:
break;
}
switch (format) {
case PIPE_FORMAT_Z16_UNORM:
return 0x30000; /* NOUVEAU_GEM_TILE_COMP */
default:
break;
}
return 0x30000;
}
static inline bool
nvc0_miptree_init_ms_mode(struct nv50_miptree *mt)
{
......@@ -526,7 +556,7 @@ nvc0_miptree_create(struct pipe_screen *pscreen,
return NULL;
}
}
bo_config.nvc0.tile_mode = mt->level[0].tile_mode;
bo_config.nvc0.tile_mode = mt->level[0].tile_mode | nvc0_mt_choose_tile_mode(pscreen, mt, compressed);
if (!bo_config.nvc0.memtype && (pt->usage == PIPE_USAGE_STAGING || pt->bind & PIPE_BIND_SHARED))
mt->base.domain = NOUVEAU_BO_GART;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment