aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_drv.h
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-02-09 11:15:46 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-02-09 15:25:11 -0500
commit1d2a314c97ceaf383de8e23cdde46729927d433c (patch)
tree31df6c81a19d80b3611c39cb17c613561a9f0b0b /drivers/gpu/drm/i915/i915_drv.h
parent428ccb21b740f603a6a1f08cbe6d935fb3177620 (diff)
drm/i915: initialization/teardown for the aliasing ppgtt
This just adds the setup and teardown code for the ppgtt PDE and the last-level pagetables, which are fixed for the entire lifetime, at least for the moment. v2: Kill the stray debug printk noted by and improve the pte definitions as suggested by Chris Wilson. v3: Clean up the aperture stealing code as noted by Ben Widawsky. v4: Paint the init code in a more pleasing colour as suggest by Chris Wilson. v5: Explain the magic numbers noticed by Ben Widawsky. Reviewed-by: Ben Widawsky <ben@bwidawsk.net> Tested-by: Chris Wilson <chris@chris-wilson.co.uk> Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com> Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com> Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.h')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 28740bc0200a..03a9e49fe93d 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -258,6 +258,16 @@ struct intel_device_info {
258 u8 has_llc:1; 258 u8 has_llc:1;
259}; 259};
260 260
261#define I915_PPGTT_PD_ENTRIES 512
262#define I915_PPGTT_PT_ENTRIES 1024
263struct i915_hw_ppgtt {
264 unsigned num_pd_entries;
265 struct page **pt_pages;
266 uint32_t pd_offset;
267 dma_addr_t *pt_dma_addr;
268 dma_addr_t scratch_page_dma_addr;
269};
270
261enum no_fbc_reason { 271enum no_fbc_reason {
262 FBC_NO_OUTPUT, /* no outputs enabled to compress */ 272 FBC_NO_OUTPUT, /* no outputs enabled to compress */
263 FBC_STOLEN_TOO_SMALL, /* not enough space to hold compressed buffers */ 273 FBC_STOLEN_TOO_SMALL, /* not enough space to hold compressed buffers */
@@ -578,6 +588,9 @@ typedef struct drm_i915_private {
578 struct io_mapping *gtt_mapping; 588 struct io_mapping *gtt_mapping;
579 int gtt_mtrr; 589 int gtt_mtrr;
580 590
591 /** PPGTT used for aliasing the PPGTT with the GTT */
592 struct i915_hw_ppgtt *aliasing_ppgtt;
593
581 struct shrinker inactive_shrinker; 594 struct shrinker inactive_shrinker;
582 595
583 /** 596 /**
@@ -973,6 +986,8 @@ struct drm_i915_file_private {
973#define HAS_LLC(dev) (INTEL_INFO(dev)->has_llc) 986#define HAS_LLC(dev) (INTEL_INFO(dev)->has_llc)
974#define I915_NEED_GFX_HWS(dev) (INTEL_INFO(dev)->need_gfx_hws) 987#define I915_NEED_GFX_HWS(dev) (INTEL_INFO(dev)->need_gfx_hws)
975 988
989#define HAS_ALIASING_PPGTT(dev) (INTEL_INFO(dev)->gen >=6)
990
976#define HAS_OVERLAY(dev) (INTEL_INFO(dev)->has_overlay) 991#define HAS_OVERLAY(dev) (INTEL_INFO(dev)->has_overlay)
977#define OVERLAY_NEEDS_PHYSICAL(dev) (INTEL_INFO(dev)->overlay_needs_physical) 992#define OVERLAY_NEEDS_PHYSICAL(dev) (INTEL_INFO(dev)->overlay_needs_physical)
978 993
@@ -1232,6 +1247,9 @@ int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,
1232 enum i915_cache_level cache_level); 1247 enum i915_cache_level cache_level);
1233 1248
1234/* i915_gem_gtt.c */ 1249/* i915_gem_gtt.c */
1250int __must_check i915_gem_init_aliasing_ppgtt(struct drm_device *dev);
1251void i915_gem_cleanup_aliasing_ppgtt(struct drm_device *dev);
1252
1235void i915_gem_restore_gtt_mappings(struct drm_device *dev); 1253void i915_gem_restore_gtt_mappings(struct drm_device *dev);
1236int __must_check i915_gem_gtt_bind_object(struct drm_i915_gem_object *obj); 1254int __must_check i915_gem_gtt_bind_object(struct drm_i915_gem_object *obj);
1237void i915_gem_gtt_rebind_object(struct drm_i915_gem_object *obj, 1255void i915_gem_gtt_rebind_object(struct drm_i915_gem_object *obj,