diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2010-03-02 09:22:38 +0100 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2010-03-04 09:38:37 -0800 |
commit | d0800d098739d5e8ea94be9c5ed2f7a8a86c06dc (patch) | |
tree | aea1efd1320d234185081fef7b814236b6817741 | |
parent | 086c0e25cac1d3dd0a37def8b5cb82c1c6279edf (diff) |
i830_memory: no memory allocations without a bo!
Kill the corresponding !bo path in i830_free_memory.
Also kill another remnant of the pre-kms era in the same file, while I
was looking at the code.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
-rw-r--r-- | src/i830_memory.c | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/src/i830_memory.c b/src/i830_memory.c index 2c00d436..f97efc9a 100644 --- a/src/i830_memory.c +++ b/src/i830_memory.c @@ -87,9 +87,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "i810_reg.h" #include "i915_drm.h" -/* Our hardware status area is just a single page */ -#define HWSTATUS_PAGE_SIZE GTT_PAGE_SIZE - /** * Returns the fence size for a tiled area of the given size. */ @@ -168,34 +165,27 @@ i830_check_display_stride(ScrnInfoPtr scrn, int stride, Bool tiling) void i830_free_memory(ScrnInfoPtr scrn, i830_memory * mem) { + intel_screen_private *intel = intel_get_screen_private(scrn); + if (mem == NULL) return; - if (mem->bo != NULL) { - intel_screen_private *intel = intel_get_screen_private(scrn); - dri_bo_unreference(mem->bo); - if (intel->bo_list == mem) { - intel->bo_list = mem->next; - if (mem->next) - mem->next->prev = NULL; - } else { - if (mem->prev) - mem->prev->next = mem->next; - if (mem->next) - mem->next->prev = mem->prev; - } - xfree(mem->name); - xfree(mem); - return; - } - /* Disconnect from the list of allocations */ - if (mem->prev != NULL) - mem->prev->next = mem->next; - if (mem->next != NULL) - mem->next->prev = mem->prev; + assert(mem->bo != NULL); + dri_bo_unreference(mem->bo); + if (intel->bo_list == mem) { + intel->bo_list = mem->next; + if (mem->next) + mem->next->prev = NULL; + } else { + if (mem->prev) + mem->prev->next = mem->next; + if (mem->next) + mem->next->prev = mem->prev; + } xfree(mem->name); xfree(mem); + return; } /* Resets the state of the aperture allocator, freeing all memory that had |