public inbox for amd-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Nirmoy <nirmodas@amd.com>,
	"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 16:16:37 +0100	[thread overview]
Message-ID: <0aa40eb6-016d-75d2-16b6-080e30ca5d4b@gmail.com> (raw)
In-Reply-To: <8d4c19f0-9a07-096b-3402-48d82e9d1391@amd.com>


[-- Attachment #1.1: Type: text/plain, Size: 2360 bytes --]

Am 11.02.20 um 15:54 schrieb Nirmoy:
>
>
> 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.
>

Try this one here: https://github.com/vivien/vim-linux-coding-style

That should help,
Christian.

>
> Regards,
>
> Nirmoy
>
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[-- Attachment #1.2: Type: text/html, Size: 4278 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

      reply	other threads:[~2020-02-11 15:16 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
2020-02-11 15:16     ` 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=0aa40eb6-016d-75d2-16b6-080e30ca5d4b@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=nirmodas@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