diff options
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.h')
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 12a075747dcf..1d7502faebd6 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -1006,16 +1006,11 @@ struct drm_i915_gem_object { | |||
1006 | 1006 | ||
1007 | unsigned int has_aliasing_ppgtt_mapping:1; | 1007 | unsigned int has_aliasing_ppgtt_mapping:1; |
1008 | unsigned int has_global_gtt_mapping:1; | 1008 | unsigned int has_global_gtt_mapping:1; |
1009 | unsigned int has_dma_mapping:1; | ||
1009 | 1010 | ||
1010 | struct page **pages; | 1011 | struct sg_table *pages; |
1011 | int pages_pin_count; | 1012 | int pages_pin_count; |
1012 | 1013 | ||
1013 | /** | ||
1014 | * DMAR support | ||
1015 | */ | ||
1016 | struct scatterlist *sg_list; | ||
1017 | int num_sg; | ||
1018 | |||
1019 | /* prime dma-buf support */ | 1014 | /* prime dma-buf support */ |
1020 | struct sg_table *sg_table; | 1015 | struct sg_table *sg_table; |
1021 | void *dma_buf_vmapping; | 1016 | void *dma_buf_vmapping; |
@@ -1342,6 +1337,15 @@ void i915_gem_release_mmap(struct drm_i915_gem_object *obj); | |||
1342 | void i915_gem_lastclose(struct drm_device *dev); | 1337 | void i915_gem_lastclose(struct drm_device *dev); |
1343 | 1338 | ||
1344 | int __must_check i915_gem_object_get_pages(struct drm_i915_gem_object *obj); | 1339 | int __must_check i915_gem_object_get_pages(struct drm_i915_gem_object *obj); |
1340 | static inline struct page *i915_gem_object_get_page(struct drm_i915_gem_object *obj, int n) | ||
1341 | { | ||
1342 | struct scatterlist *sg = obj->pages->sgl; | ||
1343 | while (n >= SG_MAX_SINGLE_ALLOC) { | ||
1344 | sg = sg_chain_ptr(sg + SG_MAX_SINGLE_ALLOC - 1); | ||
1345 | n -= SG_MAX_SINGLE_ALLOC - 1; | ||
1346 | } | ||
1347 | return sg_page(sg+n); | ||
1348 | } | ||
1345 | static inline void i915_gem_object_pin_pages(struct drm_i915_gem_object *obj) | 1349 | static inline void i915_gem_object_pin_pages(struct drm_i915_gem_object *obj) |
1346 | { | 1350 | { |
1347 | BUG_ON(obj->pages == NULL); | 1351 | BUG_ON(obj->pages == NULL); |