* [PATCH] drm/amdgpu: use adev_to_drm to get drm_device
@ 2021-06-09 9:23 Guchun Chen
2021-06-09 14:01 ` Felix Kuehling
2021-06-09 15:38 ` Alex Deucher
0 siblings, 2 replies; 10+ messages in thread
From: Guchun Chen @ 2021-06-09 9:23 UTC (permalink / raw)
To: amd-gfx, luben.tuikov, felix.kuehling; +Cc: Guchun Chen
Fixes:
9faf262c32d3 drm/amdgpu: Add DMA mapping of GTT BOs
090f3a60d7e8 drm/amdgpu: Use delayed work to collect RAS error counters
Signed-off-by: Guchun Chen <guchun.chen@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
index 016815b7a773..fb6bcc386de1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -639,7 +639,7 @@ kfd_mem_attach_dmabuf(struct amdgpu_device *adev, struct kgd_mem *mem,
}
}
- gobj = amdgpu_gem_prime_import(&adev->ddev, mem->dmabuf);
+ gobj = amdgpu_gem_prime_import(adev_to_drm(adev), mem->dmabuf);
if (IS_ERR(gobj))
return PTR_ERR(gobj);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index ec936cde2726..bfbcb9ff2453 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -2122,7 +2122,7 @@ static void amdgpu_ras_counte_dw(struct work_struct *work)
struct amdgpu_ras *con = container_of(work, struct amdgpu_ras,
ras_counte_delay_work.work);
struct amdgpu_device *adev = con->adev;
- struct drm_device *dev = &adev->ddev;
+ struct drm_device *dev = adev_to_drm(adev->ddev);
unsigned long ce_count, ue_count;
int res;
--
2.17.1
_______________________________________________
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: use adev_to_drm to get drm_device
2021-06-09 9:23 [PATCH] drm/amdgpu: use adev_to_drm to get drm_device Guchun Chen
@ 2021-06-09 14:01 ` Felix Kuehling
2021-06-09 15:20 ` Luben Tuikov
2021-06-09 15:38 ` Alex Deucher
1 sibling, 1 reply; 10+ messages in thread
From: Felix Kuehling @ 2021-06-09 14:01 UTC (permalink / raw)
To: Guchun Chen, amd-gfx, luben.tuikov
Am 2021-06-09 um 5:23 a.m. schrieb Guchun Chen:
> Fixes:
> 9faf262c32d3 drm/amdgpu: Add DMA mapping of GTT BOs
> 090f3a60d7e8 drm/amdgpu: Use delayed work to collect RAS error counters
A Fixes tag implies that something was broken. However, the
implementation of adev_to_drm does the exact same thing. I don't see the
point of this patch. It doesn't fix any problem, and IMHO doesn't make
the code more readable.
Regards,
Felix
>
> Signed-off-by: Guchun Chen <guchun.chen@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +-
> drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> index 016815b7a773..fb6bcc386de1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> @@ -639,7 +639,7 @@ kfd_mem_attach_dmabuf(struct amdgpu_device *adev, struct kgd_mem *mem,
> }
> }
>
> - gobj = amdgpu_gem_prime_import(&adev->ddev, mem->dmabuf);
> + gobj = amdgpu_gem_prime_import(adev_to_drm(adev), mem->dmabuf);
> if (IS_ERR(gobj))
> return PTR_ERR(gobj);
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> index ec936cde2726..bfbcb9ff2453 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> @@ -2122,7 +2122,7 @@ static void amdgpu_ras_counte_dw(struct work_struct *work)
> struct amdgpu_ras *con = container_of(work, struct amdgpu_ras,
> ras_counte_delay_work.work);
> struct amdgpu_device *adev = con->adev;
> - struct drm_device *dev = &adev->ddev;
> + struct drm_device *dev = adev_to_drm(adev->ddev);
> unsigned long ce_count, ue_count;
> int res;
>
_______________________________________________
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: use adev_to_drm to get drm_device
2021-06-09 14:01 ` Felix Kuehling
@ 2021-06-09 15:20 ` Luben Tuikov
2021-06-09 15:32 ` Felix Kuehling
0 siblings, 1 reply; 10+ messages in thread
From: Luben Tuikov @ 2021-06-09 15:20 UTC (permalink / raw)
To: Felix Kuehling, Guchun Chen, amd-gfx
On 2021-06-09 10:01 a.m., Felix Kuehling wrote:
> Am 2021-06-09 um 5:23 a.m. schrieb Guchun Chen:
>> Fixes:
>> 9faf262c32d3 drm/amdgpu: Add DMA mapping of GTT BOs
>> 090f3a60d7e8 drm/amdgpu: Use delayed work to collect RAS error counters
> A Fixes tag implies that something was broken. However, the
> implementation of adev_to_drm does the exact same thing. I don't see the
> point of this patch. It doesn't fix any problem, and IMHO doesn't make
> the code more readable.
We added this due to some changes in DRM:
8aba21b75136c3 drm/amdgpu: Embed drm_device into amdgpu_device (v3)
4a580877bdcb83 drm/amdgpu: Get DRM dev from adev by inline-f
It's good to use this inline function, to accommodate more flexible DRM.
Regards,
Luben
>
> Regards,
> Felix
>
>
>> Signed-off-by: Guchun Chen <guchun.chen@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +-
>> drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 +-
>> 2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
>> index 016815b7a773..fb6bcc386de1 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
>> @@ -639,7 +639,7 @@ kfd_mem_attach_dmabuf(struct amdgpu_device *adev, struct kgd_mem *mem,
>> }
>> }
>>
>> - gobj = amdgpu_gem_prime_import(&adev->ddev, mem->dmabuf);
>> + gobj = amdgpu_gem_prime_import(adev_to_drm(adev), mem->dmabuf);
>> if (IS_ERR(gobj))
>> return PTR_ERR(gobj);
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
>> index ec936cde2726..bfbcb9ff2453 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
>> @@ -2122,7 +2122,7 @@ static void amdgpu_ras_counte_dw(struct work_struct *work)
>> struct amdgpu_ras *con = container_of(work, struct amdgpu_ras,
>> ras_counte_delay_work.work);
>> struct amdgpu_device *adev = con->adev;
>> - struct drm_device *dev = &adev->ddev;
>> + struct drm_device *dev = adev_to_drm(adev->ddev);
>> unsigned long ce_count, ue_count;
>> int res;
>>
_______________________________________________
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: use adev_to_drm to get drm_device
2021-06-09 15:20 ` Luben Tuikov
@ 2021-06-09 15:32 ` Felix Kuehling
2021-06-09 15:36 ` Deucher, Alexander
0 siblings, 1 reply; 10+ messages in thread
From: Felix Kuehling @ 2021-06-09 15:32 UTC (permalink / raw)
To: Luben Tuikov, Guchun Chen, amd-gfx
Am 2021-06-09 um 11:20 a.m. schrieb Luben Tuikov:
> On 2021-06-09 10:01 a.m., Felix Kuehling wrote:
>> Am 2021-06-09 um 5:23 a.m. schrieb Guchun Chen:
>>> Fixes:
>>> 9faf262c32d3 drm/amdgpu: Add DMA mapping of GTT BOs
>>> 090f3a60d7e8 drm/amdgpu: Use delayed work to collect RAS error counters
>> A Fixes tag implies that something was broken. However, the
>> implementation of adev_to_drm does the exact same thing. I don't see the
>> point of this patch. It doesn't fix any problem, and IMHO doesn't make
>> the code more readable.
> We added this due to some changes in DRM:
>
> 8aba21b75136c3 drm/amdgpu: Embed drm_device into amdgpu_device (v3)
> 4a580877bdcb83 drm/amdgpu: Get DRM dev from adev by inline-f
>
> It's good to use this inline function, to accommodate more flexible DRM.
Thanks for the explanation. I found your changes as well and it makes
sense now, especially for the DKMS branch. Unfortunately that's not a
justification we can use for upstream.
Regards,
Felix
>
> Regards,
> Luben
>
>> Regards,
>> Felix
>>
>>
>>> Signed-off-by: Guchun Chen <guchun.chen@amd.com>
>>> ---
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +-
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 +-
>>> 2 files changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
>>> index 016815b7a773..fb6bcc386de1 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
>>> @@ -639,7 +639,7 @@ kfd_mem_attach_dmabuf(struct amdgpu_device *adev, struct kgd_mem *mem,
>>> }
>>> }
>>>
>>> - gobj = amdgpu_gem_prime_import(&adev->ddev, mem->dmabuf);
>>> + gobj = amdgpu_gem_prime_import(adev_to_drm(adev), mem->dmabuf);
>>> if (IS_ERR(gobj))
>>> return PTR_ERR(gobj);
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
>>> index ec936cde2726..bfbcb9ff2453 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
>>> @@ -2122,7 +2122,7 @@ static void amdgpu_ras_counte_dw(struct work_struct *work)
>>> struct amdgpu_ras *con = container_of(work, struct amdgpu_ras,
>>> ras_counte_delay_work.work);
>>> struct amdgpu_device *adev = con->adev;
>>> - struct drm_device *dev = &adev->ddev;
>>> + struct drm_device *dev = adev_to_drm(adev->ddev);
>>> unsigned long ce_count, ue_count;
>>> int res;
>>>
_______________________________________________
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: use adev_to_drm to get drm_device
2021-06-09 15:32 ` Felix Kuehling
@ 2021-06-09 15:36 ` Deucher, Alexander
0 siblings, 0 replies; 10+ messages in thread
From: Deucher, Alexander @ 2021-06-09 15:36 UTC (permalink / raw)
To: Kuehling, Felix, Tuikov, Luben, Chen, Guchun, amd-gfx
[-- Attachment #1.1: Type: text/plain, Size: 3699 bytes --]
[Public]
We already use the macro everywhere else upstream, so this just makes it consistent.
Alex
________________________________
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Felix Kuehling <felix.kuehling@amd.com>
Sent: Wednesday, June 9, 2021 11:32 AM
To: Tuikov, Luben <Luben.Tuikov@amd.com>; Chen, Guchun <Guchun.Chen@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/amdgpu: use adev_to_drm to get drm_device
Am 2021-06-09 um 11:20 a.m. schrieb Luben Tuikov:
> On 2021-06-09 10:01 a.m., Felix Kuehling wrote:
>> Am 2021-06-09 um 5:23 a.m. schrieb Guchun Chen:
>>> Fixes:
>>> 9faf262c32d3 drm/amdgpu: Add DMA mapping of GTT BOs
>>> 090f3a60d7e8 drm/amdgpu: Use delayed work to collect RAS error counters
>> A Fixes tag implies that something was broken. However, the
>> implementation of adev_to_drm does the exact same thing. I don't see the
>> point of this patch. It doesn't fix any problem, and IMHO doesn't make
>> the code more readable.
> We added this due to some changes in DRM:
>
> 8aba21b75136c3 drm/amdgpu: Embed drm_device into amdgpu_device (v3)
> 4a580877bdcb83 drm/amdgpu: Get DRM dev from adev by inline-f
>
> It's good to use this inline function, to accommodate more flexible DRM.
Thanks for the explanation. I found your changes as well and it makes
sense now, especially for the DKMS branch. Unfortunately that's not a
justification we can use for upstream.
Regards,
Felix
>
> Regards,
> Luben
>
>> Regards,
>> Felix
>>
>>
>>> Signed-off-by: Guchun Chen <guchun.chen@amd.com>
>>> ---
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +-
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 +-
>>> 2 files changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
>>> index 016815b7a773..fb6bcc386de1 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
>>> @@ -639,7 +639,7 @@ kfd_mem_attach_dmabuf(struct amdgpu_device *adev, struct kgd_mem *mem,
>>> }
>>> }
>>>
>>> - gobj = amdgpu_gem_prime_import(&adev->ddev, mem->dmabuf);
>>> + gobj = amdgpu_gem_prime_import(adev_to_drm(adev), mem->dmabuf);
>>> if (IS_ERR(gobj))
>>> return PTR_ERR(gobj);
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
>>> index ec936cde2726..bfbcb9ff2453 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
>>> @@ -2122,7 +2122,7 @@ static void amdgpu_ras_counte_dw(struct work_struct *work)
>>> struct amdgpu_ras *con = container_of(work, struct amdgpu_ras,
>>> ras_counte_delay_work.work);
>>> struct amdgpu_device *adev = con->adev;
>>> - struct drm_device *dev = &adev->ddev;
>>> + struct drm_device *dev = adev_to_drm(adev->ddev);
>>> unsigned long ce_count, ue_count;
>>> int res;
>>>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7C310371950837474774fc08d92b5bc3a6%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637588495393971133%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=QMJ31mr9By5%2FAnnJ0QotXy3iNc8Bjn56oC2jeoKBVEg%3D&reserved=0
[-- Attachment #1.2: Type: text/html, Size: 6694 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] 10+ messages in thread
* Re: [PATCH] drm/amdgpu: use adev_to_drm to get drm_device
2021-06-09 9:23 [PATCH] drm/amdgpu: use adev_to_drm to get drm_device Guchun Chen
2021-06-09 14:01 ` Felix Kuehling
@ 2021-06-09 15:38 ` Alex Deucher
2021-06-09 17:05 ` Luben Tuikov
1 sibling, 1 reply; 10+ messages in thread
From: Alex Deucher @ 2021-06-09 15:38 UTC (permalink / raw)
To: Guchun Chen; +Cc: Kuehling, Felix, Tuikov, Luben, amd-gfx list
On Wed, Jun 9, 2021 at 5:23 AM Guchun Chen <guchun.chen@amd.com> wrote:
>
> Fixes:
> 9faf262c32d3 drm/amdgpu: Add DMA mapping of GTT BOs
> 090f3a60d7e8 drm/amdgpu: Use delayed work to collect RAS error counters
>
drop the fixes lines and say something like use the adev_to_drm()
macro for consistency. With that,
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> Signed-off-by: Guchun Chen <guchun.chen@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +-
> drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> index 016815b7a773..fb6bcc386de1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> @@ -639,7 +639,7 @@ kfd_mem_attach_dmabuf(struct amdgpu_device *adev, struct kgd_mem *mem,
> }
> }
>
> - gobj = amdgpu_gem_prime_import(&adev->ddev, mem->dmabuf);
> + gobj = amdgpu_gem_prime_import(adev_to_drm(adev), mem->dmabuf);
> if (IS_ERR(gobj))
> return PTR_ERR(gobj);
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> index ec936cde2726..bfbcb9ff2453 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
> @@ -2122,7 +2122,7 @@ static void amdgpu_ras_counte_dw(struct work_struct *work)
> struct amdgpu_ras *con = container_of(work, struct amdgpu_ras,
> ras_counte_delay_work.work);
> struct amdgpu_device *adev = con->adev;
> - struct drm_device *dev = &adev->ddev;
> + struct drm_device *dev = adev_to_drm(adev->ddev);
> unsigned long ce_count, ue_count;
> int res;
>
> --
> 2.17.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] 10+ messages in thread
* Re: [PATCH] drm/amdgpu: use adev_to_drm to get drm_device
2021-06-09 15:38 ` Alex Deucher
@ 2021-06-09 17:05 ` Luben Tuikov
2021-06-10 2:06 ` Chen, Guchun
0 siblings, 1 reply; 10+ messages in thread
From: Luben Tuikov @ 2021-06-09 17:05 UTC (permalink / raw)
To: Alex Deucher, Guchun Chen; +Cc: Kuehling, Felix, amd-gfx list
That's exactly what I said, but can see that 1/2 of the responses went to amd-gfx,
and the other half to brahma ML.
Regards,
Luben
On 2021-06-09 11:38 a.m., Alex Deucher wrote:
> On Wed, Jun 9, 2021 at 5:23 AM Guchun Chen <guchun.chen@amd.com> wrote:
>> Fixes:
>> 9faf262c32d3 drm/amdgpu: Add DMA mapping of GTT BOs
>> 090f3a60d7e8 drm/amdgpu: Use delayed work to collect RAS error counters
>>
> drop the fixes lines and say something like use the adev_to_drm()
> macro for consistency. With that,
> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
>
>> Signed-off-by: Guchun Chen <guchun.chen@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +-
>> drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 +-
>> 2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
>> index 016815b7a773..fb6bcc386de1 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
>> @@ -639,7 +639,7 @@ kfd_mem_attach_dmabuf(struct amdgpu_device *adev, struct kgd_mem *mem,
>> }
>> }
>>
>> - gobj = amdgpu_gem_prime_import(&adev->ddev, mem->dmabuf);
>> + gobj = amdgpu_gem_prime_import(adev_to_drm(adev), mem->dmabuf);
>> if (IS_ERR(gobj))
>> return PTR_ERR(gobj);
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
>> index ec936cde2726..bfbcb9ff2453 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
>> @@ -2122,7 +2122,7 @@ static void amdgpu_ras_counte_dw(struct work_struct *work)
>> struct amdgpu_ras *con = container_of(work, struct amdgpu_ras,
>> ras_counte_delay_work.work);
>> struct amdgpu_device *adev = con->adev;
>> - struct drm_device *dev = &adev->ddev;
>> + struct drm_device *dev = adev_to_drm(adev->ddev);
>> unsigned long ce_count, ue_count;
>> int res;
>>
>> --
>> 2.17.1
>>
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx@lists.freedesktop.org
>> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Cluben.tuikov%40amd.com%7C04e4afbe1642484eb15008d92b5ca67d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637588499214061155%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=DvbjnGu0Lafx%2FgCIejsFJgMyngl9bKIvIdLjTngQrCM%3D&reserved=0
_______________________________________________
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: use adev_to_drm to get drm_device
2021-06-09 17:05 ` Luben Tuikov
@ 2021-06-10 2:06 ` Chen, Guchun
0 siblings, 0 replies; 10+ messages in thread
From: Chen, Guchun @ 2021-06-10 2:06 UTC (permalink / raw)
To: Tuikov, Luben, Alex Deucher; +Cc: Kuehling, Felix, amd-gfx list
[Public]
Thanks for your kind feedback, Luben, Felix and Alex.
I will send a v2 set with your comments addressed and RB added.
Regards,
Guchun
-----Original Message-----
From: Tuikov, Luben <Luben.Tuikov@amd.com>
Sent: Thursday, June 10, 2021 1:06 AM
To: Alex Deucher <alexdeucher@gmail.com>; Chen, Guchun <Guchun.Chen@amd.com>
Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>; Kuehling, Felix <Felix.Kuehling@amd.com>
Subject: Re: [PATCH] drm/amdgpu: use adev_to_drm to get drm_device
That's exactly what I said, but can see that 1/2 of the responses went to amd-gfx, and the other half to brahma ML.
Regards,
Luben
On 2021-06-09 11:38 a.m., Alex Deucher wrote:
> On Wed, Jun 9, 2021 at 5:23 AM Guchun Chen <guchun.chen@amd.com> wrote:
>> Fixes:
>> 9faf262c32d3 drm/amdgpu: Add DMA mapping of GTT BOs
>> 090f3a60d7e8 drm/amdgpu: Use delayed work to collect RAS error
>> counters
>>
> drop the fixes lines and say something like use the adev_to_drm()
> macro for consistency. With that,
> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
>
>> Signed-off-by: Guchun Chen <guchun.chen@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +-
>> drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 +-
>> 2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
>> index 016815b7a773..fb6bcc386de1 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
>> @@ -639,7 +639,7 @@ kfd_mem_attach_dmabuf(struct amdgpu_device *adev, struct kgd_mem *mem,
>> }
>> }
>>
>> - gobj = amdgpu_gem_prime_import(&adev->ddev, mem->dmabuf);
>> + gobj = amdgpu_gem_prime_import(adev_to_drm(adev),
>> + mem->dmabuf);
>> if (IS_ERR(gobj))
>> return PTR_ERR(gobj);
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
>> index ec936cde2726..bfbcb9ff2453 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
>> @@ -2122,7 +2122,7 @@ static void amdgpu_ras_counte_dw(struct work_struct *work)
>> struct amdgpu_ras *con = container_of(work, struct amdgpu_ras,
>> ras_counte_delay_work.work);
>> struct amdgpu_device *adev = con->adev;
>> - struct drm_device *dev = &adev->ddev;
>> + struct drm_device *dev = adev_to_drm(adev->ddev);
>> unsigned long ce_count, ue_count;
>> int res;
>>
>> --
>> 2.17.1
>>
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx@lists.freedesktop.org
>> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flis
>> ts.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7C
>> luben.tuikov%40amd.com%7C04e4afbe1642484eb15008d92b5ca67d%7C3dd8961fe
>> 4884e608e11a82d994e183d%7C0%7C0%7C637588499214061155%7CUnknown%7CTWFp
>> bGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6M
>> n0%3D%7C1000&sdata=DvbjnGu0Lafx%2FgCIejsFJgMyngl9bKIvIdLjTngQrCM%
>> 3D&reserved=0
_______________________________________________
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: use adev_to_drm to get drm device
2022-08-25 7:48 [PATCH] drm/amdgpu: use adev_to_drm to get drm device Guchun Chen
@ 2022-08-25 8:13 ` Christian König
0 siblings, 0 replies; 10+ messages in thread
From: Christian König @ 2022-08-25 8:13 UTC (permalink / raw)
To: Guchun Chen, amd-gfx, alexander.deucher, hawking.zhang, evan.quan
Am 25.08.22 um 09:48 schrieb Guchun Chen:
> adev_to_drm is used everywhere in amdgpu code, so modify
> it to keep consistency.
>
> Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> index 8ee4e8491f39..6ea8980c8ad7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> @@ -402,7 +402,7 @@ static void amdgpu_ctx_fini(struct kref *ref)
> }
> }
>
> - if (drm_dev_enter(&adev->ddev, &idx)) {
> + if (drm_dev_enter(adev_to_drm(adev), &idx)) {
> amdgpu_ctx_set_stable_pstate(ctx, ctx->stable_pstate);
> drm_dev_exit(idx);
> }
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] drm/amdgpu: use adev_to_drm to get drm device
@ 2022-08-25 7:48 Guchun Chen
2022-08-25 8:13 ` Christian König
0 siblings, 1 reply; 10+ messages in thread
From: Guchun Chen @ 2022-08-25 7:48 UTC (permalink / raw)
To: amd-gfx, alexander.deucher, hawking.zhang, evan.quan, christian.koenig
Cc: Guchun Chen
adev_to_drm is used everywhere in amdgpu code, so modify
it to keep consistency.
Signed-off-by: Guchun Chen <guchun.chen@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
index 8ee4e8491f39..6ea8980c8ad7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
@@ -402,7 +402,7 @@ static void amdgpu_ctx_fini(struct kref *ref)
}
}
- if (drm_dev_enter(&adev->ddev, &idx)) {
+ if (drm_dev_enter(adev_to_drm(adev), &idx)) {
amdgpu_ctx_set_stable_pstate(ctx, ctx->stable_pstate);
drm_dev_exit(idx);
}
--
2.25.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
end of thread, other threads:[~2022-08-25 8:13 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09 9:23 [PATCH] drm/amdgpu: use adev_to_drm to get drm_device Guchun Chen
2021-06-09 14:01 ` Felix Kuehling
2021-06-09 15:20 ` Luben Tuikov
2021-06-09 15:32 ` Felix Kuehling
2021-06-09 15:36 ` Deucher, Alexander
2021-06-09 15:38 ` Alex Deucher
2021-06-09 17:05 ` Luben Tuikov
2021-06-10 2:06 ` Chen, Guchun
2022-08-25 7:48 [PATCH] drm/amdgpu: use adev_to_drm to get drm device Guchun Chen
2022-08-25 8:13 ` Christian König
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.