diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2012-09-26 00:37:51 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2012-10-02 23:13:16 -0400 |
commit | dc73b45ad456b173610a211c588d003f7ea77957 (patch) | |
tree | 41523a117f091c0b38ea642298f30d29869f6ae3 /drivers/gpu/drm | |
parent | c0abf5c9fa1db7188bd6b8b580614a377dbc7080 (diff) |
drm/nouveau: store supported dma mask in vmmgr
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/include/subdev/vm.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/vm/nv04.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/vm/nv41.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/vm/nv44.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/vm/nv50.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/vm/nvc0.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_ttm.c | 10 |
7 files changed, 9 insertions, 7 deletions
diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/vm.h b/drivers/gpu/drm/nouveau/core/include/subdev/vm.h index 66a4473f3a54..9d595efe667a 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/vm.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/vm.h | |||
@@ -69,6 +69,7 @@ struct nouveau_vmmgr { | |||
69 | struct nouveau_subdev base; | 69 | struct nouveau_subdev base; |
70 | 70 | ||
71 | u64 limit; | 71 | u64 limit; |
72 | u8 dma_bits; | ||
72 | u32 pgt_bits; | 73 | u32 pgt_bits; |
73 | u8 spg_shift; | 74 | u8 spg_shift; |
74 | u8 lpg_shift; | 75 | u8 lpg_shift; |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/vm/nv04.c b/drivers/gpu/drm/nouveau/core/subdev/vm/nv04.c index bfe6766d36ec..ad6ad5de51b8 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/vm/nv04.c +++ b/drivers/gpu/drm/nouveau/core/subdev/vm/nv04.c | |||
@@ -97,6 +97,7 @@ nv04_vmmgr_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
97 | 97 | ||
98 | priv->base.create = nv04_vm_create; | 98 | priv->base.create = nv04_vm_create; |
99 | priv->base.limit = NV04_PDMA_SIZE; | 99 | priv->base.limit = NV04_PDMA_SIZE; |
100 | priv->base.dma_bits = 32; | ||
100 | priv->base.pgt_bits = 32 - 12; | 101 | priv->base.pgt_bits = 32 - 12; |
101 | priv->base.spg_shift = 12; | 102 | priv->base.spg_shift = 12; |
102 | priv->base.lpg_shift = 12; | 103 | priv->base.lpg_shift = 12; |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/vm/nv41.c b/drivers/gpu/drm/nouveau/core/subdev/vm/nv41.c index bbeac8d296ed..c5486e4bffa6 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/vm/nv41.c +++ b/drivers/gpu/drm/nouveau/core/subdev/vm/nv41.c | |||
@@ -98,6 +98,7 @@ nv41_vmmgr_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
98 | 98 | ||
99 | priv->base.create = nv04_vm_create; | 99 | priv->base.create = nv04_vm_create; |
100 | priv->base.limit = NV41_GART_SIZE; | 100 | priv->base.limit = NV41_GART_SIZE; |
101 | priv->base.dma_bits = 39; | ||
101 | priv->base.pgt_bits = 32 - 12; | 102 | priv->base.pgt_bits = 32 - 12; |
102 | priv->base.spg_shift = 12; | 103 | priv->base.spg_shift = 12; |
103 | priv->base.lpg_shift = 12; | 104 | priv->base.lpg_shift = 12; |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/vm/nv44.c b/drivers/gpu/drm/nouveau/core/subdev/vm/nv44.c index d099cde3a7f5..8c9cece25e63 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/vm/nv44.c +++ b/drivers/gpu/drm/nouveau/core/subdev/vm/nv44.c | |||
@@ -179,6 +179,7 @@ nv44_vmmgr_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
179 | 179 | ||
180 | priv->base.create = nv04_vm_create; | 180 | priv->base.create = nv04_vm_create; |
181 | priv->base.limit = NV44_GART_SIZE; | 181 | priv->base.limit = NV44_GART_SIZE; |
182 | priv->base.dma_bits = 39; | ||
182 | priv->base.pgt_bits = 32 - 12; | 183 | priv->base.pgt_bits = 32 - 12; |
183 | priv->base.spg_shift = 12; | 184 | priv->base.spg_shift = 12; |
184 | priv->base.lpg_shift = 12; | 185 | priv->base.lpg_shift = 12; |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/vm/nv50.c b/drivers/gpu/drm/nouveau/core/subdev/vm/nv50.c index d83489c44c3a..e067f81c97b3 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/vm/nv50.c +++ b/drivers/gpu/drm/nouveau/core/subdev/vm/nv50.c | |||
@@ -201,6 +201,7 @@ nv50_vmmgr_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
201 | return ret; | 201 | return ret; |
202 | 202 | ||
203 | priv->base.limit = 1ULL << 40; | 203 | priv->base.limit = 1ULL << 40; |
204 | priv->base.dma_bits = 40; | ||
204 | priv->base.pgt_bits = 29 - 12; | 205 | priv->base.pgt_bits = 29 - 12; |
205 | priv->base.spg_shift = 12; | 206 | priv->base.spg_shift = 12; |
206 | priv->base.lpg_shift = 16; | 207 | priv->base.lpg_shift = 16; |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/vm/nvc0.c b/drivers/gpu/drm/nouveau/core/subdev/vm/nvc0.c index 44721a4714d1..30c61e6c2017 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/vm/nvc0.c +++ b/drivers/gpu/drm/nouveau/core/subdev/vm/nvc0.c | |||
@@ -163,6 +163,7 @@ nvc0_vmmgr_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
163 | return ret; | 163 | return ret; |
164 | 164 | ||
165 | priv->base.limit = 1ULL << 40; | 165 | priv->base.limit = 1ULL << 40; |
166 | priv->base.dma_bits = 40; | ||
166 | priv->base.pgt_bits = 27 - 12; | 167 | priv->base.pgt_bits = 27 - 12; |
167 | priv->base.spg_shift = 12; | 168 | priv->base.spg_shift = 12; |
168 | priv->base.lpg_shift = 17; | 169 | priv->base.lpg_shift = 17; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c index d2fc121ff861..9be9cb58e19b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c | |||
@@ -340,14 +340,10 @@ nouveau_ttm_init(struct nouveau_drm *drm) | |||
340 | u32 bits; | 340 | u32 bits; |
341 | int ret; | 341 | int ret; |
342 | 342 | ||
343 | if (nv_device(drm->device)->card_type >= NV_50) { | 343 | bits = nouveau_vmmgr(drm->device)->dma_bits; |
344 | if (pci_dma_supported(dev->pdev, DMA_BIT_MASK(40))) | 344 | if ( drm->agp.stat == ENABLED || |
345 | bits = 40; | 345 | !pci_dma_supported(dev->pdev, DMA_BIT_MASK(bits))) |
346 | else | ||
347 | bits = 32; | ||
348 | } else { | ||
349 | bits = 32; | 346 | bits = 32; |
350 | } | ||
351 | 347 | ||
352 | ret = pci_set_dma_mask(dev->pdev, DMA_BIT_MASK(bits)); | 348 | ret = pci_set_dma_mask(dev->pdev, DMA_BIT_MASK(bits)); |
353 | if (ret) | 349 | if (ret) |