All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shashank Sharma <shashank.sharma@amd.com>
To: Alex Deucher <alexdeucher@gmail.com>
Cc: Alex Deucher <alexander.deucher@amd.com>,
	Felix Kuehling <felix.kuehling@amd.com>,
	Arvind Yadav <arvind.yadav@amd.com>,
	Christian Koenig <christian.koenig@amd.com>,
	amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3 6/9] drm/amdgpu: add new parameters in v11_struct
Date: Fri, 31 Mar 2023 10:30:48 +0200	[thread overview]
Message-ID: <e2fad27f-ae43-e617-d3c8-c6679b9374cb@amd.com> (raw)
In-Reply-To: <CADnq5_ONXNsjsAbXYB=aWEw0mm4MRw2UVPmCoS6xAEAw3Dqwhw@mail.gmail.com>


On 30/03/2023 23:25, Alex Deucher wrote:
> On Wed, Mar 29, 2023 at 12:05 PM Shashank Sharma
> <shashank.sharma@amd.com> wrote:
>> From: Arvind Yadav <arvind.yadav@amd.com>
>>
>> This patch:
>> - adds some new parameters defined for the gfx usermode queues
>>    use cases in the v11_mqd_struct.
>> - sets those parametes with the respective allocated gpu context
>>    space addresses.
>>
>> Cc: Alex Deucher <alexander.deucher@amd.com>
>> Cc: Christian Koenig <christian.koenig@amd.com>
>> Cc: Shashank Sharma <shashank.sharma@amd.com>
>> Signed-off-by: Arvind Yadav <arvind.yadav@amd.com>
>> ---
>>   .../drm/amd/amdgpu/amdgpu_userqueue_gfx_v11.c | 21 ++++++++++++++++++-
>>   drivers/gpu/drm/amd/include/v11_structs.h     | 16 +++++++-------
>>   2 files changed, 28 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue_gfx_v11.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue_gfx_v11.c
>> index 52de96727f98..39e90ea32fcb 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue_gfx_v11.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userqueue_gfx_v11.c
>> @@ -22,6 +22,7 @@
>>    */
>>   #include "amdgpu.h"
>>   #include "amdgpu_userqueue.h"
>> +#include "v11_structs.h"
>>
>>   #define AMDGPU_USERQ_PROC_CTX_SZ PAGE_SIZE
>>   #define AMDGPU_USERQ_GANG_CTX_SZ PAGE_SIZE
>> @@ -68,6 +69,22 @@ static void amdgpu_userq_gfx_v11_destroy_ctx_space(struct amdgpu_userq_mgr *uq_m
>>                             &ctx->cpu_ptr);
>>   }
>>
>> +static void
>> +amdgpu_userq_set_ctx_space(struct amdgpu_userq_mgr *uq_mgr,
>> +                           struct amdgpu_usermode_queue *queue)
>> +{
>> +    struct v11_gfx_mqd *mqd = queue->mqd.cpu_ptr;
>> +
>> +    mqd->shadow_base_lo = queue->shadow_ctx_gpu_addr & 0xfffffffc;
>> +    mqd->shadow_base_hi = upper_32_bits(queue->shadow_ctx_gpu_addr);
>> +
>> +    mqd->gds_bkup_base_lo = queue->gds_ctx_gpu_addr & 0xfffffffc;
>> +    mqd->gds_bkup_base_hi = upper_32_bits(queue->gds_ctx_gpu_addr);
>> +
>> +    mqd->fw_work_area_base_lo = queue->fw_ctx_gpu_addr & 0xfffffffc;
>> +    mqd->fw_work_area_base_lo = upper_32_bits(queue->fw_ctx_gpu_addr);
>> +}
>> +
>>   static int
>>   amdgpu_userq_gfx_v11_mqd_create(struct amdgpu_userq_mgr *uq_mgr, struct amdgpu_usermode_queue *queue)
>>   {
>> @@ -104,12 +121,14 @@ amdgpu_userq_gfx_v11_mqd_create(struct amdgpu_userq_mgr *uq_mgr, struct amdgpu_u
>>       queue->userq_prop.use_doorbell = true;
>>       queue->userq_prop.mqd_gpu_addr = mqd->gpu_addr;
>>       r = gfx_v11_mqd->init_mqd(adev, (void *)mqd->cpu_ptr, &queue->userq_prop);
>> -    amdgpu_bo_unreserve(mqd->obj);
>>       if (r) {
>> +        amdgpu_bo_unreserve(mqd->obj);
>>           DRM_ERROR("Failed to init MQD for queue\n");
>>           goto free_ctx;
>>       }
>>
>> +    amdgpu_userq_set_ctx_space(uq_mgr, queue);
>> +    amdgpu_bo_unreserve(mqd->obj);
>>       DRM_DEBUG_DRIVER("MQD for queue %d created\n", queue->queue_id);
>>       return 0;
>>
>> diff --git a/drivers/gpu/drm/amd/include/v11_structs.h b/drivers/gpu/drm/amd/include/v11_structs.h
>> index b8ff7456ae0b..f8008270f813 100644
>> --- a/drivers/gpu/drm/amd/include/v11_structs.h
>> +++ b/drivers/gpu/drm/amd/include/v11_structs.h
>> @@ -25,14 +25,14 @@
>>   #define V11_STRUCTS_H_
>>
>>   struct v11_gfx_mqd {
>> -       uint32_t reserved_0; // offset: 0  (0x0)
>> -       uint32_t reserved_1; // offset: 1  (0x1)
>> -       uint32_t reserved_2; // offset: 2  (0x2)
>> -       uint32_t reserved_3; // offset: 3  (0x3)
>> -       uint32_t reserved_4; // offset: 4  (0x4)
>> -       uint32_t reserved_5; // offset: 5  (0x5)
>> -       uint32_t reserved_6; // offset: 6  (0x6)
>> -       uint32_t reserved_7; // offset: 7  (0x7)
>> +       uint32_t shadow_base_lo; // offset: 0  (0x0)
>> +       uint32_t shadow_base_hi; // offset: 1  (0x1)
>> +       uint32_t gds_bkup_base_lo; // offset: 2  (0x2)
>> +       uint32_t gds_bkup_base_hi; // offset: 3  (0x3)
>> +       uint32_t fw_work_area_base_lo; // offset: 4  (0x4)
>> +       uint32_t fw_work_area_base_hi; // offset: 5  (0x5)
>> +       uint32_t shadow_initialized; // offset: 6  (0x6)
>> +       uint32_t ib_vmid; // offset: 7  (0x7)
>>          uint32_t reserved_8; // offset: 8  (0x8)
>>          uint32_t reserved_9; // offset: 9  (0x9)
>>          uint32_t reserved_10; // offset: 10  (0xA)
> We should split this hunk out as a separate patch and upstream it now.

Got it,

- Shashank

>
> Alex
>
>> --
>> 2.40.0
>>

  parent reply	other threads:[~2023-03-31  8:30 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-29 16:04 [PATCH v3 0/9] AMDGPU Usermode queues Shashank Sharma
2023-03-29 16:04 ` [PATCH v3 1/9] drm/amdgpu: UAPI for user queue management Shashank Sharma
2023-03-29 17:25   ` Christian König
2023-03-29 17:57   ` Alex Deucher
2023-03-29 19:21     ` Shashank Sharma
2023-03-29 19:46       ` Alex Deucher
2023-03-30  6:13         ` Shashank Sharma
     [not found]   ` <71fc098c-c0cb-3097-4e11-c2d9bd9b4783@damsy.net>
2023-03-30  8:15     ` Shashank Sharma
2023-03-30 10:40       ` Christian König
2023-03-30 15:08         ` Alex Deucher
2023-03-29 16:04 ` [PATCH v3 2/9] drm/amdgpu: add usermode queue base code Shashank Sharma
2023-03-30 21:15   ` Alex Deucher
2023-03-31  8:52     ` Shashank Sharma
2023-04-04 16:05   ` Luben Tuikov
2023-03-29 16:04 ` [PATCH v3 3/9] drm/amdgpu: add new IOCTL for usermode queue Shashank Sharma
2023-04-10  0:02   ` Bas Nieuwenhuizen
2023-04-10 14:28     ` Shashank Sharma
2023-03-29 16:04 ` [PATCH v3 4/9] drm/amdgpu: create GFX-gen11 MQD for userqueue Shashank Sharma
2023-03-30 21:18   ` Alex Deucher
2023-03-31  8:49     ` Shashank Sharma
2023-04-04 16:21   ` Luben Tuikov
2023-03-29 16:04 ` [PATCH v3 5/9] drm/amdgpu: create context space for usermode queue Shashank Sharma
2023-03-30 21:23   ` Alex Deucher
2023-03-31  8:42     ` Shashank Sharma
2023-04-04 16:24   ` Luben Tuikov
2023-04-04 16:37     ` Shashank Sharma
2023-03-29 16:04 ` [PATCH v3 6/9] drm/amdgpu: add new parameters in v11_struct Shashank Sharma
2023-03-30 21:25   ` Alex Deucher
2023-03-31  6:39     ` Yadav, Arvind
2023-03-31  8:30     ` Shashank Sharma [this message]
2023-03-29 16:04 ` [PATCH v3 7/9] drm/amdgpu: map usermode queue into MES Shashank Sharma
2023-04-04 16:30   ` Luben Tuikov
2023-04-04 16:36     ` Shashank Sharma
2023-04-04 20:58       ` Luben Tuikov
2023-04-05 10:06         ` Shashank Sharma
2023-04-05 21:18           ` Luben Tuikov
2023-04-06  7:45             ` Shashank Sharma
2023-04-06 15:16               ` Felix Kuehling
2023-04-07  6:41                 ` Shashank Sharma
2023-03-29 16:04 ` [PATCH v3 8/9] drm/amdgpu: map wptr BO into GART Shashank Sharma
2023-04-10  0:00   ` Bas Nieuwenhuizen
2023-04-11  9:29     ` Christian König
2023-04-11 16:02       ` Shashank Sharma
2023-03-29 16:04 ` [PATCH v3 9/9] drm/amdgpu: generate doorbell index for userqueue Shashank Sharma
2023-04-10  0:36 ` [PATCH v3 0/9] AMDGPU Usermode queues Bas Nieuwenhuizen
2023-04-10  7:32   ` Sharma, Shashank
2023-04-10  9:25     ` Bas Nieuwenhuizen
2023-04-10 13:40       ` Sharma, Shashank
2023-04-10 13:46         ` Bas Nieuwenhuizen
2023-04-10 14:01           ` Shashank Sharma
2023-04-10 14:04             ` Bas Nieuwenhuizen
2023-04-10 14:26               ` Shashank Sharma
2023-04-11  9:37                 ` Christian König
2023-04-11  9:48                   ` Shashank Sharma
2023-04-11 10:00                     ` Bas Nieuwenhuizen
2023-04-11 10:55                       ` Shashank Sharma

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=e2fad27f-ae43-e617-d3c8-c6679b9374cb@amd.com \
    --to=shashank.sharma@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=alexdeucher@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=arvind.yadav@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=felix.kuehling@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.