* [PATCH] drm/amdgpu: move amdgpu ttm structures to amdgpu_ttm.h
@ 2018-08-10 5:44 Junwei Zhang
[not found] ` <1533879868-11081-1-git-send-email-Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Junwei Zhang @ 2018-08-10 5:44 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: 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;
--
1.9.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amdgpu: move amdgpu ttm structures to amdgpu_ttm.h
[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
1 sibling, 0 replies; 4+ messages in thread
From: Huang Rui @ 2018-08-10 7:06 UTC (permalink / raw)
To: Junwei Zhang; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On Fri, Aug 10, 2018 at 01:44:28PM +0800, Junwei Zhang wrote:
> code cleanup for amdgpu ttm structures
>
> Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
Acked-by: Huang Rui <ray.huang@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;
>
> --
> 1.9.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amdgpu: move amdgpu ttm structures to amdgpu_ttm.h
[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>
1 sibling, 1 reply; 4+ messages in thread
From: Christian König @ 2018-08-10 14:21 UTC (permalink / raw)
To: Junwei Zhang, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
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.
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amdgpu: move amdgpu ttm structures to amdgpu_ttm.h
[not found] ` <2eb1606a-2853-4de9-118f-fda8f864cdbb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2018-08-13 2:38 ` Zhang, Jerry (Junwei)
0 siblings, 0 replies; 4+ messages in thread
From: Zhang, Jerry (Junwei) @ 2018-08-13 2:38 UTC (permalink / raw)
To: christian.koenig-5C7GfCeVMHo, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-08-13 2:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.