Skip to content

Commit

Permalink
drm/i915: Eliminate nested get/put pages
Browse files Browse the repository at this point in the history
By using read_cache_page() for individual pages during pwrite/pread we
can eliminate an unnecessary large allocation (and immediate free) of
obj->pages. Also this eliminates any potential nesting of get/put pages,
simplifying the code and preparing the path for greater things.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
  • Loading branch information
Chris Wilson committed Oct 28, 2010
1 parent 39a01d1 commit e5281cc
Show file tree
Hide file tree
Showing 2 changed files with 163 additions and 204 deletions.
9 changes: 0 additions & 9 deletions drivers/gpu/drm/i915/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -747,15 +747,6 @@ struct drm_i915_gem_object {
*/
unsigned int madv : 2;

/**
* Refcount for the pages array. With the current locking scheme, there
* are at most two concurrent users: Binding a bo to the gtt and
* pwrite/pread using physical addresses. So two bits for a maximum
* of two users are enough.
*/
unsigned int pages_refcount : 2;
#define DRM_I915_GEM_OBJECT_MAX_PAGES_REFCOUNT 0x3

/**
* Current tiling mode for the object.
*/
Expand Down
Loading

0 comments on commit e5281cc

Please sign in to comment.