From beaa0c9a28b30a6ba3292184d04875b6a597e433 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Mon, 6 Aug 2007 03:40:43 +1000 Subject: nouveau: Pass channel struct around instead of channel id. --- linux-core/nouveau_sgdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux-core/nouveau_sgdma.c') diff --git a/linux-core/nouveau_sgdma.c b/linux-core/nouveau_sgdma.c index 0ddac952..6393a469 100644 --- a/linux-core/nouveau_sgdma.c +++ b/linux-core/nouveau_sgdma.c @@ -211,7 +211,7 @@ nouveau_sgdma_init(struct drm_device *dev) obj_size = (aper_size >> NV_CTXDMA_PAGE_SHIFT) * 8; } - if ((ret = nouveau_gpuobj_new(dev, -1, obj_size, 16, + if ((ret = nouveau_gpuobj_new(dev, NULL, obj_size, 16, NVOBJ_FLAG_ALLOW_NO_REFS | NVOBJ_FLAG_ZERO_ALLOC | NVOBJ_FLAG_ZERO_FREE, &gpuobj))) { -- cgit v1.2.3 From cf04641bc61c8bc18101713a8d95ef98e6afae7f Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Mon, 6 Aug 2007 22:05:31 +1000 Subject: nouveau: Give DRM its own gpu channel If your card doesn't have working context switching, it is now broken. --- linux-core/nouveau_sgdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux-core/nouveau_sgdma.c') diff --git a/linux-core/nouveau_sgdma.c b/linux-core/nouveau_sgdma.c index 6393a469..df970d11 100644 --- a/linux-core/nouveau_sgdma.c +++ b/linux-core/nouveau_sgdma.c @@ -69,7 +69,7 @@ nouveau_sgdma_clear(struct drm_ttm_backend *be) if (nvbe->is_bound) be->func->unbind(be); - for (d = 0; d < nvbe->pages_populated; d--) { + for (d = 0; d < nvbe->pages_populated; d++) { pci_unmap_page(nvbe->dev->pdev, nvbe->pagelist[d], NV_CTXDMA_PAGE_SIZE, PCI_DMA_BIDIRECTIONAL); -- cgit v1.2.3 From c3faa589b09616acdfd827be1719f6c2706c49ab Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Wed, 15 Aug 2007 13:36:54 +1000 Subject: nouveau: Allow GART notifiers when using sgdma code. --- linux-core/nouveau_sgdma.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'linux-core/nouveau_sgdma.c') diff --git a/linux-core/nouveau_sgdma.c b/linux-core/nouveau_sgdma.c index df970d11..97d5330b 100644 --- a/linux-core/nouveau_sgdma.c +++ b/linux-core/nouveau_sgdma.c @@ -316,3 +316,20 @@ nouveau_sgdma_nottm_hack_takedown(struct drm_device *dev) { } +int +nouveau_sgdma_get_page(struct drm_device *dev, uint32_t offset, uint32_t *page) +{ + struct drm_nouveau_private *dev_priv = dev->dev_private; + struct nouveau_gpuobj *gpuobj = dev_priv->gart_info.sg_ctxdma; + int pte; + + pte = (offset >> NV_CTXDMA_PAGE_SHIFT); + if (dev_priv->card_type < NV_50) { + *page = INSTANCE_RD(gpuobj, (pte + 2)) & ~NV_CTXDMA_PAGE_MASK; + return 0; + } + + DRM_ERROR("Unimplemented on NV50\n"); + return -EINVAL; +} + -- cgit v1.2.3