AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhang, Jerry (Junwei)" <Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
To: christian.koenig-5C7GfCeVMHo@public.gmane.org,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH] drm/amdgpu: move amdgpu ttm structures to amdgpu_ttm.h
Date: Mon, 13 Aug 2018 10:38:36 +0800	[thread overview]
Message-ID: <5B70EF2C.4070508@amd.com> (raw)
In-Reply-To: <2eb1606a-2853-4de9-118f-fda8f864cdbb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On 08/10/2018 10:21 PM, Christian König wrote:
> Well NAK, that is intentionally kept local to the amdgpu_ttm.c file.
>
> This way we can make sure that we don't accidentally leak the structure somewhere else.

Thanks to explain that.
I thought those were left in the file accidentally.
Then fine to keep them in the file still.

Regards,
Jerry

>
> What you could do is to move it to the beginning of the file.
>
> Christian.
>
> Am 10.08.2018 um 07:44 schrieb Junwei Zhang:
>> code cleanup for amdgpu ttm structures
>>
>> Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 20 --------------------
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 17 +++++++++++++++++
>>   2 files changed, 17 insertions(+), 20 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> index c6611cf..87f4e8d 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> @@ -776,26 +776,6 @@ static unsigned long amdgpu_ttm_io_mem_pfn(struct ttm_buffer_object *bo,
>>           (offset >> PAGE_SHIFT);
>>   }
>> -/*
>> - * TTM backend functions.
>> - */
>> -struct amdgpu_ttm_gup_task_list {
>> -    struct list_head    list;
>> -    struct task_struct    *task;
>> -};
>> -
>> -struct amdgpu_ttm_tt {
>> -    struct ttm_dma_tt    ttm;
>> -    u64            offset;
>> -    uint64_t        userptr;
>> -    struct task_struct    *usertask;
>> -    uint32_t        userflags;
>> -    spinlock_t              guptasklock;
>> -    struct list_head        guptasks;
>> -    atomic_t        mmu_invalidations;
>> -    uint32_t        last_set_pages;
>> -};
>> -
>>   /**
>>    * amdgpu_ttm_tt_get_user_pages - Pin pages of memory pointed to by a USERPTR
>>    * pointer to memory
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
>> index 8b3cc66..b8c391a 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
>> @@ -66,6 +66,23 @@ struct amdgpu_copy_mem {
>>       unsigned long            offset;
>>   };
>> +struct amdgpu_ttm_gup_task_list {
>> +    struct list_head    list;
>> +    struct task_struct    *task;
>> +};
>> +
>> +struct amdgpu_ttm_tt {
>> +    struct ttm_dma_tt    ttm;
>> +    u64            offset;
>> +    uint64_t        userptr;
>> +    struct task_struct    *usertask;
>> +    uint32_t        userflags;
>> +    spinlock_t              guptasklock;
>> +    struct list_head        guptasks;
>> +    atomic_t        mmu_invalidations;
>> +    uint32_t        last_set_pages;
>> +};
>> +
>>   extern const struct ttm_mem_type_manager_func amdgpu_gtt_mgr_func;
>>   extern const struct ttm_mem_type_manager_func amdgpu_vram_mgr_func;
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

      parent reply	other threads:[~2018-08-13  2:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-10  5:44 [PATCH] drm/amdgpu: move amdgpu ttm structures to amdgpu_ttm.h Junwei Zhang
     [not found] ` <1533879868-11081-1-git-send-email-Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
2018-08-10  7:06   ` Huang Rui
2018-08-10 14:21   ` Christian König
     [not found]     ` <2eb1606a-2853-4de9-118f-fda8f864cdbb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-08-13  2:38       ` Zhang, Jerry (Junwei) [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=5B70EF2C.4070508@amd.com \
    --to=jerry.zhang-5c7gfcevmho@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=christian.koenig-5C7GfCeVMHo@public.gmane.org \
    /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