diff mbox

[2/6] drm/ttm: when create a new ttm bo init on_alloc_stage and resv for ttm_operation_ctx

Message ID 1513071228-29551-2-git-send-email-Hongbo.He@amd.com (mailing list archive)
State New, archived
Headers show

Commit Message

He, Hongbo Dec. 12, 2017, 9:33 a.m. UTC
Change-Id: I0c6571c2a64e6c5bdad80ccbcccb40eba1c20b4e
Signed-off-by: Roger He <Hongbo.He@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
 drivers/gpu/drm/ttm/ttm_bo.c               | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

Comments

Christian König Dec. 12, 2017, 10:30 a.m. UTC | #1
Am 12.12.2017 um 10:33 schrieb Roger He:
> Change-Id: I0c6571c2a64e6c5bdad80ccbcccb40eba1c20b4e
> Signed-off-by: Roger He <Hongbo.He@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
>   drivers/gpu/drm/ttm/ttm_bo.c               | 1 +
>   2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index dc0a8be..eb42782 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -327,7 +327,7 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev,
>   			       uint64_t init_value,
>   			       struct amdgpu_bo **bo_ptr)
>   {
> -	struct ttm_operation_ctx ctx = { !kernel, false };
> +	struct ttm_operation_ctx ctx = { !kernel, false, true };
>   	struct amdgpu_bo *bo;
>   	enum ttm_bo_type type;
>   	unsigned long page_align;
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index 97c3da6..70b2673 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -1208,6 +1208,7 @@ int ttm_bo_init_reserved(struct ttm_bo_device *bdev,
>   		WARN_ON(!locked);
>   	}
>   
> +	ctx->resv = resv;

That is something amdgpu specific, don't put that into TTM code.

Christian.

>   	if (likely(!ret))
>   		ret = ttm_bo_validate(bo, placement, ctx);
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index dc0a8be..eb42782 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -327,7 +327,7 @@  static int amdgpu_bo_do_create(struct amdgpu_device *adev,
 			       uint64_t init_value,
 			       struct amdgpu_bo **bo_ptr)
 {
-	struct ttm_operation_ctx ctx = { !kernel, false };
+	struct ttm_operation_ctx ctx = { !kernel, false, true };
 	struct amdgpu_bo *bo;
 	enum ttm_bo_type type;
 	unsigned long page_align;
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 97c3da6..70b2673 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -1208,6 +1208,7 @@  int ttm_bo_init_reserved(struct ttm_bo_device *bdev,
 		WARN_ON(!locked);
 	}
 
+	ctx->resv = resv;
 	if (likely(!ret))
 		ret = ttm_bo_validate(bo, placement, ctx);