[PATCH 2/2] drm/amdgpu/uvd7: fix allocation size in enc ring test
Alex Deucher
alexdeucher at gmail.com
Fri Oct 11 20:50:50 UTC 2019
We need to allocate a large enough buffer for the
session info, otherwise the IB test can overwrite
other memory.
Bug: https://bugzilla.kernel.org/show_bug.cgi?id=204241
Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
---
drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
index 01f658fa72c6..0ce6a1e7ff79 100644
--- a/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
@@ -223,12 +223,12 @@ static int uvd_v7_0_enc_get_create_msg(struct amdgpu_ring *ring, uint32_t handle
uint64_t dummy;
int i, r;
- r = amdgpu_job_alloc_with_ib(ring->adev, ib_size_dw * 4, &job);
+ r = amdgpu_job_alloc_with_ib(ring->adev, (ib_size_dw * 4) + 1024, &job);
if (r)
return r;
ib = &job->ibs[0];
- dummy = ib->gpu_addr + 1024;
+ dummy = ib->gpu_addr + (ib_size_dw * 4);
ib->length_dw = 0;
ib->ptr[ib->length_dw++] = 0x00000018;
@@ -284,12 +284,12 @@ static int uvd_v7_0_enc_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handl
uint64_t dummy;
int i, r;
- r = amdgpu_job_alloc_with_ib(ring->adev, ib_size_dw * 4, &job);
+ r = amdgpu_job_alloc_with_ib(ring->adev, (ib_size_dw * 4) + 1024, &job);
if (r)
return r;
ib = &job->ibs[0];
- dummy = ib->gpu_addr + 1024;
+ dummy = ib->gpu_addr + (ib_size_dw * 4);
ib->length_dw = 0;
ib->ptr[ib->length_dw++] = 0x00000018;
--
2.20.1
More information about the amd-gfx
mailing list