From 3024f23c6551e219b0236041a8205bf1bc60ed94 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Wed, 31 Jan 2007 14:50:57 +0100 Subject: memory manager: Make device driver aware of different memory types. Memory types are either fixed (on-card or pre-bound AGP) or not fixed (dynamically bound) to an aperture. They also carry information about: 1) Whether they can be mapped cached. 2) Whether they are at all mappable. 3) Whether they need an ioremap to be accessible from kernel space. In this way VRAM memory and, for example, pre-bound AGP appear identical to the memory manager. This also makes support for unmappable VRAM simple to implement. --- linux-core/i915_drv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'linux-core/i915_drv.c') diff --git a/linux-core/i915_drv.c b/linux-core/i915_drv.c index 2c5b43d0..64ce3c15 100644 --- a/linux-core/i915_drv.c +++ b/linux-core/i915_drv.c @@ -51,11 +51,10 @@ static drm_fence_driver_t i915_fence_driver = { #endif #ifdef I915_HAVE_BUFFER static drm_bo_driver_t i915_bo_driver = { - .iomap = {NULL, NULL}, - .cached = {1, 1}, .create_ttm_backend_entry = i915_create_ttm_backend_entry, .fence_type = i915_fence_types, - .invalidate_caches = i915_invalidate_caches + .invalidate_caches = i915_invalidate_caches, + .init_mem_type = i915_init_mem_type, }; #endif -- cgit v1.2.3 From 609e3b037526021d20c7cc18b7fed1152206dc68 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Tue, 6 Feb 2007 14:20:33 +0100 Subject: Implement a policy for selecting memory types. --- linux-core/i915_drv.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'linux-core/i915_drv.c') diff --git a/linux-core/i915_drv.c b/linux-core/i915_drv.c index 64ce3c15..8c39c249 100644 --- a/linux-core/i915_drv.c +++ b/linux-core/i915_drv.c @@ -50,11 +50,20 @@ static drm_fence_driver_t i915_fence_driver = { }; #endif #ifdef I915_HAVE_BUFFER + +static uint32_t i915_mem_prios[] = {DRM_BO_MEM_PRIV0, DRM_BO_MEM_TT, DRM_BO_MEM_LOCAL}; +static uint32_t i915_busy_prios[] = {DRM_BO_MEM_TT, DRM_BO_MEM_PRIV0, DRM_BO_MEM_LOCAL}; + static drm_bo_driver_t i915_bo_driver = { + .mem_type_prio = i915_mem_prios, + .mem_busy_prio = i915_busy_prios, + .num_mem_type_prio = sizeof(i915_mem_prios)/sizeof(uint32_t), + .num_mem_busy_prio = sizeof(i915_busy_prios)/sizeof(uint32_t), .create_ttm_backend_entry = i915_create_ttm_backend_entry, .fence_type = i915_fence_types, .invalidate_caches = i915_invalidate_caches, .init_mem_type = i915_init_mem_type, + .evict_flags = i915_evict_flags, }; #endif -- cgit v1.2.3 From af24465b2eddfcc5296edc830ea5ed86065a4abd Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Wed, 7 Feb 2007 12:52:23 +0100 Subject: Fix a stray unlock_kernel() in drm_vm.c Add a file for memory move helpers, drm_bo_move.c Implement generic memory move. Cached, no_move and unmapped memory temporarily broken. --- linux-core/i915_drv.c | 1 + 1 file changed, 1 insertion(+) (limited to 'linux-core/i915_drv.c') diff --git a/linux-core/i915_drv.c b/linux-core/i915_drv.c index 8c39c249..19b63b7f 100644 --- a/linux-core/i915_drv.c +++ b/linux-core/i915_drv.c @@ -64,6 +64,7 @@ static drm_bo_driver_t i915_bo_driver = { .invalidate_caches = i915_invalidate_caches, .init_mem_type = i915_init_mem_type, .evict_flags = i915_evict_flags, + .move = NULL, }; #endif -- cgit v1.2.3 From 53aee3122a1821b8ca24ed2bc5c1940cb0f2ff8e Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Fri, 9 Feb 2007 16:36:53 +0100 Subject: I915 accelerated blit copy functional. Fixed - to System memory copies are implemented by flipping in a cache-coherent TTM, blitting to it, and then flipping it out. --- linux-core/i915_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux-core/i915_drv.c') diff --git a/linux-core/i915_drv.c b/linux-core/i915_drv.c index 19b63b7f..848ffa78 100644 --- a/linux-core/i915_drv.c +++ b/linux-core/i915_drv.c @@ -64,7 +64,7 @@ static drm_bo_driver_t i915_bo_driver = { .invalidate_caches = i915_invalidate_caches, .init_mem_type = i915_init_mem_type, .evict_flags = i915_evict_flags, - .move = NULL, + .move = i915_move, }; #endif -- cgit v1.2.3 From 5c9a7b0f9499b94856916facd110059223d243dc Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Wed, 14 Feb 2007 13:31:35 +0100 Subject: Remove an intel-specific hack and replace it with a fence driver callback. --- linux-core/i915_drv.c | 1 + 1 file changed, 1 insertion(+) (limited to 'linux-core/i915_drv.c') diff --git a/linux-core/i915_drv.c b/linux-core/i915_drv.c index 848ffa78..b7bf883c 100644 --- a/linux-core/i915_drv.c +++ b/linux-core/i915_drv.c @@ -47,6 +47,7 @@ static drm_fence_driver_t i915_fence_driver = { .lazy_capable = 1, .emit = i915_fence_emit_sequence, .poke_flush = i915_poke_flush, + .has_irq = i915_fence_has_irq, }; #endif #ifdef I915_HAVE_BUFFER -- cgit v1.2.3