From: "Michel Dänzer" <michel@daenzer.net>
To: dri-devel@lists.freedesktop.org
Cc: Lauri Kasanen <cand@gmx.com>
Subject: [PATCH 4/5] drm/ttm: Add TTM_PL_FLAG_BOTTOMUP
Date: Tue, 28 Oct 2014 18:35:05 +0900 [thread overview]
Message-ID: <1414488906-3924-4-git-send-email-michel@daenzer.net> (raw)
In-Reply-To: <1414488906-3924-1-git-send-email-michel@daenzer.net>
From: Michel Dänzer <michel.daenzer@amd.com>
For placing a BO strictly from the bottom up, i.e. in the lowest hole which
can hold it.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
drivers/gpu/drm/ttm/ttm_bo_manager.c | 5 +++++
include/drm/ttm/ttm_placement.h | 5 ++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/ttm/ttm_bo_manager.c b/drivers/gpu/drm/ttm/ttm_bo_manager.c
index aa0bd05..a64397b 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_manager.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_manager.c
@@ -73,6 +73,11 @@ static int ttm_bo_man_get_node(struct ttm_mem_type_manager *man,
aflags = DRM_MM_CREATE_TOP;
}
+ if (place->flags & TTM_PL_FLAG_BOTTOMUP) {
+ sflags = DRM_MM_SEARCH_DEFAULT;
+ aflags = DRM_MM_CREATE_DEFAULT;
+ }
+
spin_lock(&rman->lock);
ret = drm_mm_insert_node_in_range_generic(mm, node, mem->num_pages,
mem->page_alignment, 0,
diff --git a/include/drm/ttm/ttm_placement.h b/include/drm/ttm/ttm_placement.h
index 8ed44f9..c9ae86a 100644
--- a/include/drm/ttm/ttm_placement.h
+++ b/include/drm/ttm/ttm_placement.h
@@ -66,7 +66,9 @@
* TTM_PL_FLAG_NO_EVICT means that the buffer may never
* be evicted to make room for other buffers.
* TTM_PL_FLAG_TOPDOWN requests to be placed from the
- * top of the memory area, instead of the bottom.
+ * top of the memory area.
+ * TTM_PL_FLAG_BOTTOMUP requests to be placed from the
+ * bottom of the memory area.
*/
#define TTM_PL_FLAG_CACHED (1 << 16)
@@ -75,6 +77,7 @@
#define TTM_PL_FLAG_SHARED (1 << 20)
#define TTM_PL_FLAG_NO_EVICT (1 << 21)
#define TTM_PL_FLAG_TOPDOWN (1 << 22)
+#define TTM_PL_FLAG_BOTTOMUP (1 << 23)
#define TTM_PL_MASK_CACHING (TTM_PL_FLAG_CACHED | \
TTM_PL_FLAG_UNCACHED | \
--
2.1.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2014-10-28 9:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-28 9:35 [PATCH 1/5] drm/radeon: Set TTM_PL_FLAG_TOPDOWN also for RADEON_GEM_CPU_ACCESS BOs Michel Dänzer
2014-10-28 9:35 ` [PATCH 2/5] drm/ttm: Add DRM_MM_SEARCH_BELOW for TTM_PL_FLAG_TOPDOWN Michel Dänzer
2014-10-28 9:35 ` [PATCH 3/5] drm/ttm: Use only " Michel Dänzer
2014-10-28 11:10 ` Daniel Vetter
2014-10-30 8:41 ` Michel Dänzer
2014-10-30 15:07 ` Thomas Hellstrom
2014-10-31 17:19 ` Daniel Vetter
2014-10-28 9:35 ` Michel Dänzer [this message]
2014-10-30 8:36 ` [PATCH 4/4] drm/mm: Remove DRM_MM_SEARCH_BEST Michel Dänzer
2014-10-31 18:10 ` Alex Deucher
2014-11-04 8:47 ` Michel Dänzer
2014-11-04 14:30 ` Alex Deucher
2014-10-28 9:35 ` [PATCH 5/5] drm/radeon: Use TTM_PL_FLAG_BOTTOMUP Michel Dänzer
2014-10-28 10:46 ` [PATCH 1/5] drm/radeon: Set TTM_PL_FLAG_TOPDOWN also for RADEON_GEM_CPU_ACCESS BOs Lauri Kasanen
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=1414488906-3924-4-git-send-email-michel@daenzer.net \
--to=michel@daenzer.net \
--cc=cand@gmx.com \
--cc=dri-devel@lists.freedesktop.org \
/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