Needed by buffers that can move in GPU address space, but are not
swappable. An example is a wrapped PVR buffer, added by an upcoming
patch.
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
BUG_ON(!atomic_read(&bo->reserved));
if (!(bo->mem.placement & TTM_PL_FLAG_NO_EVICT)) {
+ bool swappable;
BUG_ON(!list_empty(&bo->lru));
list_add_tail(&bo->lru, &man->lru);
kref_get(&bo->list_kref);
- if (bo->ttm != NULL) {
+ swappable = !(bo->mem.placement & TTM_PL_FLAG_NO_SWAP);
+ if (bo->ttm != NULL && swappable) {
list_add_tail(&bo->swap, &bo->glob->swap_lru);
kref_get(&bo->list_kref);
}
* reference the buffer.
* TTM_PL_FLAG_NO_EVICT means that the buffer may never
* be evicted to make room for other buffers.
+ * TTM_PL_FLAG_NO_SWAP means that the buffer cannot be
+ * swapped. If NO_EVICT is not set the buffer can still
+ * be moved as long as its placement allows it.
*/
#define TTM_PL_FLAG_CACHED (1 << 16)
#define TTM_PL_FLAG_WC (1 << 18)
#define TTM_PL_FLAG_SHARED (1 << 20)
#define TTM_PL_FLAG_NO_EVICT (1 << 21)
+#define TTM_PL_FLAG_NO_SWAP (1 << 22)
#define TTM_PL_MASK_CACHING (TTM_PL_FLAG_CACHED | \
TTM_PL_FLAG_UNCACHED | \