[PATCH 2/2] drm/ttm: add ttm page_flags TTM_PAGE_FLAG_PAGEFAULT

Christian König ckoenig.leichtzumerken at gmail.com
Mon Jan 29 13:47:11 UTC 2018


> @@ -1107,9 +1108,11 @@ int ttm_pool_populate(struct ttm_tt *ttm, struct ttm_operation_ctx *ctx)
>   		return ret;
>   	}
>   
> +	in_pagefault = ttm->page_flags | TTM_PAGE_FLAG_PAGEFAULT;

That should probably be "ttm->page_flags & TTM_PAGE_FLAG_PAGEFAULT;".

>   	for (i = 0; i < ttm->num_pages; ++i) {
>   		ret = ttm_mem_global_alloc_page(mem_glob, ttm->pages[i],
> -						PAGE_SIZE, ctx);
> +						PAGE_SIZE, ctx,
> +						in_pagefault);
>   		if (unlikely(ret != 0)) {
>   			ttm_pool_unpopulate_helper(ttm, i);
>   			return -ENOMEM;
> diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
> index 9e90d0e..77dd167 100644
> --- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
> +++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
> @@ -939,6 +939,7 @@ int ttm_dma_populate(struct ttm_dma_tt *ttm_dma, struct device *dev,
>   	struct dma_pool *pool;
>   	struct dma_page *d_page;
>   	enum pool_type type;
> +	bool in_pagefault;
>   	unsigned i;
>   	int ret;
>   
> @@ -948,8 +949,8 @@ int ttm_dma_populate(struct ttm_dma_tt *ttm_dma, struct device *dev,
>   	INIT_LIST_HEAD(&ttm_dma->pages_list);
>   	i = 0;
>   
> +	in_pagefault = ttm_dma->ttm.page_flags | TTM_PAGE_FLAG_PAGEFAULT;

Dito.

Christian.



More information about the dri-devel mailing list