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

Thomas Hellstrom thomas at shipmail.org
Mon Jan 11 07:14:08 PST 2016


Reviewed-by: Thomas Hellstrom <thellstrom at 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 at amd.com>
>
> It doesn't make any sense to try to swap out imported BOs.
>
> Signed-off-by: Christian König <christian.koenig at 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);
>  		}





More information about the dri-devel mailing list