From: "Christian König" <christian.koenig@amd.com>
To: xinhui pan <xinhui.pan@amd.com>, amd-gfx@lists.freedesktop.org
Cc: alexander.deucher@amd.com, lijo.lazar@amd.com
Subject: Re: [RFC PATCH 1/2] drm/amdgpu: Introduce ring lock
Date: Mon, 13 Sep 2021 08:25:17 +0200 [thread overview]
Message-ID: <4f1c2322-3e3c-43cb-dcef-209191bcdcaa@amd.com> (raw)
In-Reply-To: <20210913055521.27341-1-xinhui.pan@amd.com>
NAK, that is exactly what we try to avoid here.
Christian.
Am 13.09.21 um 07:55 schrieb xinhui pan:
> This is used for direct IB submission to ring.
>
> Signed-off-by: xinhui pan <xinhui.pan@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 2 ++
> drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 1 +
> 2 files changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> index ab2351ba9574..f97a28a49120 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> @@ -184,6 +184,8 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
> else if (ring == &adev->sdma.instance[0].page)
> sched_hw_submission = 256;
>
> + mutex_init(&ring->lock);
> +
> if (ring->adev == NULL) {
> if (adev->num_rings >= AMDGPU_MAX_RINGS)
> return -EINVAL;
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
> index 4d380e79752c..544766429b5c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
> @@ -215,6 +215,7 @@ struct amdgpu_ring {
> struct amdgpu_fence_driver fence_drv;
> struct drm_gpu_scheduler sched;
>
> + struct mutex lock;
> struct amdgpu_bo *ring_obj;
> volatile uint32_t *ring;
> unsigned rptr_offs;
prev parent reply other threads:[~2021-09-13 6:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-13 5:55 [RFC PATCH 1/2] drm/amdgpu: Introduce ring lock xinhui pan
2021-09-13 5:55 ` [RFC PATCH 2/2] drm/amdgpu: protect ring from concurrency access xinhui pan
2021-09-13 6:25 ` 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=4f1c2322-3e3c-43cb-dcef-209191bcdcaa@amd.com \
--to=christian.koenig@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=lijo.lazar@amd.com \
--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