drm7amdgpu: once more fix amdgpu_bo_create_kernel_at
Subsystems (2)
PATCH 1/1 drm7amdgpu: once more fix amdgpu_bo_create_kernel_at
When CPU access is needed we should tell that to amdgpu_bo_create_reserved() or otherwise the access is denied later on.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +6 -3
@@ -369,7 +369,7 @@ int amdgpu_bo_create_kernel_at(struct amdgpu_device *adev, size =ALIGN (size,PAGE_SIZE ); r =amdgpu_bo_create_reserved (adev, size,PAGE_SIZE , domain, bo_ptr, -NULL ,NULL ); +NULL , cpu_addr);if (r)return r;
@@ -377,12 +377,15 @@ int amdgpu_bo_create_kernel_at(struct amdgpu_device *adev,* Remove the original mem node and create a new one at the request * position. */ +if (cpu_addr) +amdgpu_bo_kunmap (*bo_ptr); + +ttm_bo_mem_put (&(*bo_ptr)->tbo, &(*bo_ptr)->tbo.mem); +for (i =0 ; i < (*bo_ptr)->placement.num_placement; ++i) { (*bo_ptr)->placements[i].fpfn = offset >>PAGE_SHIFT ; (*bo_ptr)->placements[i].lpfn = (offset + size) >>PAGE_SHIFT ; } - -ttm_bo_mem_put (&(*bo_ptr)->tbo, &(*bo_ptr)->tbo.mem); r =ttm_bo_mem_space (&(*bo_ptr)->tbo, &(*bo_ptr)->placement, &(*bo_ptr)->tbo.mem, &ctx);if (r)
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20190924115624.10949-1-christian.koenig-5C7GfCeVMHo@public.gmane.org
Alex Deucher
Reviewed-byQuoted 5 lines · Christian König
When CPU access is needed we should tell that to
amdgpu_bo_create_reserved()or otherwise the access is denied later on.Signed-off-by Christian König <[email protected]>
Quoted 38 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +6
-4@@ -369,7 +369,7 @@ int amdgpu_bo_create_kernel_at(struct amdgpu_device *adev, size =ALIGN (size,PAGE_SIZE ); r =amdgpu_bo_create_reserved (adev, size,PAGE_SIZE , domain, bo_ptr, -NULL ,NULL ); +NULL , cpu_addr);if (r)return r;@@ -377,12 +377,15 @@ int amdgpu_bo_create_kernel_at(struct amdgpu_device *adev,* Remove the original mem node and create a new one at the request * position. */ +if (cpu_addr) +amdgpu_bo_kunmap (*bo_ptr); + +ttm_bo_mem_put (&(*bo_ptr)->tbo, &(*bo_ptr)->tbo.mem); +for (i =0 ; i < (*bo_ptr)->placement.num_placement; ++i) { (*bo_ptr)->placements[i].fpfn = offset >>PAGE_SHIFT ; (*bo_ptr)->placements[i].lpfn = (offset + size) >>PAGE_SHIFT ; } - -ttm_bo_mem_put (&(*bo_ptr)->tbo, &(*bo_ptr)->tbo.mem); r =ttm_bo_mem_space (&(*bo_ptr)->tbo, &(*bo_ptr)->placement, &(*bo_ptr)->tbo.mem, &ctx);if (r) --2.14.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Deng, Emily
Reviewed-by Emily DengQuoted 50 lines
-----Original Message-----
From: Christian König <[email protected]>
Sent: Tuesday, September 24, 2019 7:56 PM
To: Deng, Emily <[email protected]>; [email protected]
Subject: [PATCH] drm7amdgpu: once more fixamdgpu_bo_create_kernel_atWhen CPU access is needed we should tell that to
amdgpu_bo_create_reserved()or otherwise the access is denied later on.Signed-off-by Christian König <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c| 9 ++++++---1 file changed, 6 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1
-1@@ -369,7 +369,7 @@ int amdgpu_bo_create_kernel_at(structamdgpu_device *adev, size =ALIGN (size,PAGE_SIZE ); r =amdgpu_bo_create_reserved (adev, size,PAGE_SIZE , domain, bo_ptr, -NULL ,NULL ); +NULL , cpu_addr);if (r)return r;drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +0
-0@@ -377,12 +377,15 @@ int amdgpu_bo_create_kernel_at(structamdgpu_device *adev, * Remove the original mem node and create a new one at therequest
* position. */drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +5
-0+if (cpu_addr) +amdgpu_bo_kunmap (*bo_ptr); + +ttm_bo_mem_put (&(*bo_ptr)->tbo, &(*bo_ptr)->tbo.mem); +for (i = 0; i < (*bo_ptr)->placement.num_placement; ++i) { (*bo_ptr)->placements[i].fpfn = offset >> PAGE_SHIFT; (*bo_ptr)->placements[i].lpfn = (offset + size) >> PAGE_SHIFT; }drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +0
-2- -ttm_bo_mem_put (&(*bo_ptr)->tbo, &(*bo_ptr)->tbo.mem);r = ttm_bo_mem_space(&(*bo_ptr)->tbo, &(*bo_ptr)->placement, &(*bo_ptr)->tbo.mem, &ctx); if (r)
Quoted 2 lines
--
2.14.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): MN2PR12MB29750C8C515A2924B3454E488F870-rweVpJHSKToFlvJWC7EAqwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Hi Emily,
have you also tested this? I don't have the hardware to test it so that would be rather nice to have.
Thanks,
Christian.
Am 25.09.19 um 11:31 schrieb Deng, Emily:
Quoted 46 lines
Reviewed-by Emily Deng <[email protected]>Quoted 44 lines
-----Original Message-----
From: Christian König <[email protected]>
Sent: Tuesday, September 24, 2019 7:56 PM
To: Deng, Emily <[email protected]>; [email protected]
Subject: [PATCH] drm7amdgpu: once more fixamdgpu_bo_create_kernel_atWhen CPU access is needed we should tell that to
amdgpu_bo_create_reserved()or otherwise the access is denied later on.Signed-off-by Christian König <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c| 9 ++++++---1 file changed, 6 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1
-1@@ -369,7 +369,7 @@ int amdgpu_bo_create_kernel_at(structamdgpu_device *adev, size =ALIGN (size,PAGE_SIZE ); r =amdgpu_bo_create_reserved (adev, size,PAGE_SIZE , domain, bo_ptr, -NULL ,NULL ); +NULL , cpu_addr);if (r)return r;drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +0
-0@@ -377,12 +377,15 @@ int amdgpu_bo_create_kernel_at(structamdgpu_device *adev, * Remove the original mem node and create a new one at therequest
* position. */drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +5
-0+if (cpu_addr) +amdgpu_bo_kunmap (*bo_ptr); + +ttm_bo_mem_put (&(*bo_ptr)->tbo, &(*bo_ptr)->tbo.mem); +for (i = 0; i < (*bo_ptr)->placement.num_placement; ++i) { (*bo_ptr)->placements[i].fpfn = offset >> PAGE_SHIFT; (*bo_ptr)->placements[i].lpfn = (offset + size) >> PAGE_SHIFT;
Quoted 8 lines
Quoted 8 lines
}drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +0
-2- -ttm_bo_mem_put (&(*bo_ptr)->tbo, &(*bo_ptr)->tbo.mem);r = ttm_bo_mem_space(&(*bo_ptr)->tbo, &(*bo_ptr)->placement, &(*bo_ptr)->tbo.mem, &ctx); if (r)--
2.14.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 05ae5f93-535b-96c9-9687-db9e8de456be-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Yes, I have already tested it.
Best wishes
Emily Deng
Quoted 63 lines
-----Original Message-----
From: Christian König <[email protected]>
Sent: Wednesday, September 25, 2019 5:36 PM
To: Deng, Emily <[email protected]>; [email protected]
Subject: Re: [PATCH] drm7amdgpu: once more fixamdgpu_bo_create_kernel_atHi Emily,
have you also tested this? I don't have the hardware to test it so that would be rather nice to have.
Thanks,
Christian.Am 25.09.19 um 11:31 schrieb Deng, Emily:
Quoted 7 lines
Reviewed-by Emily Deng <[email protected]>Quoted 5 lines
-----Original Message-----
From: Christian König <[email protected]>
Sent: Tuesday, September 24, 2019 7:56 PM
To: Deng, Emily <[email protected]>; [email protected]
Subject: [PATCH] drm7amdgpu: once more fix
amdgpu_bo_create_kernel_atQuoted 18 lines
Quoted 18 lines
When CPU access is needed we should tell that to
amdgpu_bo_create_reserved()or otherwise the access is denied later on.Signed-off-by Christian König <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c| 9 ++++++---1 file changed, 6 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +0
-0@@ -369,7 +369,7 @@ int amdgpu_bo_create_kernel_at(structamdgpu_device *adev, size =ALIGN (size,PAGE_SIZE );Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c int amdgpu_bo_create_kernel_at(struct · line 372
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +0
-0r = amdgpu_bo_create_reserved(adev, size, PAGE_SIZE, domain,
bo_ptr,Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c int amdgpu_bo_create_kernel_at(struct · line 378
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +1
-1- NULL, NULL); + NULL, cpu_addr);if (r)return r;@@ -377,12 +377,15 @@ int amdgpu_bo_create_kernel_at(structamdgpu_device *adev, * Remove the original mem node and create a new one at therequest
Quoted 10 lines
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +5
-0* position. */ +if (cpu_addr) +amdgpu_bo_kunmap (*bo_ptr); + +ttm_bo_mem_put (&(*bo_ptr)->tbo, &(*bo_ptr)->tbo.mem); +for (i =0 ; i < (*bo_ptr)->placement.num_placement; ++i) { (*bo_ptr)->placements[i].fpfn = offset >>PAGE_SHIFT ; (*bo_ptr)->placements[i].lpfn = (offset + size) >>PAGE_SHIFT ;
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +0
-2} - -ttm_bo_mem_put (&(*bo_ptr)->tbo, &(*bo_ptr)->tbo.mem); r =ttm_bo_mem_space (&(*bo_ptr)->tbo, &(*bo_ptr)->placement, &(*bo_ptr)->tbo.mem, &ctx);if (r)--
2.14.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx