]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Pin backing pages for pwrite
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 4 Sep 2012 20:02:55 +0000 (21:02 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 20 Sep 2012 12:22:56 +0000 (14:22 +0200)
commitdf0229b01d7b5f24e2aaab9265f6d2838cd9543d
tree44e1716bcd7fddd017749c418aeb79f88b8da0b2
parentc11fc2a27df18bd97037baba60c4cbef58989598
drm/i915: Pin backing pages for pwrite

By using the recently introduced pinning of pages, we can safely drop
the mutex in the knowledge that the pages are not going to disappear
jeneath us, and so we can simplify the code for iterating over the pages.

Note: The old code had such complicated page refcounting since it used
obj->pages as a micro-optimization if it's there, but that could
(before this patch) disappear when we drop the dev->struct_mutex.
Hence some manual page refcounting was required for the slow path,
complicated by the fact that pages returned by shmem_read_mapping_page
already have a pageref, which needs to be dropped again.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
[danvet: Added note to explain the question Ben raised in review.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem.c