mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-04-14 21:57:32 +07:00
drm/amdgpu: send UVD IB tests directly to the ring again
We need the IB test for GPU resets as well and the scheduler should be stoped then. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
0856cab1a6
commit
d7af97dbcc
@ -241,7 +241,7 @@ int amdgpu_uvd_suspend(struct amdgpu_device *adev)
|
|||||||
|
|
||||||
amdgpu_uvd_note_usage(adev);
|
amdgpu_uvd_note_usage(adev);
|
||||||
|
|
||||||
r = amdgpu_uvd_get_destroy_msg(ring, handle, &fence);
|
r = amdgpu_uvd_get_destroy_msg(ring, handle, false, &fence);
|
||||||
if (r) {
|
if (r) {
|
||||||
DRM_ERROR("Error destroying UVD (%d)!\n", r);
|
DRM_ERROR("Error destroying UVD (%d)!\n", r);
|
||||||
continue;
|
continue;
|
||||||
@ -295,7 +295,8 @@ void amdgpu_uvd_free_handles(struct amdgpu_device *adev, struct drm_file *filp)
|
|||||||
|
|
||||||
amdgpu_uvd_note_usage(adev);
|
amdgpu_uvd_note_usage(adev);
|
||||||
|
|
||||||
r = amdgpu_uvd_get_destroy_msg(ring, handle, &fence);
|
r = amdgpu_uvd_get_destroy_msg(ring, handle,
|
||||||
|
false, &fence);
|
||||||
if (r) {
|
if (r) {
|
||||||
DRM_ERROR("Error destroying UVD (%d)!\n", r);
|
DRM_ERROR("Error destroying UVD (%d)!\n", r);
|
||||||
continue;
|
continue;
|
||||||
@ -823,9 +824,8 @@ int amdgpu_uvd_ring_parse_cs(struct amdgpu_cs_parser *parser, uint32_t ib_idx)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int amdgpu_uvd_send_msg(struct amdgpu_ring *ring,
|
static int amdgpu_uvd_send_msg(struct amdgpu_ring *ring, struct amdgpu_bo *bo,
|
||||||
struct amdgpu_bo *bo,
|
bool direct, struct fence **fence)
|
||||||
struct fence **fence)
|
|
||||||
{
|
{
|
||||||
struct ttm_validate_buffer tv;
|
struct ttm_validate_buffer tv;
|
||||||
struct ww_acquire_ctx ticket;
|
struct ww_acquire_ctx ticket;
|
||||||
@ -872,9 +872,19 @@ static int amdgpu_uvd_send_msg(struct amdgpu_ring *ring,
|
|||||||
ib->ptr[i] = PACKET2(0);
|
ib->ptr[i] = PACKET2(0);
|
||||||
ib->length_dw = 16;
|
ib->length_dw = 16;
|
||||||
|
|
||||||
r = amdgpu_job_submit(job, ring, AMDGPU_FENCE_OWNER_UNDEFINED, &f);
|
if (direct) {
|
||||||
if (r)
|
r = amdgpu_ib_schedule(ring, 1, ib,
|
||||||
goto err_free;
|
AMDGPU_FENCE_OWNER_UNDEFINED, &f);
|
||||||
|
if (r)
|
||||||
|
goto err_free;
|
||||||
|
|
||||||
|
amdgpu_job_free(job);
|
||||||
|
} else {
|
||||||
|
r = amdgpu_job_submit(job, ring,
|
||||||
|
AMDGPU_FENCE_OWNER_UNDEFINED, &f);
|
||||||
|
if (r)
|
||||||
|
goto err_free;
|
||||||
|
}
|
||||||
|
|
||||||
ttm_eu_fence_buffer_objects(&ticket, &head, f);
|
ttm_eu_fence_buffer_objects(&ticket, &head, f);
|
||||||
|
|
||||||
@ -942,11 +952,11 @@ int amdgpu_uvd_get_create_msg(struct amdgpu_ring *ring, uint32_t handle,
|
|||||||
amdgpu_bo_kunmap(bo);
|
amdgpu_bo_kunmap(bo);
|
||||||
amdgpu_bo_unreserve(bo);
|
amdgpu_bo_unreserve(bo);
|
||||||
|
|
||||||
return amdgpu_uvd_send_msg(ring, bo, fence);
|
return amdgpu_uvd_send_msg(ring, bo, true, fence);
|
||||||
}
|
}
|
||||||
|
|
||||||
int amdgpu_uvd_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle,
|
int amdgpu_uvd_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle,
|
||||||
struct fence **fence)
|
bool direct, struct fence **fence)
|
||||||
{
|
{
|
||||||
struct amdgpu_device *adev = ring->adev;
|
struct amdgpu_device *adev = ring->adev;
|
||||||
struct amdgpu_bo *bo;
|
struct amdgpu_bo *bo;
|
||||||
@ -984,7 +994,7 @@ int amdgpu_uvd_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle,
|
|||||||
amdgpu_bo_kunmap(bo);
|
amdgpu_bo_kunmap(bo);
|
||||||
amdgpu_bo_unreserve(bo);
|
amdgpu_bo_unreserve(bo);
|
||||||
|
|
||||||
return amdgpu_uvd_send_msg(ring, bo, fence);
|
return amdgpu_uvd_send_msg(ring, bo, direct, fence);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void amdgpu_uvd_idle_work_handler(struct work_struct *work)
|
static void amdgpu_uvd_idle_work_handler(struct work_struct *work)
|
||||||
|
@ -31,7 +31,7 @@ int amdgpu_uvd_resume(struct amdgpu_device *adev);
|
|||||||
int amdgpu_uvd_get_create_msg(struct amdgpu_ring *ring, uint32_t handle,
|
int amdgpu_uvd_get_create_msg(struct amdgpu_ring *ring, uint32_t handle,
|
||||||
struct fence **fence);
|
struct fence **fence);
|
||||||
int amdgpu_uvd_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle,
|
int amdgpu_uvd_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle,
|
||||||
struct fence **fence);
|
bool direct, struct fence **fence);
|
||||||
void amdgpu_uvd_free_handles(struct amdgpu_device *adev,
|
void amdgpu_uvd_free_handles(struct amdgpu_device *adev,
|
||||||
struct drm_file *filp);
|
struct drm_file *filp);
|
||||||
int amdgpu_uvd_ring_parse_cs(struct amdgpu_cs_parser *parser, uint32_t ib_idx);
|
int amdgpu_uvd_ring_parse_cs(struct amdgpu_cs_parser *parser, uint32_t ib_idx);
|
||||||
|
@ -522,7 +522,7 @@ static int uvd_v4_2_ring_test_ib(struct amdgpu_ring *ring)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
r = amdgpu_uvd_get_destroy_msg(ring, 1, &fence);
|
r = amdgpu_uvd_get_destroy_msg(ring, 1, true, &fence);
|
||||||
if (r) {
|
if (r) {
|
||||||
DRM_ERROR("amdgpu: failed to get destroy ib (%d).\n", r);
|
DRM_ERROR("amdgpu: failed to get destroy ib (%d).\n", r);
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -568,7 +568,7 @@ static int uvd_v5_0_ring_test_ib(struct amdgpu_ring *ring)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
r = amdgpu_uvd_get_destroy_msg(ring, 1, &fence);
|
r = amdgpu_uvd_get_destroy_msg(ring, 1, true, &fence);
|
||||||
if (r) {
|
if (r) {
|
||||||
DRM_ERROR("amdgpu: failed to get destroy ib (%d).\n", r);
|
DRM_ERROR("amdgpu: failed to get destroy ib (%d).\n", r);
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -800,7 +800,7 @@ static int uvd_v6_0_ring_test_ib(struct amdgpu_ring *ring)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
r = amdgpu_uvd_get_destroy_msg(ring, 1, &fence);
|
r = amdgpu_uvd_get_destroy_msg(ring, 1, true, &fence);
|
||||||
if (r) {
|
if (r) {
|
||||||
DRM_ERROR("amdgpu: failed to get destroy ib (%d).\n", r);
|
DRM_ERROR("amdgpu: failed to get destroy ib (%d).\n", r);
|
||||||
goto error;
|
goto error;
|
||||||
|
Loading…
Reference in New Issue
Block a user