All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nirmoy <nirmodas@amd.com>
To: Alex Deucher <alexdeucher@gmail.com>,
	Nirmoy Das <nirmoy.aiemd@gmail.com>
Cc: "Deucher, Alexander" <alexander.deucher@amd.com>,
	Huang Rui <Ray.Huang@amd.com>, Nirmoy Das <nirmoy.das@amd.com>,
	Christian Koenig <christian.koenig@amd.com>,
	amd-gfx list <amd-gfx@lists.freedesktop.org>
Subject: Re: [RFC PATCH 1/3] drm/amdgpu: implement ring init_priority for compute ring
Date: Thu, 27 Feb 2020 10:57:57 +0100	[thread overview]
Message-ID: <65374d06-4bbb-defe-8d5d-9964d1e3ab79@amd.com> (raw)
In-Reply-To: <CADnq5_M2w2W5eSX9m5x0hjY3TB7CxJa9YJfyUemk+mfgMVMMPA@mail.gmail.com>


On 2/27/20 5:44 AM, Alex Deucher wrote:
> On Wed, Feb 26, 2020 at 3:34 PM Nirmoy Das <nirmoy.aiemd@gmail.com> wrote:
>> init_priority will set second compute queue(gfx8 and gfx9) of a pipe to high priority
>> and 1st queue to normal priority.
>>
>> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h |  1 +
>>   drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c    | 14 ++++++++++++++
>>   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c    | 13 +++++++++++++
>>   3 files changed, 28 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
>> index 24caff085d00..a109373b9fe8 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
>> @@ -170,6 +170,7 @@ struct amdgpu_ring_funcs {
>>          /* priority functions */
>>          void (*set_priority) (struct amdgpu_ring *ring,
>>                                enum drm_sched_priority priority);
>> +       void (*init_priority) (struct amdgpu_ring *ring);
>>          /* Try to soft recover the ring to make the fence signal */
>>          void (*soft_recovery)(struct amdgpu_ring *ring, unsigned vmid);
>>          int (*preempt_ib)(struct amdgpu_ring *ring);
>> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
>> index fa245973de12..14bab6e08bd6 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
>> @@ -6334,6 +6334,19 @@ static void gfx_v8_0_ring_set_priority_compute(struct amdgpu_ring *ring,
>>          gfx_v8_0_pipe_reserve_resources(adev, ring, acquire);
>>   }
>>
>> +static void gfx_v8_0_ring_init_priority_compute(struct amdgpu_ring *ring)
>> +{
>> +       /* set pipe 0 to normal priority and pipe 1 to high priority*/
>> +       if (ring->queue == 1) {
>> +               gfx_v8_0_hqd_set_priority(ring->adev, ring, true);
>> +               gfx_v8_0_ring_set_pipe_percent(ring, true);
>> +       } else {
>> +               gfx_v8_0_hqd_set_priority(ring->adev, ring, false);
>> +               gfx_v8_0_ring_set_pipe_percent(ring, false);
>> +       }
>> +
>> +}
> We should drop gfx_v8_0_hqd_set_priority() and set the priorities in
> the mqd instead.  In gfx_v8_0_mqd_init(), set
> mqd->cp_hqd_pipe_priority and mqd->cp_hqd_queue_priority as
> appropriate for each queue.  I'm not sure we want to mess with
> gfx_v8_0_ring_set_pipe_percent ultimately at all once this lands.
> That stuff statically adjusts the priorities between gfx and compute.
Thanks Alex. I will send a updated patch for this.
>
>> +
>>   static void gfx_v8_0_ring_emit_fence_compute(struct amdgpu_ring *ring,
>>                                               u64 addr, u64 seq,
>>                                               unsigned flags)
>> @@ -6967,6 +6980,7 @@ static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_compute = {
>>          .insert_nop = amdgpu_ring_insert_nop,
>>          .pad_ib = amdgpu_ring_generic_pad_ib,
>>          .set_priority = gfx_v8_0_ring_set_priority_compute,
>> +       .init_priority = gfx_v8_0_ring_init_priority_compute,
>>          .emit_wreg = gfx_v8_0_ring_emit_wreg,
>>   };
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
>> index 1c7a16b91686..0c66743fb6f5 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
>> @@ -5143,6 +5143,18 @@ static void gfx_v9_0_ring_set_priority_compute(struct amdgpu_ring *ring,
>>          gfx_v9_0_pipe_reserve_resources(adev, ring, acquire);
>>   }
>>
>> +static void gfx_v9_0_ring_init_priority_compute(struct amdgpu_ring *ring)
>> +{
>> +       /* set pipe 0 to normal priority and pipe 1 to high priority*/
>> +       if (ring->queue == 1) {
>> +               gfx_v9_0_hqd_set_priority(ring->adev, ring, true);
>> +               gfx_v9_0_ring_set_pipe_percent(ring, true);
>> +       } else {
>> +               gfx_v9_0_hqd_set_priority(ring->adev, ring, false);
>> +               gfx_v9_0_ring_set_pipe_percent(ring, true);
>> +       }
>> +}
> Same comment as above.
>
> Alex
>
>> +
>>   static void gfx_v9_0_ring_set_wptr_compute(struct amdgpu_ring *ring)
>>   {
>>          struct amdgpu_device *adev = ring->adev;
>> @@ -6514,6 +6526,7 @@ static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_compute = {
>>          .insert_nop = amdgpu_ring_insert_nop,
>>          .pad_ib = amdgpu_ring_generic_pad_ib,
>>          .set_priority = gfx_v9_0_ring_set_priority_compute,
>> +       .init_priority = gfx_v9_0_ring_init_priority_compute,
>>          .emit_wreg = gfx_v9_0_ring_emit_wreg,
>>          .emit_reg_wait = gfx_v9_0_ring_emit_reg_wait,
>>          .emit_reg_write_reg_wait = gfx_v9_0_ring_emit_reg_write_reg_wait,
>> --
>> 2.25.0
>>
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx@lists.freedesktop.org
>> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Cnirmoy.das%40amd.com%7Cdfeeaa22459548bb7b9808d7bb3fcb60%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637183754987155471&amp;sdata=CUR%2BxoLBO%2FPSG7B1lyKAgQVcMLr%2BqQRYlHHs3OGFZPA%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  reply	other threads:[~2020-02-27  9:55 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26 20:37 [RFC PATCH 0/3] cleanup compute queue priority setting Nirmoy Das
2020-02-26 20:37 ` [RFC PATCH 1/3] drm/amdgpu: implement ring init_priority for compute ring Nirmoy Das
2020-02-27  4:44   ` Alex Deucher
2020-02-27  9:57     ` Nirmoy [this message]
2020-02-27  9:55       ` Christian König
2020-02-28  3:29   ` Luben Tuikov
2020-02-28  7:38     ` Christian König
2020-03-02 20:25       ` Luben Tuikov
2020-03-02 21:09         ` Alex Deucher
2020-02-26 20:37 ` [RFC PATCH 2/3] drm/amdgpu: change hw sched list on ctx priority override Nirmoy Das
2020-02-27 10:08   ` Christian König
2020-02-27 10:26     ` Nirmoy
2020-02-27 11:35       ` Christian König
2020-02-27 14:35     ` Alex Deucher
2020-02-27 20:31       ` Nirmoy
2020-02-27 21:02         ` Alex Deucher
2020-02-27 21:17           ` Nirmoy
2020-02-27 10:10   ` Nirmoy
2020-02-28  4:00   ` Luben Tuikov
2020-02-26 20:37 ` [RFC PATCH 3/3] drm/amdgpu: remove unused functions Nirmoy Das

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=65374d06-4bbb-defe-8d5d-9964d1e3ab79@amd.com \
    --to=nirmodas@amd.com \
    --cc=Ray.Huang@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=alexdeucher@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=nirmoy.aiemd@gmail.com \
    --cc=nirmoy.das@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.