From: Nirmoy <nirmodas@amd.com>
To: "Christian König" <christian.koenig@amd.com>,
"Nirmoy Das" <nirmoy.aiemd@gmail.com>,
amd-gfx@lists.freedesktop.org
Cc: alexander.deucher@amd.com, ray.huang@amd.com, nirmoy.das@amd.com
Subject: Re: [RFC PATCH v2] drm/amdgpu: move ttm bo->offset to amdgpu_bo
Date: Tue, 11 Feb 2020 15:54:48 +0100 [thread overview]
Message-ID: <8d4c19f0-9a07-096b-3402-48d82e9d1391@amd.com> (raw)
In-Reply-To: <3bf68f81-2825-6b00-af9a-e073c3872384@amd.com>
[-- Attachment #1.1: Type: text/plain, Size: 1992 bytes --]
On 2/11/20 3:09 PM, Christian König wrote:
> Am 11.02.20 um 15:06 schrieb Nirmoy Das:
>> GPU address should belong to driver not in memory management.
>> This patch moves ttm bo.offset and gpu_offset calculation to amdgpu
>> driver.
>>
>> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 22 +++++++++++++++++++--
>> drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 1 +
>> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 8 +-------
>> drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c | 4 ++--
>> 4 files changed, 24 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>> index 6f60a581e3ba..e25924be33ca 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>> @@ -917,7 +917,7 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo
>> *bo, u32 domain,
>> bo->pin_count++;
>> if (max_offset != 0) {
>> - u64 domain_start = bo->tbo.bdev->man[mem_type].gpu_offset;
>> + u64 domain_start = amdgpu_bo_gpu_start(adev, mem_type);
>> WARN_ON_ONCE(max_offset <
>> (amdgpu_bo_gpu_offset(bo) - domain_start));
>> }
>> @@ -1248,6 +1248,18 @@ int amdgpu_bo_get_metadata(struct amdgpu_bo
>> *bo, void *buffer,
>> return 0;
>> }
>> +uint64_t amdgpu_bo_gpu_start(struct amdgpu_device *adev, uint32_t
>> type)
>
> Probably better to put that into amdgpu_ttm.[ch] or amdgpu_gmc.[ch]
> and name it an amdgpu_ttm_domain_start.
>
>> +{
>> + switch(type) {
>> + case TTM_PL_TT:
>
> Coding style here is of, what editor and setting do you use?
vi with *set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab cindent*
My bad, I didn't check existing switch style.
Regards,
Nirmoy
[-- Attachment #1.2: Type: text/html, Size: 3823 bytes --]
[-- Attachment #2: Type: text/plain, Size: 154 bytes --]
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2020-02-11 14:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-11 14:06 [RFC PATCH v2] drm/amdgpu: move ttm bo->offset to amdgpu_bo Nirmoy Das
2020-02-11 14:09 ` Christian König
2020-02-11 14:54 ` Nirmoy [this message]
2020-02-11 15:16 ` Christian König
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=8d4c19f0-9a07-096b-3402-48d82e9d1391@amd.com \
--to=nirmodas@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=nirmoy.aiemd@gmail.com \
--cc=nirmoy.das@amd.com \
--cc=ray.huang@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