summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_ttm.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2013-03-22 12:12:17 +1000
committerBen Skeggs <bskeggs@redhat.com>2013-04-26 15:37:38 +1000
commitde7b7d59d54852c9544a9e4fa7af719511fb5366 (patch)
tree241ed778025af12d1b26c19cdeea5a78b478e6bb /drivers/gpu/drm/nouveau/nouveau_ttm.c
parent7092a8dd5c16c32746444bcd468b429185c25472 (diff)
downloadtalos-obmc-linux-de7b7d59d54852c9544a9e4fa7af719511fb5366.tar.gz
talos-obmc-linux-de7b7d59d54852c9544a9e4fa7af719511fb5366.zip
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: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_ttm.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_ttm.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
index 9c60ef697967..f19a15a3bc03 100644
--- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
@@ -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;
OpenPOWER on IntegriCloud