Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 179875
b: refs/heads/master
c: bbb8c3d
h: refs/heads/master
i:
  179873: 7f286fe
  179871: d92c628
v: v3
  • Loading branch information
Ben Skeggs committed Jan 10, 2010
1 parent 699ac5f commit 3888708
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7fb8ec8e2bedc8381243cf4bdc4cfa8e657397a8
refs/heads/master: bbb8c3d8820893694a3567716adb3b6f6ba2b7d0
30 changes: 1 addition & 29 deletions trunk/drivers/gpu/drm/nouveau/nouveau_ttm.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,45 +28,17 @@

#include "nouveau_drv.h"

static struct vm_operations_struct nouveau_ttm_vm_ops;
static const struct vm_operations_struct *ttm_vm_ops;

static int
nouveau_ttm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
{
struct ttm_buffer_object *bo = vma->vm_private_data;
int ret;

if (unlikely(bo == NULL))
return VM_FAULT_NOPAGE;

ret = ttm_vm_ops->fault(vma, vmf);
return ret;
}

int
nouveau_ttm_mmap(struct file *filp, struct vm_area_struct *vma)
{
struct drm_file *file_priv = filp->private_data;
struct drm_nouveau_private *dev_priv =
file_priv->minor->dev->dev_private;
int ret;

if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
return drm_mmap(filp, vma);

ret = ttm_bo_mmap(filp, vma, &dev_priv->ttm.bdev);
if (unlikely(ret != 0))
return ret;

if (unlikely(ttm_vm_ops == NULL)) {
ttm_vm_ops = vma->vm_ops;
nouveau_ttm_vm_ops = *ttm_vm_ops;
nouveau_ttm_vm_ops.fault = &nouveau_ttm_fault;
}

vma->vm_ops = &nouveau_ttm_vm_ops;
return 0;
return ttm_bo_mmap(filp, vma, &dev_priv->ttm.bdev);
}

static int
Expand Down

0 comments on commit 3888708

Please sign in to comment.