All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shashank Sharma <shashank.sharma@amd.com>
To: "Luben Tuikov" <luben.tuikov@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	amd-gfx@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>,
	Mukul Joshi <mukul.joshi@amd.com>,
	Felix Kuehling <felix.kuehling@amd.com>
Subject: Re: [PATCH 06/16] drm/amdgpu: accommodate DOMAIN/PL_DOORBELL
Date: Thu, 30 Mar 2023 17:32:34 +0200	[thread overview]
Message-ID: <a92e250b-4865-e6b2-e91c-fe83f54a4bd2@amd.com> (raw)
In-Reply-To: <a9a398e4-847c-fc99-370c-e641fc49ed80@amd.com>


On 30/03/2023 16:12, Luben Tuikov wrote:
> On 2023-03-30 09:48, Shashank Sharma wrote:
>> On 30/03/2023 15:45, Luben Tuikov wrote:
>>> On 2023-03-30 09:43, Shashank Sharma wrote:
>>>> On 30/03/2023 15:33, Luben Tuikov wrote:
>>>>> On 2023-03-30 07:14, Christian König wrote:
>>>>>> Am 29.03.23 um 17:47 schrieb Shashank Sharma:
>>>>>>> From: Alex Deucher <alexander.deucher@amd.com>
>>>>>>>
>>>>>>> This patch adds changes:
>>>>>>> - to accommodate the new GEM domain DOORBELL
>>>>>>> - to accommodate the new TTM PL DOORBELL
>>>>>>>
>>>>>>> in order to manage doorbell pages as GEM object.
>>>>>>>
>>>>>>> V2: Addressed reviwe comments from Christian
>>>>>>>         - drop the doorbell changes for pinning/unpinning
>>>>>>>         - drop the doorbell changes for dma-buf map
>>>>>>>         - drop the doorbell changes for sgt
>>>>>>>         - no need to handle TTM_PL_FLAG_CONTIGUOUS for doorbell
>>>>>>>         - add caching type for doorbell
>>>>>>>
>>>>>>> Cc: Alex Deucher <alexander.deucher@amd.com>
>>>>>>> Cc: Christian Koenig <christian.koenig@amd.com>
>>>>>>>
>>>>>>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>>>>>>> Signed-off-by: Shashank Sharma <shashank.sharma@amd.com>
>>>>> Generally there are no empty lines in the tag list. Perhaps remove it?
>>>> I would prefer to keep it, to highlight the CC parts.
>>> I've never seen a commit with them separated. Perhaps follow Linux custom?
>> IIRC This is not against Linux patch formatting/message body guidelines.
> The tag list forms a block, a paragraph, which is easy to scan and separate out
> of the description of the patch, which in itself can have many paragraphs separated
> by white lines: subject line, paragraph 1, paragraph 2, ..., paragraph of tags.
> Furthermore these tags are added/appended by automated scripts/tools which wouldn't
> add an empty line.
>
> Check out the following resources:
> https://www.kernel.org/doc/html/v4.12/process/5.Posting.html#patch-formatting-and-changelogs
> https://www.kernel.org/doc/html/v4.12/process/submitting-patches.html#the-canonical-patch-format
>
> "git log -- drivers/gpu/drm/." is also a very helpful reference to see some good patch formatting.
>
> Please remove the empty line between the Cc and Sob lines, so it forms a tag paragraph.

Certainly makes sense, agreed.

- Shashank

>
> Regards,
> Luben
>
>
>> - Shashank
>>
>>> Regards,
>>> Luben
>>>
>>>> - Shashank
>>>>
>>>>> Regards,
>>>>> Luben
>>>>>
>>>>>>> ---
>>>>>>>      drivers/gpu/drm/amd/amdgpu/amdgpu_object.c     | 11 ++++++++++-
>>>>>>>      drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h |  2 ++
>>>>>>>      drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c        | 16 +++++++++++++++-
>>>>>>>      drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h        |  1 +
>>>>>>>      4 files changed, 28 insertions(+), 2 deletions(-)
>>>>>>>
>>>>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>>>>>>> index 4e684c2afc70..0ec080e240ad 100644
>>>>>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>>>>>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>>>>>>> @@ -147,6 +147,14 @@ void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain)
>>>>>>>      		c++;
>>>>>>>      	}
>>>>>>>      
>>>>>>> +	if (domain & AMDGPU_GEM_DOMAIN_DOORBELL) {
>>>>>>> +		places[c].fpfn = 0;
>>>>>>> +		places[c].lpfn = 0;
>>>>>>> +		places[c].mem_type = AMDGPU_PL_DOORBELL;
>>>>>>> +		places[c].flags = 0;
>>>>>>> +		c++;
>>>>>>> +	}
>>>>>>> +
>>>>>>>      	if (domain & AMDGPU_GEM_DOMAIN_GTT) {
>>>>>>>      		places[c].fpfn = 0;
>>>>>>>      		places[c].lpfn = 0;
>>>>>>> @@ -466,7 +474,7 @@ static bool amdgpu_bo_validate_size(struct amdgpu_device *adev,
>>>>>>>      		goto fail;
>>>>>>>      	}
>>>>>>>      
>>>>>>> -	/* TODO add more domains checks, such as AMDGPU_GEM_DOMAIN_CPU */
>>>>>>> +	/* TODO add more domains checks, such as AMDGPU_GEM_DOMAIN_CPU,  AMDGPU_GEM_DOMAIN_DOORBELL */
>>>>>>>      	return true;
>>>>>>>      
>>>>>>>      fail:
>>>>>>> @@ -1013,6 +1021,7 @@ void amdgpu_bo_unpin(struct amdgpu_bo *bo)
>>>>>>>      	} else if (bo->tbo.resource->mem_type == TTM_PL_TT) {
>>>>>>>      		atomic64_sub(amdgpu_bo_size(bo), &adev->gart_pin_size);
>>>>>>>      	}
>>>>>>> +
>>>>>> Unrelated newline, probably just a leftover.
>>>>>>
>>>>>> Apart from that the patch is Reviewed-by: Christian König
>>>>>> <christian.koenig@amd.com>
>>>>>>
>>>>>> Regards,
>>>>>> Christian.
>>>>>>
>>>>>>>      }
>>>>>>>      
>>>>>>>      static const char *amdgpu_vram_names[] = {
>>>>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
>>>>>>> index 5c4f93ee0c57..3c988cc406e4 100644
>>>>>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
>>>>>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
>>>>>>> @@ -90,6 +90,7 @@ static inline void amdgpu_res_first(struct ttm_resource *res,
>>>>>>>      		cur->node = block;
>>>>>>>      		break;
>>>>>>>      	case TTM_PL_TT:
>>>>>>> +	case AMDGPU_PL_DOORBELL:
>>>>>>>      		node = to_ttm_range_mgr_node(res)->mm_nodes;
>>>>>>>      		while (start >= node->size << PAGE_SHIFT)
>>>>>>>      			start -= node++->size << PAGE_SHIFT;
>>>>>>> @@ -152,6 +153,7 @@ static inline void amdgpu_res_next(struct amdgpu_res_cursor *cur, uint64_t size)
>>>>>>>      		cur->size = min(amdgpu_vram_mgr_block_size(block), cur->remaining);
>>>>>>>      		break;
>>>>>>>      	case TTM_PL_TT:
>>>>>>> +	case AMDGPU_PL_DOORBELL:
>>>>>>>      		node = cur->node;
>>>>>>>      
>>>>>>>      		cur->node = ++node;
>>>>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>>>>>>> index 55e0284b2bdd..6f61491ef3dd 100644
>>>>>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>>>>>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>>>>>>> @@ -128,6 +128,7 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo,
>>>>>>>      	case AMDGPU_PL_GDS:
>>>>>>>      	case AMDGPU_PL_GWS:
>>>>>>>      	case AMDGPU_PL_OA:
>>>>>>> +	case AMDGPU_PL_DOORBELL:
>>>>>>>      		placement->num_placement = 0;
>>>>>>>      		placement->num_busy_placement = 0;
>>>>>>>      		return;
>>>>>>> @@ -500,9 +501,11 @@ static int amdgpu_bo_move(struct ttm_buffer_object *bo, bool evict,
>>>>>>>      	if (old_mem->mem_type == AMDGPU_PL_GDS ||
>>>>>>>      	    old_mem->mem_type == AMDGPU_PL_GWS ||
>>>>>>>      	    old_mem->mem_type == AMDGPU_PL_OA ||
>>>>>>> +	    old_mem->mem_type == AMDGPU_PL_DOORBELL ||
>>>>>>>      	    new_mem->mem_type == AMDGPU_PL_GDS ||
>>>>>>>      	    new_mem->mem_type == AMDGPU_PL_GWS ||
>>>>>>> -	    new_mem->mem_type == AMDGPU_PL_OA) {
>>>>>>> +	    new_mem->mem_type == AMDGPU_PL_OA ||
>>>>>>> +	    new_mem->mem_type == AMDGPU_PL_DOORBELL) {
>>>>>>>      		/* Nothing to save here */
>>>>>>>      		ttm_bo_move_null(bo, new_mem);
>>>>>>>      		goto out;
>>>>>>> @@ -586,6 +589,12 @@ static int amdgpu_ttm_io_mem_reserve(struct ttm_device *bdev,
>>>>>>>      		mem->bus.offset += adev->gmc.aper_base;
>>>>>>>      		mem->bus.is_iomem = true;
>>>>>>>      		break;
>>>>>>> +	case AMDGPU_PL_DOORBELL:
>>>>>>> +		mem->bus.offset = mem->start << PAGE_SHIFT;
>>>>>>> +		mem->bus.offset += adev->doorbell.base;
>>>>>>> +		mem->bus.is_iomem = true;
>>>>>>> +		mem->bus.caching = ttm_uncached;
>>>>>>> +		break;
>>>>>>>      	default:
>>>>>>>      		return -EINVAL;
>>>>>>>      	}
>>>>>>> @@ -600,6 +609,10 @@ static unsigned long amdgpu_ttm_io_mem_pfn(struct ttm_buffer_object *bo,
>>>>>>>      
>>>>>>>      	amdgpu_res_first(bo->resource, (u64)page_offset << PAGE_SHIFT, 0,
>>>>>>>      			 &cursor);
>>>>>>> +
>>>>>>> +	if (bo->resource->mem_type == AMDGPU_PL_DOORBELL)
>>>>>>> +		return ((uint64_t)(adev->doorbell.base + cursor.start)) >> PAGE_SHIFT;
>>>>>>> +
>>>>>>>      	return (adev->gmc.aper_base + cursor.start) >> PAGE_SHIFT;
>>>>>>>      }
>>>>>>>      
>>>>>>> @@ -1267,6 +1280,7 @@ uint64_t amdgpu_ttm_tt_pde_flags(struct ttm_tt *ttm, struct ttm_resource *mem)
>>>>>>>      		flags |= AMDGPU_PTE_VALID;
>>>>>>>      
>>>>>>>      	if (mem && (mem->mem_type == TTM_PL_TT ||
>>>>>>> +		    mem->mem_type == AMDGPU_PL_DOORBELL ||
>>>>>>>      		    mem->mem_type == AMDGPU_PL_PREEMPT)) {
>>>>>>>      		flags |= AMDGPU_PTE_SYSTEM;
>>>>>>>      
>>>>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
>>>>>>> index e2cd5894afc9..761cd6b2b942 100644
>>>>>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
>>>>>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
>>>>>>> @@ -33,6 +33,7 @@
>>>>>>>      #define AMDGPU_PL_GWS		(TTM_PL_PRIV + 1)
>>>>>>>      #define AMDGPU_PL_OA		(TTM_PL_PRIV + 2)
>>>>>>>      #define AMDGPU_PL_PREEMPT	(TTM_PL_PRIV + 3)
>>>>>>> +#define AMDGPU_PL_DOORBELL	(TTM_PL_PRIV + 4)
>>>>>>>      
>>>>>>>      #define AMDGPU_GTT_MAX_TRANSFER_SIZE	512
>>>>>>>      #define AMDGPU_GTT_NUM_TRANSFER_WINDOWS	2

  reply	other threads:[~2023-03-30 15:32 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-29 15:47 [PATCH 00/16] AMDGPU Doorbell manager Shashank Sharma
2023-03-29 15:47 ` [PATCH 01/16] drm/amdgpu: rename num_doorbells Shashank Sharma
2023-03-30 11:04   ` Christian König
2023-03-30 13:11   ` Luben Tuikov
2023-03-30 13:13     ` Shashank Sharma
2023-03-30 14:19   ` Alex Deucher
2023-04-04 16:13   ` Luben Tuikov
2023-03-29 15:47 ` [PATCH 02/16] drm/amdgpu: include protection for doobell.h Shashank Sharma
2023-03-30 11:05   ` Christian König
2023-03-30 11:07     ` Shashank Sharma
2023-03-30 14:20   ` Alex Deucher
2023-03-29 15:47 ` [PATCH 03/16] drm/amdgpu: create a new file for doorbell manager Shashank Sharma
2023-03-30 11:09   ` Christian König
2023-03-30 13:29     ` Luben Tuikov
2023-03-30 13:42       ` Shashank Sharma
2023-03-30 14:23   ` Alex Deucher
2023-03-30 14:49     ` Shashank Sharma
2023-03-29 15:47 ` [PATCH 04/16] drm/amdgpu: don't modify num_doorbells for mes Shashank Sharma
2023-03-30 11:10   ` Christian König
2023-03-30 14:24   ` Alex Deucher
2023-03-29 15:47 ` [PATCH 05/16] drm/amdgpu: add UAPI for allocating doorbell memory Shashank Sharma
2023-03-30 11:11   ` Christian König
2023-03-29 15:47 ` [PATCH 06/16] drm/amdgpu: accommodate DOMAIN/PL_DOORBELL Shashank Sharma
2023-03-30 11:14   ` Christian König
2023-03-30 13:33     ` Luben Tuikov
2023-03-30 13:43       ` Shashank Sharma
2023-03-30 13:45         ` Luben Tuikov
2023-03-30 13:48           ` Shashank Sharma
2023-03-30 14:12             ` Luben Tuikov
2023-03-30 15:32               ` Shashank Sharma [this message]
2023-03-30 19:59   ` Alex Deucher
2023-03-29 15:47 ` [PATCH 07/16] drm/amdgpu: add helper to create doorbell pages Shashank Sharma
2023-03-30 11:29   ` Christian König
2023-03-30 11:46     ` Shashank Sharma
2023-03-30 13:42   ` Luben Tuikov
2023-03-30 13:44     ` Luben Tuikov
2023-03-30 14:04     ` Shashank Sharma
2023-03-30 14:15       ` Luben Tuikov
2023-03-30 14:34         ` Shashank Sharma
2023-03-30 14:37           ` Luben Tuikov
2023-03-30 14:55           ` Alex Deucher
2023-03-30 15:21             ` Shashank Sharma
2023-03-30 20:35               ` Alex Deucher
2023-03-31  8:26                 ` Shashank Sharma
2023-03-30 14:28   ` Alex Deucher
2023-03-30 14:38     ` Luben Tuikov
2023-03-29 15:47 ` [PATCH 08/16] drm/amdgpu: initialize ttm for doorbells Shashank Sharma
2023-03-30 11:22   ` Christian König
2023-03-30 14:33   ` Alex Deucher
2023-03-30 14:54     ` Shashank Sharma
2023-03-29 15:47 ` [PATCH 09/16] drm/amdgpu: create kernel doorbell page Shashank Sharma
2023-03-30 11:30   ` Christian König
2023-03-30 11:48     ` Shashank Sharma
2023-03-30 14:39       ` Alex Deucher
2023-03-30 14:42         ` Christian König
2023-03-30 14:48           ` Shashank Sharma
2023-03-30 14:53             ` Christian König
2023-03-30 15:04             ` Alex Deucher
2023-03-31  8:25               ` Shashank Sharma
2023-03-30 14:24   ` Luben Tuikov
2023-03-30 14:40     ` Shashank Sharma
2023-03-30 14:49       ` Christian König
2023-03-30 14:52         ` Luben Tuikov
2023-03-30 14:53         ` Shashank Sharma
2023-03-30 14:59           ` Luben Tuikov
2023-03-30 15:09             ` Shashank Sharma
2023-03-29 15:47 ` [PATCH 10/16] drm/amdgpu: validate doorbell read/write Shashank Sharma
2023-03-30 14:34   ` Luben Tuikov
2023-03-30 14:37     ` Shashank Sharma
2023-03-30 14:49       ` Luben Tuikov
2023-03-30 15:02         ` Shashank Sharma
2023-03-29 15:47 ` [PATCH 11/16] drm/amdgpu: get absolute offset from doorbell index Shashank Sharma
2023-03-30 17:18   ` Luben Tuikov
2023-03-30 17:25     ` Shashank Sharma
2023-03-29 15:47 ` [PATCH 12/16] drm/amdgpu: use doorbell manager for kfd kernel doorbells Shashank Sharma
2023-03-30 20:46   ` Alex Deucher
2023-03-31  8:27     ` Shashank Sharma
2023-03-29 15:47 ` [PATCH 13/16] drm/amdgpu: use doorbell manager for kfd process doorbells Shashank Sharma
2023-03-30 20:54   ` Alex Deucher
2023-03-31  8:28     ` Shashank Sharma
2023-03-29 15:47 ` [PATCH 14/16] drm/amdgpu: remove ununsed functions and variables Shashank Sharma
2023-03-29 15:47 ` [PATCH 15/16] drm/amdgpu: use doorbell mgr for MES kernel doorbells Shashank Sharma
2023-03-30 20:58   ` Alex Deucher
2023-03-31  8:29     ` Shashank Sharma
2023-03-29 15:47 ` [PATCH 16/16] drm/amdgpu: user doorbell mgr for MES process doorbells Shashank Sharma
2023-03-30 13:49 ` [PATCH 00/16] AMDGPU Doorbell manager Luben Tuikov
2023-03-30 13:56   ` Sharma, Shashank

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=a92e250b-4865-e6b2-e91c-fe83f54a4bd2@amd.com \
    --to=shashank.sharma@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=felix.kuehling@amd.com \
    --cc=luben.tuikov@amd.com \
    --cc=mukul.joshi@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.