Commit c44dfe4d authored by Christian König's avatar Christian König
Browse files

drm/ttm: replace context flags with bools v2



The ttm_operation_ctx structure has a mixture of flags and bools. Drop the
flags and replace them with bools as well.

v2: fix typos, improve comments

Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/398686/
parent 586052b0
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -404,8 +404,7 @@ static int amdgpu_cs_bo_validate(struct amdgpu_cs_parser *p,
	struct ttm_operation_ctx ctx = {
		.interruptible = true,
		.no_wait_gpu = false,
		.resv = bo->tbo.base.resv,
		.flags = 0
		.resv = bo->tbo.base.resv
	};
	uint32_t domain;
	int r;
+2 −3
Original line number Diff line number Diff line
@@ -518,9 +518,8 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev,
		.no_wait_gpu = bp->no_wait_gpu,
		/* We opt to avoid OOM on system pages allocations */
		.gfp_retry_mayfail = true,
		.resv = bp->resv,
		.flags = bp->type != ttm_bo_type_kernel ?
			TTM_OPT_FLAG_ALLOW_RES_EVICT : 0
		.allow_res_evict = bp->type != ttm_bo_type_kernel,
		.resv = bp->resv
	};
	struct amdgpu_bo *bo;
	unsigned long page_align, size = bp->size;
+1 −1
Original line number Diff line number Diff line
@@ -637,7 +637,7 @@ static bool ttm_bo_evict_swapout_allowable(struct ttm_buffer_object *bo,

	if (bo->base.resv == ctx->resv) {
		dma_resv_assert_held(bo->base.resv);
		if (ctx->flags & TTM_OPT_FLAG_ALLOW_RES_EVICT)
		if (ctx->allow_res_evict)
			ret = true;
		*locked = false;
		if (busy)
+1 −2
Original line number Diff line number Diff line
@@ -315,8 +315,7 @@ vm_fault_t ttm_bo_vm_fault_reserved(struct vm_fault *vmf,
		struct ttm_operation_ctx ctx = {
			.interruptible = false,
			.no_wait_gpu = false,
			.flags = TTM_OPT_FLAG_FORCE_ALLOC

			.force_alloc = true
		};

		ttm = bo->ttm;
+2 −1
Original line number Diff line number Diff line
@@ -542,7 +542,8 @@ ttm_check_under_lowerlimit(struct ttm_mem_global *glob,
{
	int64_t available;

	if (ctx->flags & TTM_OPT_FLAG_FORCE_ALLOC)
	/* We allow over commit during suspend */
	if (ctx->force_alloc)
		return false;

	available = get_nr_swap_pages() + si_mem_available();
Loading