Commit c594989c authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/amdgpu: use separate scheduler entity for VCE submissions

This allows us to remove the kernel context and use a better
priority for the submissions.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent ead833ec
...@@ -1669,6 +1669,7 @@ struct amdgpu_vce { ...@@ -1669,6 +1669,7 @@ struct amdgpu_vce {
struct amdgpu_ring ring[AMDGPU_MAX_VCE_RINGS]; struct amdgpu_ring ring[AMDGPU_MAX_VCE_RINGS];
struct amdgpu_irq_src irq; struct amdgpu_irq_src irq;
unsigned harvest_config; unsigned harvest_config;
struct amd_sched_entity entity;
}; };
/* /*
......
...@@ -74,6 +74,8 @@ static void amdgpu_vce_idle_work_handler(struct work_struct *work); ...@@ -74,6 +74,8 @@ static void amdgpu_vce_idle_work_handler(struct work_struct *work);
*/ */
int amdgpu_vce_sw_init(struct amdgpu_device *adev, unsigned long size) int amdgpu_vce_sw_init(struct amdgpu_device *adev, unsigned long size)
{ {
struct amdgpu_ring *ring;
struct amd_sched_rq *rq;
const char *fw_name; const char *fw_name;
const struct common_firmware_header *hdr; const struct common_firmware_header *hdr;
unsigned ucode_version, version_major, version_minor, binary_id; unsigned ucode_version, version_major, version_minor, binary_id;
...@@ -170,6 +172,16 @@ int amdgpu_vce_sw_init(struct amdgpu_device *adev, unsigned long size) ...@@ -170,6 +172,16 @@ int amdgpu_vce_sw_init(struct amdgpu_device *adev, unsigned long size)
return r; return r;
} }
ring = &adev->vce.ring[0];
rq = &ring->sched.sched_rq[AMD_SCHED_PRIORITY_NORMAL];
r = amd_sched_entity_init(&ring->sched, &adev->vce.entity,
rq, amdgpu_sched_jobs);
if (r != 0) {
DRM_ERROR("Failed setting up VCE run queue.\n");
return r;
}
for (i = 0; i < AMDGPU_MAX_VCE_HANDLES; ++i) { for (i = 0; i < AMDGPU_MAX_VCE_HANDLES; ++i) {
atomic_set(&adev->vce.handles[i], 0); atomic_set(&adev->vce.handles[i], 0);
adev->vce.filp[i] = NULL; adev->vce.filp[i] = NULL;
...@@ -190,6 +202,8 @@ int amdgpu_vce_sw_fini(struct amdgpu_device *adev) ...@@ -190,6 +202,8 @@ int amdgpu_vce_sw_fini(struct amdgpu_device *adev)
if (adev->vce.vcpu_bo == NULL) if (adev->vce.vcpu_bo == NULL)
return 0; return 0;
amd_sched_entity_fini(&adev->vce.ring[0].sched, &adev->vce.entity);
amdgpu_bo_unref(&adev->vce.vcpu_bo); amdgpu_bo_unref(&adev->vce.vcpu_bo);
amdgpu_ring_fini(&adev->vce.ring[0]); amdgpu_ring_fini(&adev->vce.ring[0]);
...@@ -481,7 +495,7 @@ int amdgpu_vce_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle, ...@@ -481,7 +495,7 @@ int amdgpu_vce_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle,
amdgpu_job_free(job); amdgpu_job_free(job);
} else { } else {
r = amdgpu_job_submit(job, ring, NULL, r = amdgpu_job_submit(job, ring, &ring->adev->vce.entity,
AMDGPU_FENCE_OWNER_UNDEFINED, &f); AMDGPU_FENCE_OWNER_UNDEFINED, &f);
if (r) if (r)
goto err; goto err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment