drm/ttm: remove split btw highmen and lowmem page
authorJerome Glisse <jglisse@redhat.com>
Tue, 1 Nov 2011 19:57:22 +0000 (15:57 -0400)
committerDave Airlie <airlied@redhat.com>
Tue, 6 Dec 2011 10:38:36 +0000 (10:38 +0000)
Split btw highmem and lowmem page was rendered useless by the
pool code. Remove it. Note further cleanup would change the
ttm page allocation helper to actualy take an array instead
of relying on list this could drasticly reduce the number of
function call in the common case of allocation whole buffer.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
drivers/gpu/drm/ttm/ttm_tt.c
include/drm/ttm/ttm_bo_driver.h

index c68b0e770d164db6ade3e3c06bbf3271a1524210..f0c5ffd446d9b2b8f03c5cb175b1824d6ac9b71b 100644 (file)
@@ -70,7 +70,7 @@ static struct page *__ttm_tt_get_page(struct ttm_tt *ttm, int index)
        struct ttm_mem_global *mem_glob = ttm->glob->mem_glob;
        int ret;
 
-       while (NULL == (p = ttm->pages[index])) {
+       if (NULL == (p = ttm->pages[index])) {
 
                INIT_LIST_HEAD(&h);
 
@@ -86,10 +86,7 @@ static struct page *__ttm_tt_get_page(struct ttm_tt *ttm, int index)
                if (unlikely(ret != 0))
                        goto out_err;
 
-               if (PageHighMem(p))
-                       ttm->pages[--ttm->first_himem_page] = p;
-               else
-                       ttm->pages[++ttm->last_lomem_page] = p;
+               ttm->pages[index] = p;
        }
        return p;
 out_err:
@@ -271,8 +268,6 @@ static void ttm_tt_free_alloced_pages(struct ttm_tt *ttm)
        ttm_put_pages(&h, count, ttm->page_flags, ttm->caching_state,
                      ttm->dma_address);
        ttm->state = tt_unpopulated;
-       ttm->first_himem_page = ttm->num_pages;
-       ttm->last_lomem_page = -1;
 }
 
 void ttm_tt_destroy(struct ttm_tt *ttm)
@@ -316,8 +311,6 @@ struct ttm_tt *ttm_tt_create(struct ttm_bo_device *bdev, unsigned long size,
 
        ttm->glob = bdev->glob;
        ttm->num_pages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
-       ttm->first_himem_page = ttm->num_pages;
-       ttm->last_lomem_page = -1;
        ttm->caching_state = tt_cached;
        ttm->page_flags = page_flags;
 
index 37527d671f803554df7e0ab9e8600a4e6a1a1061..9da182b400ecf60ddcc3233c1bc89a4a4756cec6 100644 (file)
@@ -136,11 +136,6 @@ enum ttm_caching_state {
  * @dummy_read_page: Page to map where the ttm_tt page array contains a NULL
  * pointer.
  * @pages: Array of pages backing the data.
- * @first_himem_page: Himem pages are put last in the page array, which
- * enables us to run caching attribute changes on only the first part
- * of the page array containing lomem pages. This is the index of the
- * first himem page.
- * @last_lomem_page: Index of the last lomem page in the page array.
  * @num_pages: Number of pages in the page array.
  * @bdev: Pointer to the current struct ttm_bo_device.
  * @be: Pointer to the ttm backend.
@@ -157,8 +152,6 @@ enum ttm_caching_state {
 struct ttm_tt {
        struct page *dummy_read_page;
        struct page **pages;
-       long first_himem_page;
-       long last_lomem_page;
        uint32_t page_flags;
        unsigned long num_pages;
        struct ttm_bo_global *glob;