Don't map the GEM uvm_aobj copy-on-write -- what was I thinking?

Do transfer the GEM object reference to the uvm_aobj reference --
these are not the same thing.  (There's another uvm object whose
references are the same thing as the GEM object references, but
that's not the uao.)

With these changes, it looks like the GPU is no longer trying to draw
graphics all over kernel data structures.  Wish I had that month of
debugging back!
This commit is contained in:
riastradh 2014-05-20 15:12:41 +00:00
parent 368fe5a982
commit 24c81ef173
1 changed files with 3 additions and 1 deletions

View File

@ -1490,9 +1490,11 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data,
obj->gemo_shm_uao, args->offset, 0, obj->gemo_shm_uao, args->offset, 0,
UVM_MAPFLAG((VM_PROT_READ | VM_PROT_WRITE), UVM_MAPFLAG((VM_PROT_READ | VM_PROT_WRITE),
(VM_PROT_READ | VM_PROT_WRITE), UVM_INH_COPY, UVM_ADV_NORMAL, (VM_PROT_READ | VM_PROT_WRITE), UVM_INH_COPY, UVM_ADV_NORMAL,
UVM_FLAG_COPYONW)); 0));
if (ret) if (ret)
return ret; return ret;
uao_reference(obj->gemo_shm_uao);
drm_gem_object_unreference_unlocked(obj);
#else #else
addr = vm_mmap(obj->filp, 0, args->size, addr = vm_mmap(obj->filp, 0, args->size,
PROT_READ | PROT_WRITE, MAP_SHARED, PROT_READ | PROT_WRITE, MAP_SHARED,