[PATCH] drm/amdgpu: fix emit frame counts for compute mem sync

Christian König ckoenig.leichtzumerken at gmail.com
Fri May 1 18:09:58 UTC 2020


Am 01.05.20 um 18:37 schrieb Alex Deucher:
> The frame emit counts were not updated.
>
> Fixes: 0dd3baafb62c38 ("drm/amdgpu: apply AMDGPU_IB_FLAG_EMIT_MEM_SYNC to compute IBs too")
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>

Reviewed-by: Christian König <christian.koenig at amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 3 ++-
>   drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c  | 3 ++-
>   drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c  | 3 ++-
>   drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c  | 3 ++-
>   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c  | 3 ++-
>   5 files changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> index 7ff7e516b72f..ddb485e1e963 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> @@ -8125,7 +8125,8 @@ static const struct amdgpu_ring_funcs gfx_v10_0_ring_funcs_compute = {
>   		SOC15_FLUSH_GPU_TLB_NUM_WREG * 5 +
>   		SOC15_FLUSH_GPU_TLB_NUM_REG_WAIT * 7 +
>   		2 + /* gfx_v10_0_ring_emit_vm_flush */
> -		8 + 8 + 8, /* gfx_v10_0_ring_emit_fence x3 for user fence, vm fence */
> +		8 + 8 + 8 + /* gfx_v10_0_ring_emit_fence x3 for user fence, vm fence */
> +		8, /* gfx_v10_0_emit_mem_sync */
>   	.emit_ib_size =	7, /* gfx_v10_0_ring_emit_ib_compute */
>   	.emit_ib = gfx_v10_0_ring_emit_ib_compute,
>   	.emit_fence = gfx_v10_0_ring_emit_fence,
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
> index 05e94379c7b3..79c52c7a02e3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
> @@ -3533,7 +3533,8 @@ static const struct amdgpu_ring_funcs gfx_v6_0_ring_funcs_compute = {
>   		5 + 5 + /* hdp flush / invalidate */
>   		7 + /* gfx_v6_0_ring_emit_pipeline_sync */
>   		SI_FLUSH_GPU_TLB_NUM_WREG * 5 + 7 + /* gfx_v6_0_ring_emit_vm_flush */
> -		14 + 14 + 14, /* gfx_v6_0_ring_emit_fence x3 for user fence, vm fence */
> +		14 + 14 + 14 + /* gfx_v6_0_ring_emit_fence x3 for user fence, vm fence */
> +		5, /* SURFACE_SYNC */
>   	.emit_ib_size = 6, /* gfx_v6_0_ring_emit_ib */
>   	.emit_ib = gfx_v6_0_ring_emit_ib,
>   	.emit_fence = gfx_v6_0_ring_emit_fence,
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
> index 5d9226b871fa..0cc011f9190d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
> @@ -5089,7 +5089,8 @@ static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_compute = {
>   		5 + /* hdp invalidate */
>   		7 + /* gfx_v7_0_ring_emit_pipeline_sync */
>   		CIK_FLUSH_GPU_TLB_NUM_WREG * 5 + 7 + /* gfx_v7_0_ring_emit_vm_flush */
> -		7 + 7 + 7, /* gfx_v7_0_ring_emit_fence_compute x3 for user fence, vm fence */
> +		7 + 7 + 7 + /* gfx_v7_0_ring_emit_fence_compute x3 for user fence, vm fence */
> +		7, /* gfx_v7_0_emit_mem_sync_compute */
>   	.emit_ib_size =	7, /* gfx_v7_0_ring_emit_ib_compute */
>   	.emit_ib = gfx_v7_0_ring_emit_ib_compute,
>   	.emit_fence = gfx_v7_0_ring_emit_fence_compute,
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> index 14790f80a8a9..1d4128227ffd 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> @@ -6927,7 +6927,8 @@ static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_compute = {
>   		5 + /* hdp_invalidate */
>   		7 + /* gfx_v8_0_ring_emit_pipeline_sync */
>   		VI_FLUSH_GPU_TLB_NUM_WREG * 5 + 7 + /* gfx_v8_0_ring_emit_vm_flush */
> -		7 + 7 + 7, /* gfx_v8_0_ring_emit_fence_compute x3 for user fence, vm fence */
> +		7 + 7 + 7 + /* gfx_v8_0_ring_emit_fence_compute x3 for user fence, vm fence */
> +		7, /* gfx_v8_0_emit_mem_sync_compute */
>   	.emit_ib_size =	7, /* gfx_v8_0_ring_emit_ib_compute */
>   	.emit_ib = gfx_v8_0_ring_emit_ib_compute,
>   	.emit_fence = gfx_v8_0_ring_emit_fence_compute,
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> index a4e95e03d97c..b98d91936b4c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> @@ -6745,7 +6745,8 @@ static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_compute = {
>   		SOC15_FLUSH_GPU_TLB_NUM_WREG * 5 +
>   		SOC15_FLUSH_GPU_TLB_NUM_REG_WAIT * 7 +
>   		2 + /* gfx_v9_0_ring_emit_vm_flush */
> -		8 + 8 + 8, /* gfx_v9_0_ring_emit_fence x3 for user fence, vm fence */
> +		8 + 8 + 8 + /* gfx_v9_0_ring_emit_fence x3 for user fence, vm fence */
> +		7, /* gfx_v9_0_emit_mem_sync */
>   	.emit_ib_size =	7, /* gfx_v9_0_ring_emit_ib_compute */
>   	.emit_ib = gfx_v9_0_ring_emit_ib_compute,
>   	.emit_fence = gfx_v9_0_ring_emit_fence,



More information about the amd-gfx mailing list