summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2011-11-03 01:22:39 -0400
committerJerome Glisse <jglisse@redhat.com>2011-12-05 18:25:13 -0500
commitae62999f06e8e85f4610b499fefc6881f9b5272d (patch)
tree5bda935435b3f2038980d261204389d98d360dd7
parent42c68329a697f2b375b4300e1f4e23b7b4189e9a (diff)
drm/ttm: use ttm put pages function to properly restore cache attribute
On failure we need to make sure the page we free has wb cache attribute. Do this pas call the proper ttm page helper function. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
-rw-r--r--drivers/gpu/drm/ttm/ttm_tt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index f0c5ffd446d9..90527a2ce04c 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -90,7 +90,10 @@ static struct page *__ttm_tt_get_page(struct ttm_tt *ttm, int index)
}
return p;
out_err:
- put_page(p);
+ INIT_LIST_HEAD(&h);
+ list_add(&p->lru, &h);
+ ttm_put_pages(&h, 1, ttm->page_flags,
+ ttm->caching_state, &ttm->dma_address[index]);
return NULL;
}