aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_sgdma.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_sgdma.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_sgdma.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_sgdma.c b/drivers/gpu/drm/nouveau/nouveau_sgdma.c
index 630988af801..5a66a7ae6e2 100644
--- a/drivers/gpu/drm/nouveau/nouveau_sgdma.c
+++ b/drivers/gpu/drm/nouveau/nouveau_sgdma.c
@@ -234,7 +234,6 @@ nouveau_sgdma_init(struct drm_device *dev)
234 } 234 }
235 235
236 ret = nouveau_gpuobj_new(dev, NULL, obj_size, 16, 236 ret = nouveau_gpuobj_new(dev, NULL, obj_size, 16,
237 NVOBJ_FLAG_ALLOW_NO_REFS |
238 NVOBJ_FLAG_ZERO_ALLOC | 237 NVOBJ_FLAG_ZERO_ALLOC |
239 NVOBJ_FLAG_ZERO_FREE, &gpuobj); 238 NVOBJ_FLAG_ZERO_FREE, &gpuobj);
240 if (ret) { 239 if (ret) {
@@ -245,7 +244,7 @@ nouveau_sgdma_init(struct drm_device *dev)
245 dev_priv->gart_info.sg_dummy_page = 244 dev_priv->gart_info.sg_dummy_page =
246 alloc_page(GFP_KERNEL|__GFP_DMA32); 245 alloc_page(GFP_KERNEL|__GFP_DMA32);
247 if (!dev_priv->gart_info.sg_dummy_page) { 246 if (!dev_priv->gart_info.sg_dummy_page) {
248 nouveau_gpuobj_del(dev, &gpuobj); 247 nouveau_gpuobj_ref(NULL, &gpuobj);
249 return -ENOMEM; 248 return -ENOMEM;
250 } 249 }
251 250
@@ -254,11 +253,17 @@ nouveau_sgdma_init(struct drm_device *dev)
254 pci_map_page(pdev, dev_priv->gart_info.sg_dummy_page, 0, 253 pci_map_page(pdev, dev_priv->gart_info.sg_dummy_page, 0,
255 PAGE_SIZE, PCI_DMA_BIDIRECTIONAL); 254 PAGE_SIZE, PCI_DMA_BIDIRECTIONAL);
256 if (pci_dma_mapping_error(pdev, dev_priv->gart_info.sg_dummy_bus)) { 255 if (pci_dma_mapping_error(pdev, dev_priv->gart_info.sg_dummy_bus)) {
257 nouveau_gpuobj_del(dev, &gpuobj); 256 nouveau_gpuobj_ref(NULL, &gpuobj);
258 return -EFAULT; 257 return -EFAULT;
259 } 258 }
260 259
261 if (dev_priv->card_type < NV_50) { 260 if (dev_priv->card_type < NV_50) {
261 /* special case, allocated from global instmem heap so
262 * cinst is invalid, we use it on all channels though so
263 * cinst needs to be valid, set it the same as pinst
264 */
265 gpuobj->cinst = gpuobj->pinst;
266
262 /* Maybe use NV_DMA_TARGET_AGP for PCIE? NVIDIA do this, and 267 /* Maybe use NV_DMA_TARGET_AGP for PCIE? NVIDIA do this, and
263 * confirmed to work on c51. Perhaps means NV_DMA_TARGET_PCIE 268 * confirmed to work on c51. Perhaps means NV_DMA_TARGET_PCIE
264 * on those cards? */ 269 * on those cards? */
@@ -302,7 +307,7 @@ nouveau_sgdma_takedown(struct drm_device *dev)
302 dev_priv->gart_info.sg_dummy_bus = 0; 307 dev_priv->gart_info.sg_dummy_bus = 0;
303 } 308 }
304 309
305 nouveau_gpuobj_del(dev, &dev_priv->gart_info.sg_ctxdma); 310 nouveau_gpuobj_ref(NULL, &dev_priv->gart_info.sg_ctxdma);
306} 311}
307 312
308int 313int