• Chris Wilson's avatar
    drm/i915: Pin backing pages for pwrite · 755d2218
    Chris Wilson authored
    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: default avatarChris Wilson <chris@chris-wilson.co.uk>
    Reviewed-by: default avatarBen Widawsky <ben@bwidawsk.net>
    [danvet: Added note to explain the question Ben raised in review.]
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
i915_gem.c 110 KB