提交 de7b7d59 编写于 作者: B Ben Skeggs

drm/nouveau/ttm: allow tiled memtype on system memory buffer objects

Compression not supported, and will be silently dropped.  Original G80
can't handle this either and requires LINEAR memtype, though it's still
possible to correctly texture and m2mf to/from these objects anyway.
Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
上级 7092a8dd
......@@ -164,6 +164,8 @@ nouveau_gart_manager_new(struct ttm_mem_type_manager *man,
struct ttm_placement *placement,
struct ttm_mem_reg *mem)
{
struct nouveau_drm *drm = nouveau_bdev(bo->bdev);
struct nouveau_bo *nvbo = nouveau_bo(bo);
struct nouveau_mem *node;
if (unlikely((mem->num_pages << PAGE_SHIFT) >= 512 * 1024 * 1024))
......@@ -174,6 +176,20 @@ nouveau_gart_manager_new(struct ttm_mem_type_manager *man,
return -ENOMEM;
node->page_shift = 12;
switch (nv_device(drm->device)->card_type) {
case NV_50:
if (nv_device(drm->device)->chipset != 0x50)
node->memtype = (nvbo->tile_flags & 0x7f00) >> 8;
break;
case NV_C0:
case NV_D0:
case NV_E0:
node->memtype = (nvbo->tile_flags & 0xff00) >> 8;
break;
default:
break;
}
mem->mm_node = node;
mem->start = 0;
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册