diff mbox series

drm/ttm: fix shared slot reservation during BO creation

Message ID 20181205083817.16132-1-christian.koenig@amd.com (mailing list archive)
State New, archived
Headers show
Series drm/ttm: fix shared slot reservation during BO creation | expand

Commit Message

Christian König Dec. 5, 2018, 8:38 a.m. UTC
Make sure we reserve at least one slot for pipelined BO moves
during BO creation.

Fixes: 5786b66c9e3b drm/ttm: drop the extra reservation for pipelined BO
moves

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

Comments

StDenis, Tom Dec. 5, 2018, 11:06 a.m. UTC | #1
Fixes the regression I noticed.

Tested-by: Tom St Denis <tom.stdenis@amd.com>


On 2018-12-05 3:38 a.m., Christian König wrote:
> Make sure we reserve at least one slot for pipelined BO moves
> during BO creation.
> 
> Fixes: 5786b66c9e3b drm/ttm: drop the extra reservation for pipelined BO
> moves
> 
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>   drivers/gpu/drm/ttm/ttm_bo.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index 7db66e4088e2..ffd68b039d23 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -1264,6 +1264,9 @@ int ttm_bo_init_reserved(struct ttm_bo_device *bdev,
>   		WARN_ON(!locked);
>   	}
>   
> +	if (likely(!ret))
> +		ret = reservation_object_reserve_shared(bo->resv, 1);
> +
>   	if (likely(!ret))
>   		ret = ttm_bo_validate(bo, placement, ctx);
>   
>
Michel Dänzer Dec. 5, 2018, 2:58 p.m. UTC | #2
On 2018-12-05 9:38 a.m., Christian König wrote:
> Make sure we reserve at least one slot for pipelined BO moves
> during BO creation.
> 
> Fixes: 5786b66c9e3b drm/ttm: drop the extra reservation for pipelined BO
> moves
> 
> Signed-off-by: Christian König <christian.koenig@amd.com>

Unfortunately, I still hit a hang with piglit with current
amd-staging-drm-next, which has this fix. See the attached dmesg excerpt.
Christian König Dec. 5, 2018, 3:04 p.m. UTC | #3
Mhm, looks like DC calling TTM here without going through the pin function?

Anyway, I'm going to revert the patch for now. Looks like I really need 
to test this with eviction turned on.

Christian.

Am 05.12.18 um 15:58 schrieb Michel Dänzer:
> On 2018-12-05 9:38 a.m., Christian König wrote:
>> Make sure we reserve at least one slot for pipelined BO moves
>> during BO creation.
>>
>> Fixes: 5786b66c9e3b drm/ttm: drop the extra reservation for pipelined BO
>> moves
>>
>> Signed-off-by: Christian König <christian.koenig@amd.com>
> Unfortunately, I still hit a hang with piglit with current
> amd-staging-drm-next, which has this fix. See the attached dmesg excerpt.
>
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 7db66e4088e2..ffd68b039d23 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -1264,6 +1264,9 @@  int ttm_bo_init_reserved(struct ttm_bo_device *bdev,
 		WARN_ON(!locked);
 	}
 
+	if (likely(!ret))
+		ret = reservation_object_reserve_shared(bo->resv, 1);
+
 	if (likely(!ret))
 		ret = ttm_bo_validate(bo, placement, ctx);