* [PATCH v2] drm/amdgpu: simplify bo_va list when vm bo update (v2)
@ 2018-04-19 6:53 Junwei Zhang
[not found] ` <1524120806-22986-1-git-send-email-Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Junwei Zhang @ 2018-04-19 6:53 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Junwei Zhang
v2: fix compiling warning
Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 8c34060..e3e0375 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1509,6 +1509,7 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
struct drm_mm_node *nodes;
struct dma_fence *exclusive, **last_update;
uint64_t flags;
+ uint32_t mem_type;
int r;
if (clear || !bo_va->base.bo) {
@@ -1561,19 +1562,16 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
}
spin_lock(&vm->status_lock);
- if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv) {
- unsigned mem_type = bo->tbo.mem.mem_type;
+ list_del_init(&bo_va->base.vm_status);
- /* If the BO is not in its preferred location add it back to
- * the evicted list so that it gets validated again on the
- * next command submission.
- */
- list_del_init(&bo_va->base.vm_status);
- if (!(bo->preferred_domains & amdgpu_mem_type_to_domain(mem_type)))
- list_add_tail(&bo_va->base.vm_status, &vm->evicted);
- } else {
- list_del_init(&bo_va->base.vm_status);
- }
+ /* If the BO is not in its preferred location add it back to
+ * the evicted list so that it gets validated again on the
+ * next command submission.
+ */
+ mem_type = bo->tbo.mem.mem_type;
+ if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv &&
+ !(bo->preferred_domains & amdgpu_mem_type_to_domain(mem_type)))
+ list_add_tail(&bo_va->base.vm_status, &vm->evicted);
spin_unlock(&vm->status_lock);
list_splice_init(&bo_va->invalids, &bo_va->valids);
--
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] 5+ messages in thread
* Re: [PATCH v2] drm/amdgpu: simplify bo_va list when vm bo update (v2)
[not found] ` <1524120806-22986-1-git-send-email-Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
@ 2018-04-19 7:06 ` Christian König
[not found] ` <d18ea29d-4d53-0bad-aacd-3a839e016f80-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Christian König @ 2018-04-19 7:06 UTC (permalink / raw)
To: Junwei Zhang, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Am 19.04.2018 um 08:53 schrieb Junwei Zhang:
> v2: fix compiling warning
>
> Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 22 ++++++++++------------
> 1 file changed, 10 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 8c34060..e3e0375 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -1509,6 +1509,7 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
> struct drm_mm_node *nodes;
> struct dma_fence *exclusive, **last_update;
> uint64_t flags;
> + uint32_t mem_type;
> int r;
>
> if (clear || !bo_va->base.bo) {
> @@ -1561,19 +1562,16 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
> }
>
> spin_lock(&vm->status_lock);
> - if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv) {
> - unsigned mem_type = bo->tbo.mem.mem_type;
> + list_del_init(&bo_va->base.vm_status);
>
> - /* If the BO is not in its preferred location add it back to
> - * the evicted list so that it gets validated again on the
> - * next command submission.
> - */
> - list_del_init(&bo_va->base.vm_status);
> - if (!(bo->preferred_domains & amdgpu_mem_type_to_domain(mem_type)))
> - list_add_tail(&bo_va->base.vm_status, &vm->evicted);
> - } else {
> - list_del_init(&bo_va->base.vm_status);
> - }
> + /* If the BO is not in its preferred location add it back to
> + * the evicted list so that it gets validated again on the
> + * next command submission.
> + */
> + mem_type = bo->tbo.mem.mem_type;
> + if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv &&
> + !(bo->preferred_domains & amdgpu_mem_type_to_domain(mem_type)))
The indentation on the line above is wrong, the "!(bo..." should be on
the same column as the "bo &&" above.
Apart from that looks good to me,
Christian.
> + list_add_tail(&bo_va->base.vm_status, &vm->evicted);
> spin_unlock(&vm->status_lock);
>
> list_splice_init(&bo_va->invalids, &bo_va->valids);
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] drm/amdgpu: simplify bo_va list when vm bo update (v2)
[not found] ` <d18ea29d-4d53-0bad-aacd-3a839e016f80-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2018-04-19 7:40 ` Zhang, Jerry (Junwei)
[not found] ` <5AD847FE.9050607-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Zhang, Jerry (Junwei) @ 2018-04-19 7:40 UTC (permalink / raw)
To: christian.koenig-5C7GfCeVMHo, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On 04/19/2018 03:06 PM, Christian König wrote:
> Am 19.04.2018 um 08:53 schrieb Junwei Zhang:
>> v2: fix compiling warning
>>
>> Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 22 ++++++++++------------
>> 1 file changed, 10 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> index 8c34060..e3e0375 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>> @@ -1509,6 +1509,7 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
>> struct drm_mm_node *nodes;
>> struct dma_fence *exclusive, **last_update;
>> uint64_t flags;
>> + uint32_t mem_type;
>> int r;
>> if (clear || !bo_va->base.bo) {
>> @@ -1561,19 +1562,16 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
>> }
>> spin_lock(&vm->status_lock);
>> - if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv) {
>> - unsigned mem_type = bo->tbo.mem.mem_type;
>> + list_del_init(&bo_va->base.vm_status);
>> - /* If the BO is not in its preferred location add it back to
>> - * the evicted list so that it gets validated again on the
>> - * next command submission.
>> - */
>> - list_del_init(&bo_va->base.vm_status);
>> - if (!(bo->preferred_domains & amdgpu_mem_type_to_domain(mem_type)))
>> - list_add_tail(&bo_va->base.vm_status, &vm->evicted);
>> - } else {
>> - list_del_init(&bo_va->base.vm_status);
>> - }
>> + /* If the BO is not in its preferred location add it back to
>> + * the evicted list so that it gets validated again on the
>> + * next command submission.
>> + */
>> + mem_type = bo->tbo.mem.mem_type;
>> + if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv &&
>> + !(bo->preferred_domains & amdgpu_mem_type_to_domain(mem_type)))
>
> The indentation on the line above is wrong, the "!(bo..." should be on the same
> column as the "bo &&" above.
Thanks to point that out.
May I get your RB with that fix?
Jerry
>
> Apart from that looks good to me,
> Christian.
>
>> + list_add_tail(&bo_va->base.vm_status, &vm->evicted);
>> spin_unlock(&vm->status_lock);
>> list_splice_init(&bo_va->invalids, &bo_va->valids);
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] drm/amdgpu: simplify bo_va list when vm bo update (v2)
[not found] ` <5AD847FE.9050607-5C7GfCeVMHo@public.gmane.org>
@ 2018-04-19 7:42 ` Christian König
[not found] ` <c6e733bb-cc43-357a-f7b6-29e6cf394b01-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Christian König @ 2018-04-19 7:42 UTC (permalink / raw)
To: Zhang, Jerry (Junwei),
christian.koenig-5C7GfCeVMHo,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Am 19.04.2018 um 09:40 schrieb Zhang, Jerry (Junwei):
>
>
> On 04/19/2018 03:06 PM, Christian König wrote:
>> Am 19.04.2018 um 08:53 schrieb Junwei Zhang:
>>> v2: fix compiling warning
>>>
>>> Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
>>> ---
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 22 ++++++++++------------
>>> 1 file changed, 10 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>>> index 8c34060..e3e0375 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>>> @@ -1509,6 +1509,7 @@ int amdgpu_vm_bo_update(struct amdgpu_device
>>> *adev,
>>> struct drm_mm_node *nodes;
>>> struct dma_fence *exclusive, **last_update;
>>> uint64_t flags;
>>> + uint32_t mem_type;
>>> int r;
>>> if (clear || !bo_va->base.bo) {
>>> @@ -1561,19 +1562,16 @@ int amdgpu_vm_bo_update(struct amdgpu_device
>>> *adev,
>>> }
>>> spin_lock(&vm->status_lock);
>>> - if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv) {
>>> - unsigned mem_type = bo->tbo.mem.mem_type;
>>> + list_del_init(&bo_va->base.vm_status);
>>> - /* If the BO is not in its preferred location add it back to
>>> - * the evicted list so that it gets validated again on the
>>> - * next command submission.
>>> - */
>>> - list_del_init(&bo_va->base.vm_status);
>>> - if (!(bo->preferred_domains &
>>> amdgpu_mem_type_to_domain(mem_type)))
>>> - list_add_tail(&bo_va->base.vm_status, &vm->evicted);
>>> - } else {
>>> - list_del_init(&bo_va->base.vm_status);
>>> - }
>>> + /* If the BO is not in its preferred location add it back to
>>> + * the evicted list so that it gets validated again on the
>>> + * next command submission.
>>> + */
>>> + mem_type = bo->tbo.mem.mem_type;
>>> + if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv &&
>>> + !(bo->preferred_domains &
>>> amdgpu_mem_type_to_domain(mem_type)))
>>
>> The indentation on the line above is wrong, the "!(bo..." should be
>> on the same
>> column as the "bo &&" above.
>
> Thanks to point that out.
>
> May I get your RB with that fix?
Yeah, sure patch is Reviewed-by: Christian König <christian.koenig@amd.com>.
Christian.
>
> Jerry
>
>>
>> Apart from that looks good to me,
>> Christian.
>>
>>> + list_add_tail(&bo_va->base.vm_status, &vm->evicted);
>>> spin_unlock(&vm->status_lock);
>>> list_splice_init(&bo_va->invalids, &bo_va->valids);
>>
> _______________________________________________
> 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] 5+ messages in thread
* Re: [PATCH v2] drm/amdgpu: simplify bo_va list when vm bo update (v2)
[not found] ` <c6e733bb-cc43-357a-f7b6-29e6cf394b01-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2018-04-19 7:46 ` Zhang, Jerry (Junwei)
0 siblings, 0 replies; 5+ messages in thread
From: Zhang, Jerry (Junwei) @ 2018-04-19 7:46 UTC (permalink / raw)
To: christian.koenig-5C7GfCeVMHo, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On 04/19/2018 03:42 PM, Christian König wrote:
> Am 19.04.2018 um 09:40 schrieb Zhang, Jerry (Junwei):
>>
>>
>> On 04/19/2018 03:06 PM, Christian König wrote:
>>> Am 19.04.2018 um 08:53 schrieb Junwei Zhang:
>>>> v2: fix compiling warning
>>>>
>>>> Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
>>>> ---
>>>> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 22 ++++++++++------------
>>>> 1 file changed, 10 insertions(+), 12 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>>>> index 8c34060..e3e0375 100644
>>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>>>> @@ -1509,6 +1509,7 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
>>>> struct drm_mm_node *nodes;
>>>> struct dma_fence *exclusive, **last_update;
>>>> uint64_t flags;
>>>> + uint32_t mem_type;
>>>> int r;
>>>> if (clear || !bo_va->base.bo) {
>>>> @@ -1561,19 +1562,16 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
>>>> }
>>>> spin_lock(&vm->status_lock);
>>>> - if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv) {
>>>> - unsigned mem_type = bo->tbo.mem.mem_type;
>>>> + list_del_init(&bo_va->base.vm_status);
>>>> - /* If the BO is not in its preferred location add it back to
>>>> - * the evicted list so that it gets validated again on the
>>>> - * next command submission.
>>>> - */
>>>> - list_del_init(&bo_va->base.vm_status);
>>>> - if (!(bo->preferred_domains & amdgpu_mem_type_to_domain(mem_type)))
>>>> - list_add_tail(&bo_va->base.vm_status, &vm->evicted);
>>>> - } else {
>>>> - list_del_init(&bo_va->base.vm_status);
>>>> - }
>>>> + /* If the BO is not in its preferred location add it back to
>>>> + * the evicted list so that it gets validated again on the
>>>> + * next command submission.
>>>> + */
>>>> + mem_type = bo->tbo.mem.mem_type;
>>>> + if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv &&
>>>> + !(bo->preferred_domains & amdgpu_mem_type_to_domain(mem_type)))
>>>
>>> The indentation on the line above is wrong, the "!(bo..." should be on the same
>>> column as the "bo &&" above.
>>
>> Thanks to point that out.
>>
>> May I get your RB with that fix?
>
> Yeah, sure patch is Reviewed-by: Christian König <christian.koenig@amd.com>.
Thanks, pushed.
Jerry
>
> Christian.
>
>>
>> Jerry
>>
>>>
>>> Apart from that looks good to me,
>>> Christian.
>>>
>>>> + list_add_tail(&bo_va->base.vm_status, &vm->evicted);
>>>> spin_unlock(&vm->status_lock);
>>>> list_splice_init(&bo_va->invalids, &bo_va->valids);
>>>
>> _______________________________________________
>> 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] 5+ messages in thread
end of thread, other threads:[~2018-04-19 7:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-19 6:53 [PATCH v2] drm/amdgpu: simplify bo_va list when vm bo update (v2) Junwei Zhang
[not found] ` <1524120806-22986-1-git-send-email-Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
2018-04-19 7:06 ` Christian König
[not found] ` <d18ea29d-4d53-0bad-aacd-3a839e016f80-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-04-19 7:40 ` Zhang, Jerry (Junwei)
[not found] ` <5AD847FE.9050607-5C7GfCeVMHo@public.gmane.org>
2018-04-19 7:42 ` Christian König
[not found] ` <c6e733bb-cc43-357a-f7b6-29e6cf394b01-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-04-19 7:46 ` 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.