summaryrefslogtreecommitdiff
path: root/linux-core/nouveau_sgdma.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2007-10-05 12:11:43 +1000
committerDave Airlie <airlied@redhat.com>2007-10-05 12:11:43 +1000
commit19b7cc34443889fc73de2e10462e1c0f9fa38041 (patch)
tree1cd73a2ef2aaed132cbc766e4ad4a8d2e3dde4e6 /linux-core/nouveau_sgdma.c
parentd351601899e5814d809b8e86ab6f0d6e7676f585 (diff)
parent495bbbaadc93c574eb98dd2ad64bdca4d91d4152 (diff)
Merge branch 'pre-superioctl-branch'
Diffstat (limited to 'linux-core/nouveau_sgdma.c')
-rw-r--r--linux-core/nouveau_sgdma.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/linux-core/nouveau_sgdma.c b/linux-core/nouveau_sgdma.c
index 97d5330b..b86c5d7c 100644
--- a/linux-core/nouveau_sgdma.c
+++ b/linux-core/nouveau_sgdma.c
@@ -80,16 +80,16 @@ nouveau_sgdma_clear(struct drm_ttm_backend *be)
}
static int
-nouveau_sgdma_bind(struct drm_ttm_backend *be, unsigned long pg_start,
- int cached)
+nouveau_sgdma_bind(struct drm_ttm_backend *be, struct drm_bo_mem_reg *mem)
{
struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)be;
struct drm_nouveau_private *dev_priv = nvbe->dev->dev_private;
struct nouveau_gpuobj *gpuobj = dev_priv->gart_info.sg_ctxdma;
- uint64_t offset = (pg_start << PAGE_SHIFT);
+ uint64_t offset = (mem->mm_node->start << PAGE_SHIFT);
uint32_t i;
- DRM_DEBUG("pg=0x%lx (0x%llx), cached=%d\n", pg_start, offset, cached);
+ DRM_DEBUG("pg=0x%lx (0x%llx), cached=%d\n", mem->mm_node->start,
+ offset, (mem->flags & DRM_BO_FLAG_CACHED) == 1);
if (offset & NV_CTXDMA_PAGE_MASK)
return -EINVAL;
@@ -188,7 +188,6 @@ nouveau_sgdma_init_ttm(struct drm_device *dev)
nvbe->dev = dev;
nvbe->backend.func = &nouveau_sgdma_backend;
- nvbe->backend.mem_type = DRM_BO_MEM_TT;
return &nvbe->backend;
}
@@ -278,6 +277,8 @@ nouveau_sgdma_nottm_hack_init(struct drm_device *dev)
struct drm_nouveau_private *dev_priv = dev->dev_private;
struct drm_ttm_backend *be;
struct drm_scatter_gather sgreq;
+ struct drm_mm_node mm_node;
+ struct drm_bo_mem_reg mem;
int ret;
dev_priv->gart_info.sg_be = nouveau_sgdma_init_ttm(dev);
@@ -303,7 +304,10 @@ nouveau_sgdma_nottm_hack_init(struct drm_device *dev)
return ret;
}
- if ((ret = be->func->bind(be, 0, 0))) {
+ mm_node.start = 0;
+ mem.mm_node = &mm_node;
+
+ if ((ret = be->func->bind(be, &mem))) {
DRM_ERROR("failed bind: %d\n", ret);
return ret;
}