diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2010-04-30 21:56:40 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2010-04-30 21:56:40 +0000 |
commit | 4eed52b3aaa476cb47de702e65ce4ce63bfd3fea (patch) | |
tree | cb1ddd73d5a20fd22d0b661ea898ae0d2ebe17c6 /sys/dev/pci | |
parent | 5d79ad7170d9e5ffdeb9aa5870d1a3729057e720 (diff) |
Right now, if anything internal changes with a uvm object, diverse
places in the tree need to be touched to update the object
initialisation with respect to that.
So, make a function (uvm_initobj) that takes the refcount, object and
pager ops and does this initialisation for us. This should save on
maintainance in the future.
looked good to fgs@. Tedu complained about the British spelling but OKed
it anyway.
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/drm/drm_drv.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c index 7db9a43153f..17c43a356e7 100644 --- a/sys/dev/pci/drm/drm_drv.c +++ b/sys/dev/pci/drm/drm_drv.c @@ -1233,11 +1233,7 @@ drm_gem_object_alloc(struct drm_device *dev, size_t size) /* uao create can't fail in the 0 case, it just sleeps */ obj->uao = uao_create(size, 0); obj->size = size; - simple_lock_init(&obj->uobj.vmobjlock); - obj->uobj.pgops = &drm_pgops; - RB_INIT(&obj->uobj.memt); - obj->uobj.uo_npages = 0; - obj->uobj.uo_refs = 1; + uvm_objinit(&obj->uobj, &drm_pgops, 1); if (dev->driver->gem_init_object != NULL && dev->driver->gem_init_object(obj) != 0) { |