diff options
author | Christian König <christian.koenig@amd.com> | 2016-02-10 08:35:19 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-02-12 15:40:02 -0500 |
commit | ead833ecedfad7267966c6b81944c706a85b0736 (patch) | |
tree | 2dcde759fa90b58f8bc6a9c2533318dd78484ee1 /drivers | |
parent | 703297c1fe5ce9e54428d36166e85194d54ce147 (diff) |
drm/amdgpu: use separate scheduler entity for UVD submissions
This allows us to remove the kernel context and use a better
priority for the submissions.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 15 |
2 files changed, 15 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index bc396a8f2d55..cecb5f4328c9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
@@ -1644,6 +1644,7 @@ struct amdgpu_uvd { | |||
1644 | struct amdgpu_ring ring; | 1644 | struct amdgpu_ring ring; |
1645 | struct amdgpu_irq_src irq; | 1645 | struct amdgpu_irq_src irq; |
1646 | bool address_64_bit; | 1646 | bool address_64_bit; |
1647 | struct amd_sched_entity entity; | ||
1647 | }; | 1648 | }; |
1648 | 1649 | ||
1649 | /* | 1650 | /* |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c index f4283432bf4e..1de82bf4fc79 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | |||
@@ -91,6 +91,8 @@ static void amdgpu_uvd_idle_work_handler(struct work_struct *work); | |||
91 | 91 | ||
92 | int amdgpu_uvd_sw_init(struct amdgpu_device *adev) | 92 | int amdgpu_uvd_sw_init(struct amdgpu_device *adev) |
93 | { | 93 | { |
94 | struct amdgpu_ring *ring; | ||
95 | struct amd_sched_rq *rq; | ||
94 | unsigned long bo_size; | 96 | unsigned long bo_size; |
95 | const char *fw_name; | 97 | const char *fw_name; |
96 | const struct common_firmware_header *hdr; | 98 | const struct common_firmware_header *hdr; |
@@ -191,6 +193,15 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev) | |||
191 | 193 | ||
192 | amdgpu_bo_unreserve(adev->uvd.vcpu_bo); | 194 | amdgpu_bo_unreserve(adev->uvd.vcpu_bo); |
193 | 195 | ||
196 | ring = &adev->uvd.ring; | ||
197 | rq = &ring->sched.sched_rq[AMD_SCHED_PRIORITY_NORMAL]; | ||
198 | r = amd_sched_entity_init(&ring->sched, &adev->uvd.entity, | ||
199 | rq, amdgpu_sched_jobs); | ||
200 | if (r != 0) { | ||
201 | DRM_ERROR("Failed setting up UVD run queue.\n"); | ||
202 | return r; | ||
203 | } | ||
204 | |||
194 | for (i = 0; i < AMDGPU_MAX_UVD_HANDLES; ++i) { | 205 | for (i = 0; i < AMDGPU_MAX_UVD_HANDLES; ++i) { |
195 | atomic_set(&adev->uvd.handles[i], 0); | 206 | atomic_set(&adev->uvd.handles[i], 0); |
196 | adev->uvd.filp[i] = NULL; | 207 | adev->uvd.filp[i] = NULL; |
@@ -210,6 +221,8 @@ int amdgpu_uvd_sw_fini(struct amdgpu_device *adev) | |||
210 | if (adev->uvd.vcpu_bo == NULL) | 221 | if (adev->uvd.vcpu_bo == NULL) |
211 | return 0; | 222 | return 0; |
212 | 223 | ||
224 | amd_sched_entity_fini(&adev->uvd.ring.sched, &adev->uvd.entity); | ||
225 | |||
213 | r = amdgpu_bo_reserve(adev->uvd.vcpu_bo, false); | 226 | r = amdgpu_bo_reserve(adev->uvd.vcpu_bo, false); |
214 | if (!r) { | 227 | if (!r) { |
215 | amdgpu_bo_kunmap(adev->uvd.vcpu_bo); | 228 | amdgpu_bo_kunmap(adev->uvd.vcpu_bo); |
@@ -880,7 +893,7 @@ static int amdgpu_uvd_send_msg(struct amdgpu_ring *ring, struct amdgpu_bo *bo, | |||
880 | 893 | ||
881 | amdgpu_job_free(job); | 894 | amdgpu_job_free(job); |
882 | } else { | 895 | } else { |
883 | r = amdgpu_job_submit(job, ring, NULL, | 896 | r = amdgpu_job_submit(job, ring, &adev->uvd.entity, |
884 | AMDGPU_FENCE_OWNER_UNDEFINED, &f); | 897 | AMDGPU_FENCE_OWNER_UNDEFINED, &f); |
885 | if (r) | 898 | if (r) |
886 | goto err_free; | 899 | goto err_free; |