From: "Christian König" <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org>,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH] drm/amdgpu: Refine uvd_v6/7_0_enc_get_destroy_msg
Date: Wed, 3 Oct 2018 16:26:17 +0200 [thread overview]
Message-ID: <b6712b08-cfef-37e6-1a4e-887d1096c170@gmail.com> (raw)
In-Reply-To: <1538120554-7414-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
Am 28.09.2018 um 09:42 schrieb Rex Zhu:
> 1. make uvd_v7_0_enc_get_destroy_msg static
> 2. drop a function variable that always true
>
> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 10 +++-------
> drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 12 ++++--------
> 2 files changed, 7 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
> index 8ef4a53..7a5b402 100644
> --- a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
> @@ -274,7 +274,7 @@ static int uvd_v6_0_enc_get_create_msg(struct amdgpu_ring *ring, uint32_t handle
> */
> static int uvd_v6_0_enc_get_destroy_msg(struct amdgpu_ring *ring,
> uint32_t handle,
> - bool direct, struct dma_fence **fence)
> + struct dma_fence **fence)
> {
> const unsigned ib_size_dw = 16;
> struct amdgpu_job *job;
> @@ -310,11 +310,7 @@ static int uvd_v6_0_enc_get_destroy_msg(struct amdgpu_ring *ring,
> for (i = ib->length_dw; i < ib_size_dw; ++i)
> ib->ptr[i] = 0x0;
>
> - if (direct)
> - r = amdgpu_job_submit_direct(job, ring, &f);
> - else
> - r = amdgpu_job_submit(job, &ring->adev->vce.entity,
> - AMDGPU_FENCE_OWNER_UNDEFINED, &f);
> + r = amdgpu_job_submit_direct(job, ring, &f);
> if (r)
> goto err;
>
> @@ -345,7 +341,7 @@ static int uvd_v6_0_enc_ring_test_ib(struct amdgpu_ring *ring, long timeout)
> goto error;
> }
>
> - r = uvd_v6_0_enc_get_destroy_msg(ring, 1, true, &fence);
> + r = uvd_v6_0_enc_get_destroy_msg(ring, 1, &fence);
> if (r) {
> DRM_ERROR("amdgpu: failed to get destroy ib (%ld).\n", r);
> goto error;
> diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
> index a289f6a..58b39af 100644
> --- a/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
> @@ -280,8 +280,8 @@ static int uvd_v7_0_enc_get_create_msg(struct amdgpu_ring *ring, uint32_t handle
> *
> * Close up a stream for HW test or if userspace failed to do so
> */
> -int uvd_v7_0_enc_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle,
> - bool direct, struct dma_fence **fence)
> +static int uvd_v7_0_enc_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle,
> + struct dma_fence **fence)
> {
> const unsigned ib_size_dw = 16;
> struct amdgpu_job *job;
> @@ -317,11 +317,7 @@ int uvd_v7_0_enc_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle,
> for (i = ib->length_dw; i < ib_size_dw; ++i)
> ib->ptr[i] = 0x0;
>
> - if (direct)
> - r = amdgpu_job_submit_direct(job, ring, &f);
> - else
> - r = amdgpu_job_submit(job, &ring->adev->vce.entity,
> - AMDGPU_FENCE_OWNER_UNDEFINED, &f);
> + r = amdgpu_job_submit_direct(job, ring, &f);
> if (r)
> goto err;
>
> @@ -352,7 +348,7 @@ static int uvd_v7_0_enc_ring_test_ib(struct amdgpu_ring *ring, long timeout)
> goto error;
> }
>
> - r = uvd_v7_0_enc_get_destroy_msg(ring, 1, true, &fence);
> + r = uvd_v7_0_enc_get_destroy_msg(ring, 1, &fence);
> if (r) {
> DRM_ERROR("amdgpu: (%d)failed to get destroy ib (%ld).\n", ring->me, r);
> goto error;
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
prev parent reply other threads:[~2018-10-03 14:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-28 7:42 [PATCH] drm/amdgpu: Refine uvd_v6/7_0_enc_get_destroy_msg Rex Zhu
[not found] ` <1538120554-7414-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2018-10-03 14:26 ` Christian König [this message]
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=b6712b08-cfef-37e6-1a4e-887d1096c170@gmail.com \
--to=ckoenig.leichtzumerken-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=Rex.Zhu-5C7GfCeVMHo@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=christian.koenig-5C7GfCeVMHo@public.gmane.org \
/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