From: "Christian König" <christian.koenig@amd.com>
To: xinhui pan <xinhui.pan@amd.com>,
amd-gfx@lists.freedesktop.org, "Liu, Leo" <Leo.Liu@amd.com>
Cc: alexander.deucher@amd.com
Subject: Re: [PATCH 3/4] drm/amdgpu: VCE avoid memory allocation during IB test
Date: Fri, 10 Sep 2021 08:29:21 +0200 [thread overview]
Message-ID: <3269aee8-ee86-484b-9a6c-83312e33f58f@amd.com> (raw)
In-Reply-To: <20210910003828.4013-3-xinhui.pan@amd.com>
Am 10.09.21 um 02:38 schrieb xinhui pan:
> alloc extra msg from direct IB pool.
>
> Signed-off-by: xinhui pan <xinhui.pan@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 18 +++---------------
> 1 file changed, 3 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
> index e9fdf49d69e8..45d98694db18 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
> @@ -82,7 +82,6 @@ MODULE_FIRMWARE(FIRMWARE_VEGA20);
>
> static void amdgpu_vce_idle_work_handler(struct work_struct *work);
> static int amdgpu_vce_get_create_msg(struct amdgpu_ring *ring, uint32_t handle,
> - struct amdgpu_bo *bo,
> struct dma_fence **fence);
> static int amdgpu_vce_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle,
> bool direct, struct dma_fence **fence);
> @@ -441,7 +440,6 @@ void amdgpu_vce_free_handles(struct amdgpu_device *adev, struct drm_file *filp)
> * Open up a stream for HW test
> */
> static int amdgpu_vce_get_create_msg(struct amdgpu_ring *ring, uint32_t handle,
> - struct amdgpu_bo *bo,
> struct dma_fence **fence)
> {
> const unsigned ib_size_dw = 1024;
> @@ -451,14 +449,13 @@ static int amdgpu_vce_get_create_msg(struct amdgpu_ring *ring, uint32_t handle,
> uint64_t addr;
> int i, r;
>
> - r = amdgpu_job_alloc_with_ib(ring->adev, ib_size_dw * 4,
> + r = amdgpu_job_alloc_with_ib(ring->adev, ib_size_dw * 4 + PAGE_SIZE,
Please use AMDGPU_PAGE_SIZE since that here is not really related to the
CPU page size.
> AMDGPU_IB_POOL_DIRECT, &job);
> if (r)
> return r;
>
> ib = &job->ibs[0];
> -
> - addr = amdgpu_bo_gpu_offset(bo);
> + addr = ib->gpu_addr + ib_size_dw * 4;
That here needs to be more aligned I think.
For UVD that used to be 256bytes, but no idea what VCE requires. Leo do
you of hand know?
Thanks,
Christian.
>
> /* stitch together an VCE create msg */
> ib->length_dw = 0;
> @@ -1134,20 +1131,13 @@ int amdgpu_vce_ring_test_ring(struct amdgpu_ring *ring)
> int amdgpu_vce_ring_test_ib(struct amdgpu_ring *ring, long timeout)
> {
> struct dma_fence *fence = NULL;
> - struct amdgpu_bo *bo = NULL;
> long r;
>
> /* skip vce ring1/2 ib test for now, since it's not reliable */
> if (ring != &ring->adev->vce.ring[0])
> return 0;
>
> - r = amdgpu_bo_create_reserved(ring->adev, 512, PAGE_SIZE,
> - AMDGPU_GEM_DOMAIN_VRAM,
> - &bo, NULL, NULL);
> - if (r)
> - return r;
> -
> - r = amdgpu_vce_get_create_msg(ring, 1, bo, NULL);
> + r = amdgpu_vce_get_create_msg(ring, 1, NULL);
> if (r)
> goto error;
>
> @@ -1163,8 +1153,6 @@ int amdgpu_vce_ring_test_ib(struct amdgpu_ring *ring, long timeout)
>
> error:
> dma_fence_put(fence);
> - amdgpu_bo_unreserve(bo);
> - amdgpu_bo_free_kernel(&bo, NULL, NULL);
> return r;
> }
>
next prev parent reply other threads:[~2021-09-10 6:29 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-10 0:38 [PATCH 1/4] drm/amdgpu: Increase direct IB pool size xinhui pan
2021-09-10 0:38 ` [PATCH 2/4] drm/amdgpu: UVD avoid memory allocation during IB test xinhui pan
2021-09-10 6:24 ` Christian König
2021-09-10 8:18 ` 回复: " Pan, Xinhui
2021-09-10 8:53 ` Christian König
2021-09-10 9:42 ` 回复: " Pan, Xinhui
2021-09-10 10:02 ` Christian König
2021-09-10 10:10 ` 回复: " Pan, Xinhui
2021-09-10 11:10 ` Christian König
2021-09-10 11:48 ` 回复: " Pan, Xinhui
2021-09-10 12:23 ` Christian König
2021-09-10 0:38 ` [PATCH 3/4] drm/amdgpu: VCE " xinhui pan
2021-09-10 6:29 ` Christian König [this message]
2021-09-10 0:38 ` [PATCH 4/4] drm/amdgpu: VCN " xinhui pan
2021-09-10 6:33 ` Christian König
2021-09-10 7:53 ` 回复: " Pan, Xinhui
2021-09-10 7:55 ` Christian König
2021-09-10 6:15 ` [PATCH 1/4] drm/amdgpu: Increase direct IB pool size Christian König
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3269aee8-ee86-484b-9a6c-83312e33f58f@amd.com \
--to=christian.koenig@amd.com \
--cc=Leo.Liu@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=xinhui.pan@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox