History

drm/i915: Replace the array of pages with a scatterlist

Rather than have multiple data structures for describing our page layout in conjunction with the array of pages, we can migrate all users over to a scatterlist. One major advantage, other than unifying the page tracking structures, this offers is that we replace the vmalloc'ed array (which can be up to a megabyte in size) with a chain of individual pages which helps reduce memory pressure. The disadvantage is that we then do not have a simple array to iterate, or to access randomly. The common case for this is in the relocation processing, which will typically fit within a single scatterlist page and so be almost the same cost as the simple array. For iterating over the array, the extra function call could be optimised away, but in reality is an insignificant cost of either binding the pages, or performing the pwrite/pread. v2: Fix drm_clflush_sg() to not invoke wbinvd as well! And fix the trivial compile error from rebasing.

Chris Wilson committed 14 years ago

Commit 9da3da61 parent f60d7f012 files · +239 −220Browse files

Showing the changes to include/drm (2 of 12 files). Show all

Unified · Split

2 files
  1. include/drm/drmP.h +1 −0
  2. include/drm/intel-gtt.h +2 −8
include/drm/drmP.h+1−0
@@ -1367,6 +1367,7 @@ extern int drm_remove_magic(struct drm_master *master, drm_magic_t magic); · 1366 unmodified lines
13671367
13681368 /* Cache management (drm_cache.c) */
13691369 void drm_clflush_pages(struct page *pages[], unsigned long num_pages);
1370+void drm_clflush_sg(struct sg_table *st);
13701371 void drm_clflush_virt_range(char *addr, unsigned long length);
13711372
13721373 /* Locking IOCTL support (drm_lock.h) */
include/drm/intel-gtt.h+2−8
@@ -30,16 +30,10 @@ void intel_gmch_remove(void); · 29 unmodified lines
3030 bool intel_enable_gtt(void);
3131
3232 void intel_gtt_chipset_flush(void);
33−void intel_gtt_unmap_memory(struct scatterlist *sg_list, int num_sg);
34−void intel_gtt_clear_range(unsigned int first_entry, unsigned int num_entries);
35−int intel_gtt_map_memory(struct page **pages, unsigned int num_entries,
36− struct scatterlist **sg_list, int *num_sg);
37−void intel_gtt_insert_sg_entries(struct scatterlist *sg_list,
38− unsigned int sg_len,
33+void intel_gtt_insert_sg_entries(struct sg_table *st,
3934 unsigned int pg_start,
4035 unsigned int flags);
41−void intel_gtt_insert_pages(unsigned int first_entry, unsigned int num_entries,
42− struct page **pages, unsigned int flags);
36+void intel_gtt_clear_range(unsigned int first_entry, unsigned int num_entries);
4337
4438 /* Special gtt memory types */
4539 #define AGP_DCACHE_MEMORY 1