diff options
author | Michel Thierry <michel.thierry@intel.com> | 2015-04-08 12:13:33 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-04-10 08:56:12 +0200 |
commit | 33c8819f1b057b555c73886f69f9baabe72527e0 (patch) | |
tree | c39b812697676cd9b0779ff8aff8b735c1c131a2 /drivers/gpu/drm/i915/i915_gem_gtt.h | |
parent | e5815a2e0543f4381d3e8fa90f86c56ce68eee75 (diff) | |
download | lwn-33c8819f1b057b555c73886f69f9baabe72527e0.tar.gz lwn-33c8819f1b057b555c73886f69f9baabe72527e0.zip |
drm/i915/gen8: begin bitmap tracking
Like with gen6/7, we can enable bitmap tracking with all the
preallocations to make sure things actually don't blow up.
v2: Rebased to match changes from previous patches.
v3: Without teardown logic, rely on used_pdpes and used_pdes when
freeing page tables.
v4: Rebased after s/page_tables/page_table/.
v5: Rebased after page table generalizations.
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Michel Thierry <michel.thierry@intel.com> (v2+)
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_gtt.h')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_gtt.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.h b/drivers/gpu/drm/i915/i915_gem_gtt.h index c3d5d40b78b2..29de64d1164e 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.h +++ b/drivers/gpu/drm/i915/i915_gem_gtt.h @@ -220,11 +220,13 @@ struct i915_page_directory { dma_addr_t daddr; }; + unsigned long *used_pdes; struct i915_page_table *page_table[I915_PDES]; /* PDEs */ }; struct i915_page_directory_pointer { /* struct page *page; */ + DECLARE_BITMAP(used_pdpes, GEN8_LEGACY_PDPES); struct i915_page_directory *page_directory[GEN8_LEGACY_PDPES]; }; @@ -453,6 +455,11 @@ static inline uint32_t gen8_pml4e_index(uint64_t address) return 0; } +static inline size_t gen8_pte_count(uint64_t address, uint64_t length) +{ + return i915_pte_count(address, length, GEN8_PDE_SHIFT); +} + int i915_gem_gtt_init(struct drm_device *dev); void i915_gem_init_global_gtt(struct drm_device *dev); void i915_global_gtt_cleanup(struct drm_device *dev); |