]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: simplify shmem pwrite/pread slowpath handling
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 15 Nov 2012 14:40:05 +0000 (15:40 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 29 Nov 2012 12:48:34 +0000 (13:48 +0100)
commit3f52795ce0f1fe3f35af38fc95acfa05494f5dfb
tree6a6bce202f63b8a393b1333e48e18e02eff36379
parentf35b80f215ee9e75928d28cb57d15617a7f02393
drm/i915: simplify shmem pwrite/pread slowpath handling

The shmem paths for pwrite/pread used a clever trick to hold onto a
single page when dropping the big dev->struct_mutex for the slowpath.
But this ran the risk of reinstating (or not completely purging) the
backing storage when dropping purgeable objects.

Hence the code needed to keep track of whether it ever dropped the
lock, and if it did, manually check whether it needs to re-purge the
backing storage. But thanks to the pages pin count introduced in

commit 3e82d56e1d41600c9badffedb61e79d56d66a82a
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Sep 4 21:02:54 2012 +0100

    drm/i915: Pin backing pages whilst exporting through a dmabuf vmap

which allowed us to pin the backing storage and remove that page
reference trick from shmem_pwrite/read in

commit 68d6bd8c5389ba18d3f03f5c5a3b8a04a21ec54f
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Sep 4 21:02:56 2012 +0100

    drm/i915: Pin backing pages for pread

and

commit c7949a4061b192a487974db8a67418016fcf9f66
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Sep 4 21:02:55 2012 +0100

    drm/i915: Pin backing pages for pwrite

we can now abolish this check. The slowpath cleanup completely
disappears from pread, and for pwrite we're only left with the domain
fixup in case someone moved the object out of the cpu domain from
under us. A follow-on patch will optimize that a notch more.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem.c