diff options
author | Ben Widawsky <ben@bwidawsk.net> | 2012-11-04 12:21:27 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-11-11 17:51:42 -0500 |
commit | e76e9aebcdbfebae8f4cd147e3c0f800d36e97f3 (patch) | |
tree | 94272c5f3ee021931bfe43136d81076b10a26c77 /drivers/gpu/drm/i915/i915_drv.h | |
parent | b3fcabb15bb83202fb5e4e5b296711b91c4942a3 (diff) |
drm/i915: Stop using AGP layer for GEN6+
As a quick hack we make the old intel_gtt structure mutable so we can
fool a bunch of the existing code which depends on elements in that data
structure. We can/should try to remove this in a subsequent patch.
This should preserve the old gtt init behavior which upon writing these
patches seems incorrect. The next patch will fix these things.
The one exception is VLV which doesn't have the preserved flush control
write behavior. Since we want to do that for all GEN6+ stuff, we'll
handle that in a later patch. Mainstream VLV support doesn't actually
exist yet anyway.
v2: Update the comment to remove the "voodoo"
Check that the last pte written matches what we readback
v3: actually kill cache_level_to_agp_type since most of the flags will
disappear in an upcoming patch
v4: v3 was actually not what we wanted (Daniel)
Make the ggtt bind assertions better and stricter (Chris)
Fix some uncaught errors at gtt init (Chris)
Some other random stuff that Chris wanted
v5: check for i==0 in gen6_ggtt_bind_object to shut up gcc (Ben)
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by [v4]: Chris Wilson <chris@chris-wilson.co.uk>
[danvet: Make the cache_level -> agp_flags conversion for pre-gen6 a
tad more robust by mapping everything != CACHE_NONE to the cached agp
flag - we have a 1:1 uncached mapping, but different modes of
cacheable (at least on later generations). Suggested by Chris Wilson.]
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.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index c4339c2b1b57..f316916fe65e 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -746,7 +746,7 @@ typedef struct drm_i915_private { | |||
746 | 746 | ||
747 | struct { | 747 | struct { |
748 | /** Bridge to intel-gtt-ko */ | 748 | /** Bridge to intel-gtt-ko */ |
749 | const struct intel_gtt *gtt; | 749 | struct intel_gtt *gtt; |
750 | /** Memory allocator for GTT stolen memory */ | 750 | /** Memory allocator for GTT stolen memory */ |
751 | struct drm_mm stolen; | 751 | struct drm_mm stolen; |
752 | /** Memory allocator for GTT */ | 752 | /** Memory allocator for GTT */ |
@@ -1538,6 +1538,14 @@ void i915_gem_init_global_gtt(struct drm_device *dev, | |||
1538 | unsigned long start, | 1538 | unsigned long start, |
1539 | unsigned long mappable_end, | 1539 | unsigned long mappable_end, |
1540 | unsigned long end); | 1540 | unsigned long end); |
1541 | int i915_gem_gtt_init(struct drm_device *dev); | ||
1542 | void i915_gem_gtt_fini(struct drm_device *dev); | ||
1543 | extern inline void i915_gem_chipset_flush(struct drm_device *dev) | ||
1544 | { | ||
1545 | if (INTEL_INFO(dev)->gen < 6) | ||
1546 | intel_gtt_chipset_flush(); | ||
1547 | } | ||
1548 | |||
1541 | 1549 | ||
1542 | /* i915_gem_evict.c */ | 1550 | /* i915_gem_evict.c */ |
1543 | int __must_check i915_gem_evict_something(struct drm_device *dev, int min_size, | 1551 | int __must_check i915_gem_evict_something(struct drm_device *dev, int min_size, |