dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: j.glisse@gmail.com
To: dri-devel@lists.freedesktop.org
Cc: thellstrom@vmware.com, Jerome Glisse <jglisse@redhat.com>
Subject: [PATCH 2/8] drm/ttm: remove split btw highmen and lowmem page
Date: Wed,  2 Nov 2011 19:37:49 -0400	[thread overview]
Message-ID: <1320277075-19980-3-git-send-email-j.glisse@gmail.com> (raw)
In-Reply-To: <1320277075-19980-1-git-send-email-j.glisse@gmail.com>

From: Jerome Glisse <jglisse@redhat.com>

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>
---
 drivers/gpu/drm/ttm/ttm_tt.c    |   11 ++---------
 include/drm/ttm/ttm_bo_driver.h |    7 -------
 2 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index 82a1161..8b7a6d0 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -69,7 +69,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);
 
@@ -85,10 +85,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:
@@ -270,8 +267,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)
@@ -315,8 +310,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;
 
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index 37527d6..9da182b 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -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;
-- 
1.7.1

  parent reply	other threads:[~2011-11-02 23:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-02 23:37 [RFC] ttm merge ttm_backend & ttm_t V2 j.glisse
2011-11-02 23:37 ` [PATCH 1/8] drm/ttm: remove userspace backed ttm object support j.glisse
2011-11-02 23:37 ` j.glisse [this message]
2011-11-02 23:37 ` [PATCH 3/8] drm/ttm: remove unused backend flags field j.glisse
2011-11-02 23:37 ` [PATCH 4/8] drm/ttm: use ttm put pages function to properly restore cache attribute j.glisse
2011-11-03 18:35   ` Konrad Rzeszutek Wilk
2011-11-02 23:37 ` [PATCH 5/8] drm/ttm: convert page allocation to use page ptr array instead of list V2 j.glisse
2011-11-03 18:45   ` Konrad Rzeszutek Wilk
2011-11-02 23:37 ` [PATCH 6/8] drm/ttm: test for dma_address array allocation failure j.glisse
2011-11-03 18:45   ` Konrad Rzeszutek Wilk
2011-11-02 23:37 ` [PATCH 7/8] drm/ttm: merge ttm_backend and ttm_tt j.glisse
2011-11-02 23:37 ` [PATCH 8/8] drm/ttm: introduce callback for ttm_tt populate & unpopulate j.glisse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1320277075-19980-3-git-send-email-j.glisse@gmail.com \
    --to=j.glisse@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jglisse@redhat.com \
    --cc=thellstrom@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox