* [PATCH] drm/amdgpu: To get gds, gws and oa from adev->gds
@ 2018-05-29 9:17 Emily Deng
[not found] ` <1527585469-4424-1-git-send-email-Emily.Deng-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Emily Deng @ 2018-05-29 9:17 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Emily Deng
As now enabled per vm bo feature, the user mode driver won't supply the
bo_list generally, for this case, the gdb_base, gds_size, gws_base, gws_size and
oa_base, oa_size won't be set.
Signed-off-by: Emily Deng <Emily.Deng@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 38 ++++++++++++++++++++--------------
1 file changed, 23 insertions(+), 15 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index d296c95..ff94435 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -546,6 +546,9 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
struct amdgpu_bo_list_entry *e;
struct list_head duplicates;
unsigned i, tries = 10;
+ struct amdgpu_bo *gds;
+ struct amdgpu_bo *gws;
+ struct amdgpu_bo *oa;
int r;
INIT_LIST_HEAD(&p->validated);
@@ -698,10 +701,11 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
amdgpu_cs_report_moved_bytes(p->adev, p->bytes_moved,
p->bytes_moved_vis);
+
if (p->bo_list) {
- struct amdgpu_bo *gds = p->bo_list->gds_obj;
- struct amdgpu_bo *gws = p->bo_list->gws_obj;
- struct amdgpu_bo *oa = p->bo_list->oa_obj;
+ gds = p->bo_list->gds_obj;
+ gws = p->bo_list->gws_obj;
+ oa = p->bo_list->oa_obj;
struct amdgpu_vm *vm = &fpriv->vm;
unsigned i;
@@ -710,19 +714,23 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
p->bo_list->array[i].bo_va = amdgpu_vm_bo_find(vm, bo);
}
+ } else {
+ gds = p->adev->gds.gds_gfx_bo;
+ gws = p->adev->gds.gws_gfx_bo;
+ oa = p->adev->gds.oa_gfx_bo;
+ }
- if (gds) {
- p->job->gds_base = amdgpu_bo_gpu_offset(gds);
- p->job->gds_size = amdgpu_bo_size(gds);
- }
- if (gws) {
- p->job->gws_base = amdgpu_bo_gpu_offset(gws);
- p->job->gws_size = amdgpu_bo_size(gws);
- }
- if (oa) {
- p->job->oa_base = amdgpu_bo_gpu_offset(oa);
- p->job->oa_size = amdgpu_bo_size(oa);
- }
+ if (gds) {
+ p->job->gds_base = amdgpu_bo_gpu_offset(gds);
+ p->job->gds_size = amdgpu_bo_size(gds);
+ }
+ if (gws) {
+ p->job->gws_base = amdgpu_bo_gpu_offset(gws);
+ p->job->gws_size = amdgpu_bo_size(gws);
+ }
+ if (oa) {
+ p->job->oa_base = amdgpu_bo_gpu_offset(oa);
+ p->job->oa_size = amdgpu_bo_size(oa);
}
if (!r && p->uf_entry.robj) {
--
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] 10+ messages in thread
* Re: [PATCH] drm/amdgpu: To get gds, gws and oa from adev->gds
[not found] ` <1527585469-4424-1-git-send-email-Emily.Deng-5C7GfCeVMHo@public.gmane.org>
@ 2018-05-29 11:22 ` zhoucm1
[not found] ` <90460b27-2c68-ad86-c222-161757e00722-5C7GfCeVMHo@public.gmane.org>
2018-05-29 11:46 ` Christian König
1 sibling, 1 reply; 10+ messages in thread
From: zhoucm1 @ 2018-05-29 11:22 UTC (permalink / raw)
To: Emily Deng, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On 2018年05月29日 17:17, Emily Deng wrote:
> As now enabled per vm bo feature, the user mode driver won't supply the
> bo_list generally, for this case, the gdb_base, gds_size, gws_base, gws_size and
> oa_base, oa_size won't be set.
>
> Signed-off-by: Emily Deng <Emily.Deng@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 38 ++++++++++++++++++++--------------
> 1 file changed, 23 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index d296c95..ff94435 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -546,6 +546,9 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
> struct amdgpu_bo_list_entry *e;
> struct list_head duplicates;
> unsigned i, tries = 10;
> + struct amdgpu_bo *gds;
> + struct amdgpu_bo *gws;
> + struct amdgpu_bo *oa;
> int r;
>
> INIT_LIST_HEAD(&p->validated);
> @@ -698,10 +701,11 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
>
> amdgpu_cs_report_moved_bytes(p->adev, p->bytes_moved,
> p->bytes_moved_vis);
> +
> if (p->bo_list) {
> - struct amdgpu_bo *gds = p->bo_list->gds_obj;
> - struct amdgpu_bo *gws = p->bo_list->gws_obj;
> - struct amdgpu_bo *oa = p->bo_list->oa_obj;
> + gds = p->bo_list->gds_obj;
> + gws = p->bo_list->gws_obj;
> + oa = p->bo_list->oa_obj;
out of curious, why not directly use p->adev->gds however per-vm-bo is
enabled?
Regards,
David Zhou
> struct amdgpu_vm *vm = &fpriv->vm;
> unsigned i;
>
> @@ -710,19 +714,23 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
>
> p->bo_list->array[i].bo_va = amdgpu_vm_bo_find(vm, bo);
> }
> + } else {
> + gds = p->adev->gds.gds_gfx_bo;
> + gws = p->adev->gds.gws_gfx_bo;
> + oa = p->adev->gds.oa_gfx_bo;
> + }
>
> - if (gds) {
> - p->job->gds_base = amdgpu_bo_gpu_offset(gds);
> - p->job->gds_size = amdgpu_bo_size(gds);
> - }
> - if (gws) {
> - p->job->gws_base = amdgpu_bo_gpu_offset(gws);
> - p->job->gws_size = amdgpu_bo_size(gws);
> - }
> - if (oa) {
> - p->job->oa_base = amdgpu_bo_gpu_offset(oa);
> - p->job->oa_size = amdgpu_bo_size(oa);
> - }
> + if (gds) {
> + p->job->gds_base = amdgpu_bo_gpu_offset(gds);
> + p->job->gds_size = amdgpu_bo_size(gds);
> + }
> + if (gws) {
> + p->job->gws_base = amdgpu_bo_gpu_offset(gws);
> + p->job->gws_size = amdgpu_bo_size(gws);
> + }
> + if (oa) {
> + p->job->oa_base = amdgpu_bo_gpu_offset(oa);
> + p->job->oa_size = amdgpu_bo_size(oa);
> }
>
> if (!r && p->uf_entry.robj) {
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] drm/amdgpu: To get gds, gws and oa from adev->gds
[not found] ` <1527585469-4424-1-git-send-email-Emily.Deng-5C7GfCeVMHo@public.gmane.org>
2018-05-29 11:22 ` zhoucm1
@ 2018-05-29 11:46 ` Christian König
1 sibling, 0 replies; 10+ messages in thread
From: Christian König @ 2018-05-29 11:46 UTC (permalink / raw)
To: Emily Deng, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Am 29.05.2018 um 11:17 schrieb Emily Deng:
> As now enabled per vm bo feature, the user mode driver won't supply the
> bo_list generally, for this case, the gdb_base, gds_size, gws_base, gws_size and
> oa_base, oa_size won't be set.
>
> Signed-off-by: Emily Deng <Emily.Deng@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 38 ++++++++++++++++++++--------------
> 1 file changed, 23 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index d296c95..ff94435 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -546,6 +546,9 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
> struct amdgpu_bo_list_entry *e;
> struct list_head duplicates;
> unsigned i, tries = 10;
> + struct amdgpu_bo *gds;
> + struct amdgpu_bo *gws;
> + struct amdgpu_bo *oa;
> int r;
>
> INIT_LIST_HEAD(&p->validated);
> @@ -698,10 +701,11 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
>
> amdgpu_cs_report_moved_bytes(p->adev, p->bytes_moved,
> p->bytes_moved_vis);
> +
> if (p->bo_list) {
> - struct amdgpu_bo *gds = p->bo_list->gds_obj;
> - struct amdgpu_bo *gws = p->bo_list->gws_obj;
> - struct amdgpu_bo *oa = p->bo_list->oa_obj;
> + gds = p->bo_list->gds_obj;
> + gws = p->bo_list->gws_obj;
> + oa = p->bo_list->oa_obj;
> struct amdgpu_vm *vm = &fpriv->vm;
> unsigned i;
>
> @@ -710,19 +714,23 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
>
> p->bo_list->array[i].bo_va = amdgpu_vm_bo_find(vm, bo);
> }
> + } else {
> + gds = p->adev->gds.gds_gfx_bo;
> + gws = p->adev->gds.gws_gfx_bo;
> + oa = p->adev->gds.oa_gfx_bo;
> + }
>
> - if (gds) {
> - p->job->gds_base = amdgpu_bo_gpu_offset(gds);
> - p->job->gds_size = amdgpu_bo_size(gds);
> - }
> - if (gws) {
> - p->job->gws_base = amdgpu_bo_gpu_offset(gws);
> - p->job->gws_size = amdgpu_bo_size(gws);
> - }
> - if (oa) {
> - p->job->oa_base = amdgpu_bo_gpu_offset(oa);
> - p->job->oa_size = amdgpu_bo_size(oa);
> - }
> + if (gds) {
> + p->job->gds_base = amdgpu_bo_gpu_offset(gds);
> + p->job->gds_size = amdgpu_bo_size(gds);
> + }
> + if (gws) {
> + p->job->gws_base = amdgpu_bo_gpu_offset(gws);
> + p->job->gws_size = amdgpu_bo_size(gws);
> + }
> + if (oa) {
> + p->job->oa_base = amdgpu_bo_gpu_offset(oa);
> + p->job->oa_size = amdgpu_bo_size(oa);
> }
>
> if (!r && p->uf_entry.robj) {
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [PATCH] drm/amdgpu: To get gds, gws and oa from adev->gds
[not found] ` <90460b27-2c68-ad86-c222-161757e00722-5C7GfCeVMHo@public.gmane.org>
@ 2018-05-30 3:27 ` Deng, Emily
[not found] ` <CY4PR12MB11252A3AA9A13B43B51303348F6C0-rpdhrqHFk07v2MZdTKcfDgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Deng, Emily @ 2018-05-30 3:27 UTC (permalink / raw)
To: Zhou, David(ChunMing), amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Hi David,
For the use case that the user mode creates the gds, gws, and oa buffer object itself, it need to pass bo_list to kernel driver, and we need
to get those objects from bo_list.
Best Wishes,
Emily Deng
> -----Original Message-----
> From: Zhou, David(ChunMing)
> Sent: Tuesday, May 29, 2018 7:23 PM
> To: Deng, Emily <Emily.Deng@amd.com>; amd-gfx@lists.freedesktop.org
> Subject: Re: [PATCH] drm/amdgpu: To get gds, gws and oa from adev->gds
>
>
>
> On 2018年05月29日 17:17, Emily Deng wrote:
> > As now enabled per vm bo feature, the user mode driver won't supply
> > the bo_list generally, for this case, the gdb_base, gds_size,
> > gws_base, gws_size and oa_base, oa_size won't be set.
> >
> > Signed-off-by: Emily Deng <Emily.Deng@amd.com>
> > ---
> > drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 38
> ++++++++++++++++++++--------------
> > 1 file changed, 23 insertions(+), 15 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> > index d296c95..ff94435 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> > @@ -546,6 +546,9 @@ static int amdgpu_cs_parser_bos(struct
> amdgpu_cs_parser *p,
> > struct amdgpu_bo_list_entry *e;
> > struct list_head duplicates;
> > unsigned i, tries = 10;
> > + struct amdgpu_bo *gds;
> > + struct amdgpu_bo *gws;
> > + struct amdgpu_bo *oa;
> > int r;
> >
> > INIT_LIST_HEAD(&p->validated);
> > @@ -698,10 +701,11 @@ static int amdgpu_cs_parser_bos(struct
> > amdgpu_cs_parser *p,
> >
> > amdgpu_cs_report_moved_bytes(p->adev, p->bytes_moved,
> > p->bytes_moved_vis);
> > +
> > if (p->bo_list) {
> > - struct amdgpu_bo *gds = p->bo_list->gds_obj;
> > - struct amdgpu_bo *gws = p->bo_list->gws_obj;
> > - struct amdgpu_bo *oa = p->bo_list->oa_obj;
> > + gds = p->bo_list->gds_obj;
> > + gws = p->bo_list->gws_obj;
> > + oa = p->bo_list->oa_obj;
> out of curious, why not directly use p->adev->gds however per-vm-bo is
> enabled?
>
> Regards,
> David Zhou
> > struct amdgpu_vm *vm = &fpriv->vm;
> > unsigned i;
> >
> > @@ -710,19 +714,23 @@ static int amdgpu_cs_parser_bos(struct
> > amdgpu_cs_parser *p,
> >
> > p->bo_list->array[i].bo_va =
> amdgpu_vm_bo_find(vm, bo);
> > }
> > + } else {
> > + gds = p->adev->gds.gds_gfx_bo;
> > + gws = p->adev->gds.gws_gfx_bo;
> > + oa = p->adev->gds.oa_gfx_bo;
> > + }
> >
> > - if (gds) {
> > - p->job->gds_base = amdgpu_bo_gpu_offset(gds);
> > - p->job->gds_size = amdgpu_bo_size(gds);
> > - }
> > - if (gws) {
> > - p->job->gws_base = amdgpu_bo_gpu_offset(gws);
> > - p->job->gws_size = amdgpu_bo_size(gws);
> > - }
> > - if (oa) {
> > - p->job->oa_base = amdgpu_bo_gpu_offset(oa);
> > - p->job->oa_size = amdgpu_bo_size(oa);
> > - }
> > + if (gds) {
> > + p->job->gds_base = amdgpu_bo_gpu_offset(gds);
> > + p->job->gds_size = amdgpu_bo_size(gds);
> > + }
> > + if (gws) {
> > + p->job->gws_base = amdgpu_bo_gpu_offset(gws);
> > + p->job->gws_size = amdgpu_bo_size(gws);
> > + }
> > + if (oa) {
> > + p->job->oa_base = amdgpu_bo_gpu_offset(oa);
> > + p->job->oa_size = amdgpu_bo_size(oa);
> > }
> >
> > if (!r && p->uf_entry.robj) {
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] drm/amdgpu: To get gds, gws and oa from adev->gds
[not found] ` <CY4PR12MB11252A3AA9A13B43B51303348F6C0-rpdhrqHFk07v2MZdTKcfDgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2018-05-30 3:36 ` zhoucm1
[not found] ` <ecf1e921-974f-6467-cf9f-4e9e49645aa9-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: zhoucm1 @ 2018-05-30 3:36 UTC (permalink / raw)
To: Deng, Emily, Zhou, David(ChunMing),
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Yes, but how to make sure there is bo list if all BOs are per-vm-bo?
Maybe we say we should give this rule to UMD, but who can make sure it?
we can imagine a situation when UMD forgot this rule, they create gds bo
with per-vm-bo, there is no bo list for CS, then our kernel give a
kernel gds as backup, everything runs ok, but UMD never get right
result, it will be very difficult to debug, right?
That is why I created patch #2 to make sure gds BOs created from user
space are in bo list.
Regards,
David Zhou
On 2018年05月30日 11:27, Deng, Emily wrote:
> Hi David,
> For the use case that the user mode creates the gds, gws, and oa buffer object itself, it need to pass bo_list to kernel driver, and we need
> to get those objects from bo_list.
>
> Best Wishes,
> Emily Deng
>
>> -----Original Message-----
>> From: Zhou, David(ChunMing)
>> Sent: Tuesday, May 29, 2018 7:23 PM
>> To: Deng, Emily <Emily.Deng@amd.com>; amd-gfx@lists.freedesktop.org
>> Subject: Re: [PATCH] drm/amdgpu: To get gds, gws and oa from adev->gds
>>
>>
>>
>> On 2018年05月29日 17:17, Emily Deng wrote:
>>> As now enabled per vm bo feature, the user mode driver won't supply
>>> the bo_list generally, for this case, the gdb_base, gds_size,
>>> gws_base, gws_size and oa_base, oa_size won't be set.
>>>
>>> Signed-off-by: Emily Deng <Emily.Deng@amd.com>
>>> ---
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 38
>> ++++++++++++++++++++--------------
>>> 1 file changed, 23 insertions(+), 15 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>>> index d296c95..ff94435 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>>> @@ -546,6 +546,9 @@ static int amdgpu_cs_parser_bos(struct
>> amdgpu_cs_parser *p,
>>> struct amdgpu_bo_list_entry *e;
>>> struct list_head duplicates;
>>> unsigned i, tries = 10;
>>> + struct amdgpu_bo *gds;
>>> + struct amdgpu_bo *gws;
>>> + struct amdgpu_bo *oa;
>>> int r;
>>>
>>> INIT_LIST_HEAD(&p->validated);
>>> @@ -698,10 +701,11 @@ static int amdgpu_cs_parser_bos(struct
>>> amdgpu_cs_parser *p,
>>>
>>> amdgpu_cs_report_moved_bytes(p->adev, p->bytes_moved,
>>> p->bytes_moved_vis);
>>> +
>>> if (p->bo_list) {
>>> - struct amdgpu_bo *gds = p->bo_list->gds_obj;
>>> - struct amdgpu_bo *gws = p->bo_list->gws_obj;
>>> - struct amdgpu_bo *oa = p->bo_list->oa_obj;
>>> + gds = p->bo_list->gds_obj;
>>> + gws = p->bo_list->gws_obj;
>>> + oa = p->bo_list->oa_obj;
>> out of curious, why not directly use p->adev->gds however per-vm-bo is
>> enabled?
>>
>> Regards,
>> David Zhou
>>> struct amdgpu_vm *vm = &fpriv->vm;
>>> unsigned i;
>>>
>>> @@ -710,19 +714,23 @@ static int amdgpu_cs_parser_bos(struct
>>> amdgpu_cs_parser *p,
>>>
>>> p->bo_list->array[i].bo_va =
>> amdgpu_vm_bo_find(vm, bo);
>>> }
>>> + } else {
>>> + gds = p->adev->gds.gds_gfx_bo;
>>> + gws = p->adev->gds.gws_gfx_bo;
>>> + oa = p->adev->gds.oa_gfx_bo;
>>> + }
>>>
>>> - if (gds) {
>>> - p->job->gds_base = amdgpu_bo_gpu_offset(gds);
>>> - p->job->gds_size = amdgpu_bo_size(gds);
>>> - }
>>> - if (gws) {
>>> - p->job->gws_base = amdgpu_bo_gpu_offset(gws);
>>> - p->job->gws_size = amdgpu_bo_size(gws);
>>> - }
>>> - if (oa) {
>>> - p->job->oa_base = amdgpu_bo_gpu_offset(oa);
>>> - p->job->oa_size = amdgpu_bo_size(oa);
>>> - }
>>> + if (gds) {
>>> + p->job->gds_base = amdgpu_bo_gpu_offset(gds);
>>> + p->job->gds_size = amdgpu_bo_size(gds);
>>> + }
>>> + if (gws) {
>>> + p->job->gws_base = amdgpu_bo_gpu_offset(gws);
>>> + p->job->gws_size = amdgpu_bo_size(gws);
>>> + }
>>> + if (oa) {
>>> + p->job->oa_base = amdgpu_bo_gpu_offset(oa);
>>> + p->job->oa_size = amdgpu_bo_size(oa);
>>> }
>>>
>>> if (!r && p->uf_entry.robj) {
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [PATCH] drm/amdgpu: To get gds, gws and oa from adev->gds
[not found] ` <ecf1e921-974f-6467-cf9f-4e9e49645aa9-5C7GfCeVMHo@public.gmane.org>
@ 2018-05-30 3:47 ` Deng, Emily
[not found] ` <CY4PR12MB112565DE0D70E13277DBB2B68F6C0-rpdhrqHFk07v2MZdTKcfDgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Deng, Emily @ 2018-05-30 3:47 UTC (permalink / raw)
To: Zhou, David(ChunMing)
Yes, I think we should add this rule to tell user mode driver, just like they will pass bo_list if they share bo with others.
Best Wishes,
Emily Deng
> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf
> Of zhoucm1
> Sent: Wednesday, May 30, 2018 11:36 AM
> To: Deng, Emily <Emily.Deng@amd.com>; Zhou, David(ChunMing)
> <David1.Zhou@amd.com>; amd-gfx@lists.freedesktop.org
> Subject: Re: [PATCH] drm/amdgpu: To get gds, gws and oa from adev->gds
>
> Yes, but how to make sure there is bo list if all BOs are per-vm-bo?
> Maybe we say we should give this rule to UMD, but who can make sure it?
> we can imagine a situation when UMD forgot this rule, they create gds bo
> with per-vm-bo, there is no bo list for CS, then our kernel give a kernel gds as
> backup, everything runs ok, but UMD never get right result, it will be very
> difficult to debug, right?
>
> That is why I created patch #2 to make sure gds BOs created from user space
> are in bo list.
>
>
> Regards,
> David Zhou
> On 2018年05月30日 11:27, Deng, Emily wrote:
> > Hi David,
> > For the use case that the user mode creates the gds, gws, and oa buffer
> object itself, it need to pass bo_list to kernel driver, and we need
> > to get those objects from bo_list.
> >
> > Best Wishes,
> > Emily Deng
> >
> >> -----Original Message-----
> >> From: Zhou, David(ChunMing)
> >> Sent: Tuesday, May 29, 2018 7:23 PM
> >> To: Deng, Emily <Emily.Deng@amd.com>; amd-gfx@lists.freedesktop.org
> >> Subject: Re: [PATCH] drm/amdgpu: To get gds, gws and oa from adev-
> >gds
> >>
> >>
> >>
> >> On 2018年05月29日 17:17, Emily Deng wrote:
> >>> As now enabled per vm bo feature, the user mode driver won't supply
> >>> the bo_list generally, for this case, the gdb_base, gds_size,
> >>> gws_base, gws_size and oa_base, oa_size won't be set.
> >>>
> >>> Signed-off-by: Emily Deng <Emily.Deng@amd.com>
> >>> ---
> >>> drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 38
> >> ++++++++++++++++++++--------------
> >>> 1 file changed, 23 insertions(+), 15 deletions(-)
> >>>
> >>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> >>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> >>> index d296c95..ff94435 100644
> >>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> >>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> >>> @@ -546,6 +546,9 @@ static int amdgpu_cs_parser_bos(struct
> >> amdgpu_cs_parser *p,
> >>> struct amdgpu_bo_list_entry *e;
> >>> struct list_head duplicates;
> >>> unsigned i, tries = 10;
> >>> + struct amdgpu_bo *gds;
> >>> + struct amdgpu_bo *gws;
> >>> + struct amdgpu_bo *oa;
> >>> int r;
> >>>
> >>> INIT_LIST_HEAD(&p->validated);
> >>> @@ -698,10 +701,11 @@ static int amdgpu_cs_parser_bos(struct
> >>> amdgpu_cs_parser *p,
> >>>
> >>> amdgpu_cs_report_moved_bytes(p->adev, p->bytes_moved,
> >>> p->bytes_moved_vis);
> >>> +
> >>> if (p->bo_list) {
> >>> - struct amdgpu_bo *gds = p->bo_list->gds_obj;
> >>> - struct amdgpu_bo *gws = p->bo_list->gws_obj;
> >>> - struct amdgpu_bo *oa = p->bo_list->oa_obj;
> >>> + gds = p->bo_list->gds_obj;
> >>> + gws = p->bo_list->gws_obj;
> >>> + oa = p->bo_list->oa_obj;
> >> out of curious, why not directly use p->adev->gds however per-vm-bo is
> >> enabled?
> >>
> >> Regards,
> >> David Zhou
> >>> struct amdgpu_vm *vm = &fpriv->vm;
> >>> unsigned i;
> >>>
> >>> @@ -710,19 +714,23 @@ static int amdgpu_cs_parser_bos(struct
> >>> amdgpu_cs_parser *p,
> >>>
> >>> p->bo_list->array[i].bo_va =
> >> amdgpu_vm_bo_find(vm, bo);
> >>> }
> >>> + } else {
> >>> + gds = p->adev->gds.gds_gfx_bo;
> >>> + gws = p->adev->gds.gws_gfx_bo;
> >>> + oa = p->adev->gds.oa_gfx_bo;
> >>> + }
> >>>
> >>> - if (gds) {
> >>> - p->job->gds_base = amdgpu_bo_gpu_offset(gds);
> >>> - p->job->gds_size = amdgpu_bo_size(gds);
> >>> - }
> >>> - if (gws) {
> >>> - p->job->gws_base = amdgpu_bo_gpu_offset(gws);
> >>> - p->job->gws_size = amdgpu_bo_size(gws);
> >>> - }
> >>> - if (oa) {
> >>> - p->job->oa_base = amdgpu_bo_gpu_offset(oa);
> >>> - p->job->oa_size = amdgpu_bo_size(oa);
> >>> - }
> >>> + if (gds) {
> >>> + p->job->gds_base = amdgpu_bo_gpu_offset(gds);
> >>> + p->job->gds_size = amdgpu_bo_size(gds);
> >>> + }
> >>> + if (gws) {
> >>> + p->job->gws_base = amdgpu_bo_gpu_offset(gws);
> >>> + p->job->gws_size = amdgpu_bo_size(gws);
> >>> + }
> >>> + if (oa) {
> >>> + p->job->oa_base = amdgpu_bo_gpu_offset(oa);
> >>> + p->job->oa_size = amdgpu_bo_size(oa);
> >>> }
> >>>
> >>> if (!r && p->uf_entry.robj) {
>
> _______________________________________________
> 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] 10+ messages in thread
* Re: [PATCH] drm/amdgpu: To get gds, gws and oa from adev->gds
[not found] ` <CY4PR12MB112565DE0D70E13277DBB2B68F6C0-rpdhrqHFk07v2MZdTKcfDgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2018-05-30 3:50 ` zhoucm1
0 siblings, 0 replies; 10+ messages in thread
From: zhoucm1 @ 2018-05-30 3:50 UTC (permalink / raw)
To: Deng, Emily, Zhou, David(ChunMing),
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Shared BOs have the check to prevent per-vm-bo creation:
struct dma_buf *amdgpu_gem_prime_export(struct drm_device *dev,
struct drm_gem_object *gobj,
int flags)
{
struct amdgpu_bo *bo = gem_to_amdgpu_bo(gobj);
struct dma_buf *buf;
if (amdgpu_ttm_tt_get_usermm(bo->tbo.ttm) ||
bo->flags & AMDGPU_GEM_CREATE_VM_ALWAYS_VALID)
return ERR_PTR(-EPERM);
......
Regards,
David Zhou
On 2018年05月30日 11:47, Deng, Emily wrote:
> Yes, I think we should add this rule to tell user mode driver, just like they will pass bo_list if they share bo with others.
>
> Best Wishes,
> Emily Deng
>
>> -----Original Message-----
>> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf
>> Of zhoucm1
>> Sent: Wednesday, May 30, 2018 11:36 AM
>> To: Deng, Emily <Emily.Deng@amd.com>; Zhou, David(ChunMing)
>> <David1.Zhou@amd.com>; amd-gfx@lists.freedesktop.org
>> Subject: Re: [PATCH] drm/amdgpu: To get gds, gws and oa from adev->gds
>>
>> Yes, but how to make sure there is bo list if all BOs are per-vm-bo?
>> Maybe we say we should give this rule to UMD, but who can make sure it?
>> we can imagine a situation when UMD forgot this rule, they create gds bo
>> with per-vm-bo, there is no bo list for CS, then our kernel give a kernel gds as
>> backup, everything runs ok, but UMD never get right result, it will be very
>> difficult to debug, right?
>>
>> That is why I created patch #2 to make sure gds BOs created from user space
>> are in bo list.
>>
>>
>> Regards,
>> David Zhou
>> On 2018年05月30日 11:27, Deng, Emily wrote:
>>> Hi David,
>>> For the use case that the user mode creates the gds, gws, and oa buffer
>> object itself, it need to pass bo_list to kernel driver, and we need
>>> to get those objects from bo_list.
>>>
>>> Best Wishes,
>>> Emily Deng
>>>
>>>> -----Original Message-----
>>>> From: Zhou, David(ChunMing)
>>>> Sent: Tuesday, May 29, 2018 7:23 PM
>>>> To: Deng, Emily <Emily.Deng@amd.com>; amd-gfx@lists.freedesktop.org
>>>> Subject: Re: [PATCH] drm/amdgpu: To get gds, gws and oa from adev-
>>> gds
>>>>
>>>>
>>>> On 2018年05月29日 17:17, Emily Deng wrote:
>>>>> As now enabled per vm bo feature, the user mode driver won't supply
>>>>> the bo_list generally, for this case, the gdb_base, gds_size,
>>>>> gws_base, gws_size and oa_base, oa_size won't be set.
>>>>>
>>>>> Signed-off-by: Emily Deng <Emily.Deng@amd.com>
>>>>> ---
>>>>> drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 38
>>>> ++++++++++++++++++++--------------
>>>>> 1 file changed, 23 insertions(+), 15 deletions(-)
>>>>>
>>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>>>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>>>>> index d296c95..ff94435 100644
>>>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>>>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
>>>>> @@ -546,6 +546,9 @@ static int amdgpu_cs_parser_bos(struct
>>>> amdgpu_cs_parser *p,
>>>>> struct amdgpu_bo_list_entry *e;
>>>>> struct list_head duplicates;
>>>>> unsigned i, tries = 10;
>>>>> + struct amdgpu_bo *gds;
>>>>> + struct amdgpu_bo *gws;
>>>>> + struct amdgpu_bo *oa;
>>>>> int r;
>>>>>
>>>>> INIT_LIST_HEAD(&p->validated);
>>>>> @@ -698,10 +701,11 @@ static int amdgpu_cs_parser_bos(struct
>>>>> amdgpu_cs_parser *p,
>>>>>
>>>>> amdgpu_cs_report_moved_bytes(p->adev, p->bytes_moved,
>>>>> p->bytes_moved_vis);
>>>>> +
>>>>> if (p->bo_list) {
>>>>> - struct amdgpu_bo *gds = p->bo_list->gds_obj;
>>>>> - struct amdgpu_bo *gws = p->bo_list->gws_obj;
>>>>> - struct amdgpu_bo *oa = p->bo_list->oa_obj;
>>>>> + gds = p->bo_list->gds_obj;
>>>>> + gws = p->bo_list->gws_obj;
>>>>> + oa = p->bo_list->oa_obj;
>>>> out of curious, why not directly use p->adev->gds however per-vm-bo is
>>>> enabled?
>>>>
>>>> Regards,
>>>> David Zhou
>>>>> struct amdgpu_vm *vm = &fpriv->vm;
>>>>> unsigned i;
>>>>>
>>>>> @@ -710,19 +714,23 @@ static int amdgpu_cs_parser_bos(struct
>>>>> amdgpu_cs_parser *p,
>>>>>
>>>>> p->bo_list->array[i].bo_va =
>>>> amdgpu_vm_bo_find(vm, bo);
>>>>> }
>>>>> + } else {
>>>>> + gds = p->adev->gds.gds_gfx_bo;
>>>>> + gws = p->adev->gds.gws_gfx_bo;
>>>>> + oa = p->adev->gds.oa_gfx_bo;
>>>>> + }
>>>>>
>>>>> - if (gds) {
>>>>> - p->job->gds_base = amdgpu_bo_gpu_offset(gds);
>>>>> - p->job->gds_size = amdgpu_bo_size(gds);
>>>>> - }
>>>>> - if (gws) {
>>>>> - p->job->gws_base = amdgpu_bo_gpu_offset(gws);
>>>>> - p->job->gws_size = amdgpu_bo_size(gws);
>>>>> - }
>>>>> - if (oa) {
>>>>> - p->job->oa_base = amdgpu_bo_gpu_offset(oa);
>>>>> - p->job->oa_size = amdgpu_bo_size(oa);
>>>>> - }
>>>>> + if (gds) {
>>>>> + p->job->gds_base = amdgpu_bo_gpu_offset(gds);
>>>>> + p->job->gds_size = amdgpu_bo_size(gds);
>>>>> + }
>>>>> + if (gws) {
>>>>> + p->job->gws_base = amdgpu_bo_gpu_offset(gws);
>>>>> + p->job->gws_size = amdgpu_bo_size(gws);
>>>>> + }
>>>>> + if (oa) {
>>>>> + p->job->oa_base = amdgpu_bo_gpu_offset(oa);
>>>>> + p->job->oa_size = amdgpu_bo_size(oa);
>>>>> }
>>>>>
>>>>> if (!r && p->uf_entry.robj) {
>> _______________________________________________
>> 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] 10+ messages in thread
* RE: [PATCH] drm/amdgpu: To get gds, gws and oa from adev->gds.
[not found] ` <eedeeb78-7617-dd33-8135-9e14e700ce81-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2018-05-29 9:06 ` Deng, Emily
0 siblings, 0 replies; 10+ messages in thread
From: Deng, Emily @ 2018-05-29 9:06 UTC (permalink / raw)
To: Koenig, Christian, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Thanks Christian, will modify the patch as you suggest.
Best Wishes,
Emily Deng
> -----Original Message-----
> From: Christian König [mailto:ckoenig.leichtzumerken@gmail.com]
> Sent: Tuesday, May 29, 2018 5:01 PM
> To: Deng, Emily <Emily.Deng@amd.com>; amd-gfx@lists.freedesktop.org
> Subject: Re: [PATCH] drm/amdgpu: To get gds, gws and oa from adev->gds.
>
> Am 29.05.2018 um 10:06 schrieb Emily Deng:
> > As now enabled per vm bo feature, the user mode driver won't supply
> > the bo_list generally, for this case, the gdb_base, gds_size,
> > gws_base, gws_size and oa_base, oa_size won't be set.
>
> Good catch, a few minor notes below.
>
> >
> > Signed-off-by: Emily Deng <Emily.Deng@amd.com>
> > ---
> > drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 44
> ++++++++++++++++++++--------------
> > 1 file changed, 26 insertions(+), 18 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> > index e1756b6..49be8b65 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> > @@ -515,14 +515,17 @@ static int amdgpu_cs_list_validate(struct
> amdgpu_cs_parser *p,
> > return 0;
> > }
> >
> > -static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
> > - union drm_amdgpu_cs *cs)
> > +static int amdgpu_cs_parser_bos(struct amdgpu_device *adev,
> > + struct amdgpu_cs_parser *p, union
> drm_amdgpu_cs *cs)
>
> No need for this change, adev should be available as p->adev as well.
>
> > {
> > struct amdgpu_fpriv *fpriv = p->filp->driver_priv;
> > struct amdgpu_bo_list_entry *e;
> > struct list_head duplicates;
> > unsigned i, tries = 10;
> > int r;
> > + struct amdgpu_bo *gds;
> > + struct amdgpu_bo *gws;
> > + struct amdgpu_bo *oa;
>
> Reverse xmas tree order please, e.g. "int r" should be the last one.
>
> Apart from that it looks good to me,
> Christian.
>
> >
> > INIT_LIST_HEAD(&p->validated);
> >
> > @@ -652,10 +655,11 @@ static int amdgpu_cs_parser_bos(struct
> > amdgpu_cs_parser *p,
> >
> > amdgpu_cs_report_moved_bytes(p->adev, p->bytes_moved,
> > p->bytes_moved_vis);
> > +
> > if (p->bo_list) {
> > - struct amdgpu_bo *gds = p->bo_list->gds_obj;
> > - struct amdgpu_bo *gws = p->bo_list->gws_obj;
> > - struct amdgpu_bo *oa = p->bo_list->oa_obj;
> > + gds = p->bo_list->gds_obj;
> > + gws = p->bo_list->gws_obj;
> > + oa = p->bo_list->oa_obj;
> > struct amdgpu_vm *vm = &fpriv->vm;
> > unsigned i;
> >
> > @@ -664,19 +668,23 @@ static int amdgpu_cs_parser_bos(struct
> > amdgpu_cs_parser *p,
> >
> > p->bo_list->array[i].bo_va =
> amdgpu_vm_bo_find(vm, bo);
> > }
> > + } else {
> > + gds = adev->gds.gds_gfx_bo;
> > + gws = adev->gds.gws_gfx_bo;
> > + oa = adev->gds.oa_gfx_bo;
> > + }
> >
> > - if (gds) {
> > - p->job->gds_base = amdgpu_bo_gpu_offset(gds);
> > - p->job->gds_size = amdgpu_bo_size(gds);
> > - }
> > - if (gws) {
> > - p->job->gws_base = amdgpu_bo_gpu_offset(gws);
> > - p->job->gws_size = amdgpu_bo_size(gws);
> > - }
> > - if (oa) {
> > - p->job->oa_base = amdgpu_bo_gpu_offset(oa);
> > - p->job->oa_size = amdgpu_bo_size(oa);
> > - }
> > + if (gds) {
> > + p->job->gds_base = amdgpu_bo_gpu_offset(gds);
> > + p->job->gds_size = amdgpu_bo_size(gds);
> > + }
> > + if (gws) {
> > + p->job->gws_base = amdgpu_bo_gpu_offset(gws);
> > + p->job->gws_size = amdgpu_bo_size(gws);
> > + }
> > + if (oa) {
> > + p->job->oa_base = amdgpu_bo_gpu_offset(oa);
> > + p->job->oa_size = amdgpu_bo_size(oa);
> > }
> >
> > if (!r && p->uf_entry.robj) {
> > @@ -1233,7 +1241,7 @@ int amdgpu_cs_ioctl(struct drm_device *dev,
> void *data, struct drm_file *filp)
> > if (r)
> > goto out;
> >
> > - r = amdgpu_cs_parser_bos(&parser, data);
> > + r = amdgpu_cs_parser_bos(adev, &parser, data);
> > if (r) {
> > if (r == -ENOMEM)
> > DRM_ERROR("Not enough memory for command
> submission!\n");
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] drm/amdgpu: To get gds, gws and oa from adev->gds.
[not found] ` <1527581199-31786-1-git-send-email-Emily.Deng-5C7GfCeVMHo@public.gmane.org>
@ 2018-05-29 9:00 ` Christian König
[not found] ` <eedeeb78-7617-dd33-8135-9e14e700ce81-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Christian König @ 2018-05-29 9:00 UTC (permalink / raw)
To: Emily Deng, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Am 29.05.2018 um 10:06 schrieb Emily Deng:
> As now enabled per vm bo feature, the user mode driver won't supply the
> bo_list generally, for this case, the gdb_base, gds_size, gws_base, gws_size and
> oa_base, oa_size won't be set.
Good catch, a few minor notes below.
>
> Signed-off-by: Emily Deng <Emily.Deng@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 44 ++++++++++++++++++++--------------
> 1 file changed, 26 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index e1756b6..49be8b65 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -515,14 +515,17 @@ static int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
> return 0;
> }
>
> -static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
> - union drm_amdgpu_cs *cs)
> +static int amdgpu_cs_parser_bos(struct amdgpu_device *adev,
> + struct amdgpu_cs_parser *p, union drm_amdgpu_cs *cs)
No need for this change, adev should be available as p->adev as well.
> {
> struct amdgpu_fpriv *fpriv = p->filp->driver_priv;
> struct amdgpu_bo_list_entry *e;
> struct list_head duplicates;
> unsigned i, tries = 10;
> int r;
> + struct amdgpu_bo *gds;
> + struct amdgpu_bo *gws;
> + struct amdgpu_bo *oa;
Reverse xmas tree order please, e.g. "int r" should be the last one.
Apart from that it looks good to me,
Christian.
>
> INIT_LIST_HEAD(&p->validated);
>
> @@ -652,10 +655,11 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
>
> amdgpu_cs_report_moved_bytes(p->adev, p->bytes_moved,
> p->bytes_moved_vis);
> +
> if (p->bo_list) {
> - struct amdgpu_bo *gds = p->bo_list->gds_obj;
> - struct amdgpu_bo *gws = p->bo_list->gws_obj;
> - struct amdgpu_bo *oa = p->bo_list->oa_obj;
> + gds = p->bo_list->gds_obj;
> + gws = p->bo_list->gws_obj;
> + oa = p->bo_list->oa_obj;
> struct amdgpu_vm *vm = &fpriv->vm;
> unsigned i;
>
> @@ -664,19 +668,23 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
>
> p->bo_list->array[i].bo_va = amdgpu_vm_bo_find(vm, bo);
> }
> + } else {
> + gds = adev->gds.gds_gfx_bo;
> + gws = adev->gds.gws_gfx_bo;
> + oa = adev->gds.oa_gfx_bo;
> + }
>
> - if (gds) {
> - p->job->gds_base = amdgpu_bo_gpu_offset(gds);
> - p->job->gds_size = amdgpu_bo_size(gds);
> - }
> - if (gws) {
> - p->job->gws_base = amdgpu_bo_gpu_offset(gws);
> - p->job->gws_size = amdgpu_bo_size(gws);
> - }
> - if (oa) {
> - p->job->oa_base = amdgpu_bo_gpu_offset(oa);
> - p->job->oa_size = amdgpu_bo_size(oa);
> - }
> + if (gds) {
> + p->job->gds_base = amdgpu_bo_gpu_offset(gds);
> + p->job->gds_size = amdgpu_bo_size(gds);
> + }
> + if (gws) {
> + p->job->gws_base = amdgpu_bo_gpu_offset(gws);
> + p->job->gws_size = amdgpu_bo_size(gws);
> + }
> + if (oa) {
> + p->job->oa_base = amdgpu_bo_gpu_offset(oa);
> + p->job->oa_size = amdgpu_bo_size(oa);
> }
>
> if (!r && p->uf_entry.robj) {
> @@ -1233,7 +1241,7 @@ int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
> if (r)
> goto out;
>
> - r = amdgpu_cs_parser_bos(&parser, data);
> + r = amdgpu_cs_parser_bos(adev, &parser, data);
> if (r) {
> if (r == -ENOMEM)
> DRM_ERROR("Not enough memory for command submission!\n");
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] drm/amdgpu: To get gds, gws and oa from adev->gds.
@ 2018-05-29 8:06 Emily Deng
[not found] ` <1527581199-31786-1-git-send-email-Emily.Deng-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 10+ messages in thread
From: Emily Deng @ 2018-05-29 8:06 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Emily Deng
As now enabled per vm bo feature, the user mode driver won't supply the
bo_list generally, for this case, the gdb_base, gds_size, gws_base, gws_size and
oa_base, oa_size won't be set.
Signed-off-by: Emily Deng <Emily.Deng@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 44 ++++++++++++++++++++--------------
1 file changed, 26 insertions(+), 18 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index e1756b6..49be8b65 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -515,14 +515,17 @@ static int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
return 0;
}
-static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
- union drm_amdgpu_cs *cs)
+static int amdgpu_cs_parser_bos(struct amdgpu_device *adev,
+ struct amdgpu_cs_parser *p, union drm_amdgpu_cs *cs)
{
struct amdgpu_fpriv *fpriv = p->filp->driver_priv;
struct amdgpu_bo_list_entry *e;
struct list_head duplicates;
unsigned i, tries = 10;
int r;
+ struct amdgpu_bo *gds;
+ struct amdgpu_bo *gws;
+ struct amdgpu_bo *oa;
INIT_LIST_HEAD(&p->validated);
@@ -652,10 +655,11 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
amdgpu_cs_report_moved_bytes(p->adev, p->bytes_moved,
p->bytes_moved_vis);
+
if (p->bo_list) {
- struct amdgpu_bo *gds = p->bo_list->gds_obj;
- struct amdgpu_bo *gws = p->bo_list->gws_obj;
- struct amdgpu_bo *oa = p->bo_list->oa_obj;
+ gds = p->bo_list->gds_obj;
+ gws = p->bo_list->gws_obj;
+ oa = p->bo_list->oa_obj;
struct amdgpu_vm *vm = &fpriv->vm;
unsigned i;
@@ -664,19 +668,23 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
p->bo_list->array[i].bo_va = amdgpu_vm_bo_find(vm, bo);
}
+ } else {
+ gds = adev->gds.gds_gfx_bo;
+ gws = adev->gds.gws_gfx_bo;
+ oa = adev->gds.oa_gfx_bo;
+ }
- if (gds) {
- p->job->gds_base = amdgpu_bo_gpu_offset(gds);
- p->job->gds_size = amdgpu_bo_size(gds);
- }
- if (gws) {
- p->job->gws_base = amdgpu_bo_gpu_offset(gws);
- p->job->gws_size = amdgpu_bo_size(gws);
- }
- if (oa) {
- p->job->oa_base = amdgpu_bo_gpu_offset(oa);
- p->job->oa_size = amdgpu_bo_size(oa);
- }
+ if (gds) {
+ p->job->gds_base = amdgpu_bo_gpu_offset(gds);
+ p->job->gds_size = amdgpu_bo_size(gds);
+ }
+ if (gws) {
+ p->job->gws_base = amdgpu_bo_gpu_offset(gws);
+ p->job->gws_size = amdgpu_bo_size(gws);
+ }
+ if (oa) {
+ p->job->oa_base = amdgpu_bo_gpu_offset(oa);
+ p->job->oa_size = amdgpu_bo_size(oa);
}
if (!r && p->uf_entry.robj) {
@@ -1233,7 +1241,7 @@ int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
if (r)
goto out;
- r = amdgpu_cs_parser_bos(&parser, data);
+ r = amdgpu_cs_parser_bos(adev, &parser, data);
if (r) {
if (r == -ENOMEM)
DRM_ERROR("Not enough memory for command submission!\n");
--
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] 10+ messages in thread
end of thread, other threads:[~2018-05-30 3:50 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-29 9:17 [PATCH] drm/amdgpu: To get gds, gws and oa from adev->gds Emily Deng
[not found] ` <1527585469-4424-1-git-send-email-Emily.Deng-5C7GfCeVMHo@public.gmane.org>
2018-05-29 11:22 ` zhoucm1
[not found] ` <90460b27-2c68-ad86-c222-161757e00722-5C7GfCeVMHo@public.gmane.org>
2018-05-30 3:27 ` Deng, Emily
[not found] ` <CY4PR12MB11252A3AA9A13B43B51303348F6C0-rpdhrqHFk07v2MZdTKcfDgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-05-30 3:36 ` zhoucm1
[not found] ` <ecf1e921-974f-6467-cf9f-4e9e49645aa9-5C7GfCeVMHo@public.gmane.org>
2018-05-30 3:47 ` Deng, Emily
[not found] ` <CY4PR12MB112565DE0D70E13277DBB2B68F6C0-rpdhrqHFk07v2MZdTKcfDgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-05-30 3:50 ` zhoucm1
2018-05-29 11:46 ` Christian König
-- strict thread matches above, loose matches on Subject: below --
2018-05-29 8:06 Emily Deng
[not found] ` <1527581199-31786-1-git-send-email-Emily.Deng-5C7GfCeVMHo@public.gmane.org>
2018-05-29 9:00 ` Christian König
[not found] ` <eedeeb78-7617-dd33-8135-9e14e700ce81-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-05-29 9:06 ` Deng, Emily
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.