diff mbox

[2/5] drm/ttm: fix adding foreign BOs to the swap LRU

Message ID 1452522922-2614-2-git-send-email-deathsimple@vodafone.de (mailing list archive)
State New, archived
Headers show

Commit Message

Christian König Jan. 11, 2016, 2:35 p.m. UTC
From: Christian König <christian.koenig@amd.com>

It doesn't make any sense to try to swap out imported BOs.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/ttm/ttm_bo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Thomas Hellström (VMware) Jan. 11, 2016, 3:14 p.m. UTC | #1
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>

BTW, does Radeon touch the caching mode of imported buffers through TTM
(like write-combining)?
Do we need something similar for that?

/Thomas


On 01/11/2016 03:35 PM, Christian König wrote:
> From: Christian König <christian.koenig@amd.com>
>
> It doesn't make any sense to try to swap out imported BOs.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>  drivers/gpu/drm/ttm/ttm_bo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index a98a5d5..3ea9a01 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -176,7 +176,7 @@ void ttm_bo_add_to_lru(struct ttm_buffer_object *bo)
>  		list_add_tail(&bo->lru, &man->lru);
>  		kref_get(&bo->list_kref);
>  
> -		if (bo->ttm != NULL) {
> +		if (bo->ttm && !(bo->ttm->page_flags & TTM_PAGE_FLAG_SG)) {
>  			list_add_tail(&bo->swap, &bo->glob->swap_lru);
>  			kref_get(&bo->list_kref);
>  		}
diff mbox

Patch

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index a98a5d5..3ea9a01 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -176,7 +176,7 @@  void ttm_bo_add_to_lru(struct ttm_buffer_object *bo)
 		list_add_tail(&bo->lru, &man->lru);
 		kref_get(&bo->list_kref);
 
-		if (bo->ttm != NULL) {
+		if (bo->ttm && !(bo->ttm->page_flags & TTM_PAGE_FLAG_SG)) {
 			list_add_tail(&bo->swap, &bo->glob->swap_lru);
 			kref_get(&bo->list_kref);
 		}