* [PATCH libdrm 0/3] some -pro patches for integration
@ 2017-01-28 19:49 Grazvydas Ignotas
2017-01-28 19:49 ` [PATCH libdrm 1/3] amdgpu: Free/uninit vamgr_32 in theoretically correct order Grazvydas Ignotas
[not found] ` <1485632972-4790-1-git-send-email-notasas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 2 replies; 6+ messages in thread
From: Grazvydas Ignotas @ 2017-01-28 19:49 UTC (permalink / raw)
To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Alex Xie
I've taken several patches from amdgpu-pro libdrm that look useful
to me and I think can be applied already. The only things I did was
rebasing, fixing some typos and dropping Change-Id.
Alex Xie (3):
amdgpu: Free/uninit vamgr_32 in theoretically correct order
amdgpu: vamgr can be a struct instead of a pointer
amdgpu: vamgr_32 can be a struct instead of a pointer
amdgpu/amdgpu_device.c | 24 +++++++-----------------
amdgpu/amdgpu_internal.h | 4 ++--
amdgpu/amdgpu_vamgr.c | 6 +++---
3 files changed, 12 insertions(+), 22 deletions(-)
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH libdrm 1/3] amdgpu: Free/uninit vamgr_32 in theoretically correct order
2017-01-28 19:49 [PATCH libdrm 0/3] some -pro patches for integration Grazvydas Ignotas
@ 2017-01-28 19:49 ` Grazvydas Ignotas
[not found] ` <1485632972-4790-1-git-send-email-notasas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
1 sibling, 0 replies; 6+ messages in thread
From: Grazvydas Ignotas @ 2017-01-28 19:49 UTC (permalink / raw)
To: dri-devel; +Cc: amd-gfx, Alex Xie
From: Alex Xie <AlexBin.Xie@amd.com>
vamgr_32 is a region inside general VAM range. It is better to free and
deinitialize it before general VAM range.
Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
---
amdgpu/amdgpu_device.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/amdgpu/amdgpu_device.c b/amdgpu/amdgpu_device.c
index f4ede03..cad7133 100644
--- a/amdgpu/amdgpu_device.c
+++ b/amdgpu/amdgpu_device.c
@@ -131,10 +131,10 @@ static int amdgpu_get_auth(int fd, int *auth)
static void amdgpu_device_free_internal(amdgpu_device_handle dev)
{
- amdgpu_vamgr_deinit(dev->vamgr);
- free(dev->vamgr);
amdgpu_vamgr_deinit(dev->vamgr_32);
free(dev->vamgr_32);
+ amdgpu_vamgr_deinit(dev->vamgr);
+ free(dev->vamgr);
util_hash_table_destroy(dev->bo_flink_names);
util_hash_table_destroy(dev->bo_handles);
pthread_mutex_destroy(&dev->bo_table_mutex);
--
2.7.4
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH libdrm 2/3] amdgpu: vamgr_32 can be a struct instead of a pointer
[not found] ` <1485632972-4790-1-git-send-email-notasas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-01-28 19:49 ` Grazvydas Ignotas
2017-01-29 22:51 ` [PATCH libdrm 0/3] some -pro patches for integration Edward O'Callaghan
2017-02-01 12:50 ` Emil Velikov
2 siblings, 0 replies; 6+ messages in thread
From: Grazvydas Ignotas @ 2017-01-28 19:49 UTC (permalink / raw)
To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Alex Xie
From: Alex Xie <AlexBin.Xie@amd.com>
vamgr_32 is an integral part of amdgpu_device. We don't need to calloc and free it.
This can save CPU time, reduce heap fragmentation.
Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
[Grazvydas Ignotas: rebase, correct a typo in commit message]
---
amdgpu/amdgpu_device.c | 8 ++------
amdgpu/amdgpu_internal.h | 2 +-
amdgpu/amdgpu_vamgr.c | 4 ++--
3 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/amdgpu/amdgpu_device.c b/amdgpu/amdgpu_device.c
index cad7133..11714e4 100644
--- a/amdgpu/amdgpu_device.c
+++ b/amdgpu/amdgpu_device.c
@@ -131,8 +131,7 @@ static int amdgpu_get_auth(int fd, int *auth)
static void amdgpu_device_free_internal(amdgpu_device_handle dev)
{
- amdgpu_vamgr_deinit(dev->vamgr_32);
- free(dev->vamgr_32);
+ amdgpu_vamgr_deinit(&dev->vamgr_32);
amdgpu_vamgr_deinit(dev->vamgr);
free(dev->vamgr);
util_hash_table_destroy(dev->bo_flink_names);
@@ -270,10 +269,7 @@ int amdgpu_device_initialize(int fd,
if (start > 0xffffffff)
goto free_va; /* shouldn't get here */
- dev->vamgr_32 = calloc(1, sizeof(struct amdgpu_bo_va_mgr));
- if (dev->vamgr_32 == NULL)
- goto free_va;
- amdgpu_vamgr_init(dev->vamgr_32, start, max,
+ amdgpu_vamgr_init(&dev->vamgr_32, start, max,
dev->dev_info.virtual_address_alignment);
*major_version = dev->major_version;
diff --git a/amdgpu/amdgpu_internal.h b/amdgpu/amdgpu_internal.h
index 4f039b6..7e237ac 100644
--- a/amdgpu/amdgpu_internal.h
+++ b/amdgpu/amdgpu_internal.h
@@ -87,7 +87,7 @@ struct amdgpu_device {
/** The global VA manager for the whole virtual address space */
struct amdgpu_bo_va_mgr *vamgr;
/** The VA manager for the 32bit address space */
- struct amdgpu_bo_va_mgr *vamgr_32;
+ struct amdgpu_bo_va_mgr vamgr_32;
};
struct amdgpu_bo {
diff --git a/amdgpu/amdgpu_vamgr.c b/amdgpu/amdgpu_vamgr.c
index 8a707cb..4dc4253 100644
--- a/amdgpu/amdgpu_vamgr.c
+++ b/amdgpu/amdgpu_vamgr.c
@@ -236,7 +236,7 @@ int amdgpu_va_range_alloc(amdgpu_device_handle dev,
struct amdgpu_bo_va_mgr *vamgr;
if (flags & AMDGPU_VA_RANGE_32_BIT)
- vamgr = dev->vamgr_32;
+ vamgr = &dev->vamgr_32;
else
vamgr = dev->vamgr;
@@ -249,7 +249,7 @@ int amdgpu_va_range_alloc(amdgpu_device_handle dev,
if (!(flags & AMDGPU_VA_RANGE_32_BIT) &&
(*va_base_allocated == AMDGPU_INVALID_VA_ADDRESS)) {
/* fallback to 32bit address */
- vamgr = dev->vamgr_32;
+ vamgr = &dev->vamgr_32;
*va_base_allocated = amdgpu_vamgr_find_va(vamgr, size,
va_base_alignment, va_base_required);
}
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH libdrm 0/3] some -pro patches for integration
[not found] ` <1485632972-4790-1-git-send-email-notasas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-01-28 19:49 ` [PATCH libdrm 2/3] amdgpu: vamgr_32 can be a struct instead of a pointer Grazvydas Ignotas
@ 2017-01-29 22:51 ` Edward O'Callaghan
[not found] ` <d25c24a2-e1d1-f8a8-f4e7-e91948f81e01-dczkZgxz+BNUPWh3PAxdjQ@public.gmane.org>
2017-02-01 12:50 ` Emil Velikov
2 siblings, 1 reply; 6+ messages in thread
From: Edward O'Callaghan @ 2017-01-29 22:51 UTC (permalink / raw)
To: Grazvydas Ignotas, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Alex Xie
[-- Attachment #1.1.1: Type: text/plain, Size: 756 bytes --]
This series is,
Reviewed-by: Edward O'Callaghan <funfunctor-dczkZgxz+BNUPWh3PAxdjQ@public.gmane.org>
On 01/29/2017 06:49 AM, Grazvydas Ignotas wrote:
> I've taken several patches from amdgpu-pro libdrm that look useful
> to me and I think can be applied already. The only things I did was
> rebasing, fixing some typos and dropping Change-Id.
>
> Alex Xie (3):
> amdgpu: Free/uninit vamgr_32 in theoretically correct order
> amdgpu: vamgr can be a struct instead of a pointer
> amdgpu: vamgr_32 can be a struct instead of a pointer
>
> amdgpu/amdgpu_device.c | 24 +++++++-----------------
> amdgpu/amdgpu_internal.h | 4 ++--
> amdgpu/amdgpu_vamgr.c | 6 +++---
> 3 files changed, 12 insertions(+), 22 deletions(-)
>
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH libdrm 0/3] some -pro patches for integration
[not found] ` <d25c24a2-e1d1-f8a8-f4e7-e91948f81e01-dczkZgxz+BNUPWh3PAxdjQ@public.gmane.org>
@ 2017-01-30 8:38 ` Christian König
0 siblings, 0 replies; 6+ messages in thread
From: Christian König @ 2017-01-30 8:38 UTC (permalink / raw)
To: Edward O'Callaghan, Grazvydas Ignotas,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Alex Xie
[-- Attachment #1.1: Type: text/plain, Size: 1088 bytes --]
Reviewed-by: Christian König <christian.koenig-5C7GfCeVMHo@public.gmane.org>.
Am 29.01.2017 um 23:51 schrieb Edward O'Callaghan:
> This series is,
> Reviewed-by: Edward O'Callaghan <funfunctor-dczkZgxz+BNUPWh3PAxdjQ@public.gmane.org>
>
> On 01/29/2017 06:49 AM, Grazvydas Ignotas wrote:
>> I've taken several patches from amdgpu-pro libdrm that look useful
>> to me and I think can be applied already. The only things I did was
>> rebasing, fixing some typos and dropping Change-Id.
>>
>> Alex Xie (3):
>> amdgpu: Free/uninit vamgr_32 in theoretically correct order
>> amdgpu: vamgr can be a struct instead of a pointer
>> amdgpu: vamgr_32 can be a struct instead of a pointer
>>
>> amdgpu/amdgpu_device.c | 24 +++++++-----------------
>> amdgpu/amdgpu_internal.h | 4 ++--
>> amdgpu/amdgpu_vamgr.c | 6 +++---
>> 3 files changed, 12 insertions(+), 22 deletions(-)
>>
>
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[-- Attachment #1.2: Type: text/html, Size: 2080 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH libdrm 0/3] some -pro patches for integration
[not found] ` <1485632972-4790-1-git-send-email-notasas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-01-28 19:49 ` [PATCH libdrm 2/3] amdgpu: vamgr_32 can be a struct instead of a pointer Grazvydas Ignotas
2017-01-29 22:51 ` [PATCH libdrm 0/3] some -pro patches for integration Edward O'Callaghan
@ 2017-02-01 12:50 ` Emil Velikov
2 siblings, 0 replies; 6+ messages in thread
From: Emil Velikov @ 2017-02-01 12:50 UTC (permalink / raw)
To: Grazvydas Ignotas; +Cc: amd-gfx mailing list, ML dri-devel, Alex Xie
On 28 January 2017 at 19:49, Grazvydas Ignotas <notasas@gmail.com> wrote:
> I've taken several patches from amdgpu-pro libdrm that look useful
> to me and I think can be applied already. The only things I did was
> rebasing, fixing some typos and dropping Change-Id.
>
> Alex Xie (3):
> amdgpu: Free/uninit vamgr_32 in theoretically correct order
> amdgpu: vamgr can be a struct instead of a pointer
> amdgpu: vamgr_32 can be a struct instead of a pointer
>
Nice cleanups/fixes indeed.
Fwiw
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Unless someone beats me to it I'll collect all the tags and push these
over the weekend.
Emil
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-02-01 12:50 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-28 19:49 [PATCH libdrm 0/3] some -pro patches for integration Grazvydas Ignotas
2017-01-28 19:49 ` [PATCH libdrm 1/3] amdgpu: Free/uninit vamgr_32 in theoretically correct order Grazvydas Ignotas
[not found] ` <1485632972-4790-1-git-send-email-notasas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-01-28 19:49 ` [PATCH libdrm 2/3] amdgpu: vamgr_32 can be a struct instead of a pointer Grazvydas Ignotas
2017-01-29 22:51 ` [PATCH libdrm 0/3] some -pro patches for integration Edward O'Callaghan
[not found] ` <d25c24a2-e1d1-f8a8-f4e7-e91948f81e01-dczkZgxz+BNUPWh3PAxdjQ@public.gmane.org>
2017-01-30 8:38 ` Christian König
2017-02-01 12:50 ` Emil Velikov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).