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

Commit 2bd9ccfa authored by Christian König's avatar Christian König Committed by Alex Deucher
Browse files

drm/amdgpu: use per VM entity for page table updates (v2)



Updates from different VMs can be processed independently.

v2: agd: rebase on upstream

Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c41d271d
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -800,7 +800,8 @@ int amdgpu_job_alloc_with_ib(struct amdgpu_device *adev, unsigned size,
			     struct amdgpu_job **job);
void amdgpu_job_free(struct amdgpu_job *job);
int amdgpu_job_submit(struct amdgpu_job *job, struct amdgpu_ring *ring,
		      void *owner, struct fence **f);
		      struct amd_sched_entity *entity, void *owner,
		      struct fence **f);

struct amdgpu_ring {
	struct amdgpu_device		*adev;
@@ -917,6 +918,9 @@ struct amdgpu_vm {

	/* protecting freed */
	spinlock_t		freed_lock;

	/* Scheduler entity for page table updates */
	struct amd_sched_entity	entity;
};

struct amdgpu_vm_manager_id {
+6 −2
Original line number Diff line number Diff line
@@ -80,13 +80,17 @@ void amdgpu_job_free(struct amdgpu_job *job)
}

int amdgpu_job_submit(struct amdgpu_job *job, struct amdgpu_ring *ring,
		      void *owner, struct fence **f)
		      struct amd_sched_entity *entity, void *owner,
		      struct fence **f)
{
	struct amdgpu_device *adev = job->adev;

	if (!entity)
		entity = &adev->kernel_ctx.rings[ring->idx].entity;

	job->ring = ring;
	job->base.sched = &ring->sched;
	job->base.s_entity = &adev->kernel_ctx.rings[ring->idx].entity;
	job->base.s_entity = entity;
	job->base.s_fence = amd_sched_fence_create(job->base.s_entity, owner);
	if (!job->base.s_fence)
		return -ENOMEM;
+1 −1
Original line number Diff line number Diff line
@@ -1053,7 +1053,7 @@ int amdgpu_copy_buffer(struct amdgpu_ring *ring,

	amdgpu_ring_pad_ib(ring, &job->ibs[0]);
	WARN_ON(job->ibs[0].length_dw > num_dw);
	r = amdgpu_job_submit(job, ring, AMDGPU_FENCE_OWNER_UNDEFINED, fence);
	r = amdgpu_job_submit(job, ring, NULL, AMDGPU_FENCE_OWNER_UNDEFINED, fence);
	if (r)
		goto error_free;

+1 −1
Original line number Diff line number Diff line
@@ -880,7 +880,7 @@ static int amdgpu_uvd_send_msg(struct amdgpu_ring *ring, struct amdgpu_bo *bo,

		amdgpu_job_free(job);
	} else {
		r = amdgpu_job_submit(job, ring,
		r = amdgpu_job_submit(job, ring, NULL,
				      AMDGPU_FENCE_OWNER_UNDEFINED, &f);
		if (r)
			goto err_free;
+1 −1
Original line number Diff line number Diff line
@@ -481,7 +481,7 @@ int amdgpu_vce_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle,

		amdgpu_job_free(job);
	} else {
		r = amdgpu_job_submit(job, ring,
		r = amdgpu_job_submit(job, ring, NULL,
				      AMDGPU_FENCE_OWNER_UNDEFINED, &f);
		if (r)
			goto err;
Loading