Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20b6b788 authored by Andrey Grodzovsky's avatar Andrey Grodzovsky Committed by Alex Deucher
Browse files

drm/amdgpu: Skip drm_sched_entity related ops for KIQ ring.



Following change 75fbed20 we never initialize or use the GPU
scheduler for KIQ and hence we need to skip KIQ ring when iterating
amdgpu_ctx's scheduler entites.

Signed-off-by: default avatarAndrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 950f23eb
Loading
Loading
Loading
Loading
+18 −3
Original line number Diff line number Diff line
@@ -173,9 +173,14 @@ static void amdgpu_ctx_do_release(struct kref *ref)

	ctx = container_of(ref, struct amdgpu_ctx, refcount);

	for (i = 0; i < ctx->adev->num_rings; i++)
	for (i = 0; i < ctx->adev->num_rings; i++) {

		if (ctx->adev->rings[i] == &ctx->adev->gfx.kiq.ring)
			continue;

		drm_sched_entity_fini(&ctx->adev->rings[i]->sched,
			&ctx->rings[i].entity);
	}

	amdgpu_ctx_fini(ref);
}
@@ -452,7 +457,11 @@ void amdgpu_ctx_mgr_entity_fini(struct amdgpu_ctx_mgr *mgr)
		if (!ctx->adev)
			return;

		for (i = 0; i < ctx->adev->num_rings; i++)
		for (i = 0; i < ctx->adev->num_rings; i++) {

			if (ctx->adev->rings[i] == &ctx->adev->gfx.kiq.ring)
				continue;

			if (kref_read(&ctx->refcount) == 1)
				drm_sched_entity_do_release(&ctx->adev->rings[i]->sched,
						  &ctx->rings[i].entity);
@@ -460,6 +469,7 @@ void amdgpu_ctx_mgr_entity_fini(struct amdgpu_ctx_mgr *mgr)
				DRM_ERROR("ctx %p is still alive\n", ctx);
		}
	}
}

void amdgpu_ctx_mgr_entity_cleanup(struct amdgpu_ctx_mgr *mgr)
{
@@ -474,7 +484,11 @@ void amdgpu_ctx_mgr_entity_cleanup(struct amdgpu_ctx_mgr *mgr)
		if (!ctx->adev)
			return;

		for (i = 0; i < ctx->adev->num_rings; i++)
		for (i = 0; i < ctx->adev->num_rings; i++) {

			if (ctx->adev->rings[i] == &ctx->adev->gfx.kiq.ring)
				continue;

			if (kref_read(&ctx->refcount) == 1)
				drm_sched_entity_cleanup(&ctx->adev->rings[i]->sched,
					&ctx->rings[i].entity);
@@ -482,6 +496,7 @@ void amdgpu_ctx_mgr_entity_cleanup(struct amdgpu_ctx_mgr *mgr)
				DRM_ERROR("ctx %p is still alive\n", ctx);
		}
	}
}

void amdgpu_ctx_mgr_fini(struct amdgpu_ctx_mgr *mgr)
{