<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#008000;margin:15pt;" align="Left">
[Public]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
We already use the macro everywhere else upstream, so this just makes it consistent.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Alex</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Felix Kuehling <felix.kuehling@amd.com><br>
<b>Sent:</b> Wednesday, June 9, 2021 11:32 AM<br>
<b>To:</b> Tuikov, Luben <Luben.Tuikov@amd.com>; Chen, Guchun <Guchun.Chen@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Subject:</b> Re: [PATCH] drm/amdgpu: use adev_to_drm to get drm_device</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Am 2021-06-09 um 11:20 a.m. schrieb Luben Tuikov:<br>
> On 2021-06-09 10:01 a.m., Felix Kuehling wrote:<br>
>> Am 2021-06-09 um 5:23 a.m. schrieb Guchun Chen:<br>
>>> Fixes:<br>
>>> 9faf262c32d3 drm/amdgpu: Add DMA mapping of GTT BOs<br>
>>> 090f3a60d7e8 drm/amdgpu: Use delayed work to collect RAS error counters<br>
>> A Fixes tag implies that something was broken. However, the<br>
>> implementation of adev_to_drm does the exact same thing. I don't see the<br>
>> point of this patch. It doesn't fix any problem, and IMHO doesn't make<br>
>> the code more readable.<br>
> We added this due to some changes in DRM:<br>
><br>
> 8aba21b75136c3 drm/amdgpu: Embed drm_device into amdgpu_device (v3)<br>
> 4a580877bdcb83 drm/amdgpu: Get DRM dev from adev by inline-f<br>
><br>
> It's good to use this inline function, to accommodate more flexible DRM.<br>
<br>
Thanks for the explanation. I found your changes as well and it makes<br>
sense now, especially for the DKMS branch. Unfortunately that's not a<br>
justification we can use for upstream.<br>
<br>
Regards,<br>
  Felix<br>
<br>
<br>
><br>
> Regards,<br>
> Luben<br>
><br>
>> Regards,<br>
>>   Felix<br>
>><br>
>><br>
>>> Signed-off-by: Guchun Chen <guchun.chen@amd.com><br>
>>> ---<br>
>>>  drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 2 +-<br>
>>>  drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c          | 2 +-<br>
>>>  2 files changed, 2 insertions(+), 2 deletions(-)<br>
>>><br>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c<br>
>>> index 016815b7a773..fb6bcc386de1 100644<br>
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c<br>
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c<br>
>>> @@ -639,7 +639,7 @@ kfd_mem_attach_dmabuf(struct amdgpu_device *adev, struct kgd_mem *mem,<br>
>>>              }<br>
>>>      }<br>
>>>  <br>
>>> -   gobj = amdgpu_gem_prime_import(&adev->ddev, mem->dmabuf);<br>
>>> +   gobj = amdgpu_gem_prime_import(adev_to_drm(adev), mem->dmabuf);<br>
>>>      if (IS_ERR(gobj))<br>
>>>              return PTR_ERR(gobj);<br>
>>>  <br>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c<br>
>>> index ec936cde2726..bfbcb9ff2453 100644<br>
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c<br>
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c<br>
>>> @@ -2122,7 +2122,7 @@ static void amdgpu_ras_counte_dw(struct work_struct *work)<br>
>>>      struct amdgpu_ras *con = container_of(work, struct amdgpu_ras,<br>
>>>                                            ras_counte_delay_work.work);<br>
>>>      struct amdgpu_device *adev = con->adev;<br>
>>> -   struct drm_device *dev = &adev->ddev;<br>
>>> +   struct drm_device *dev = adev_to_drm(adev->ddev);<br>
>>>      unsigned long ce_count, ue_count;<br>
>>>      int res;<br>
>>>  <br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Calexander.deucher%40amd.com%7C310371950837474774fc08d92b5bc3a6%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637588495393971133%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=QMJ31mr9By5%2FAnnJ0QotXy3iNc8Bjn56oC2jeoKBVEg%3D&amp;reserved=0">https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Calexander.deucher%40amd.com%7C310371950837474774fc08d92b5bc3a6%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637588495393971133%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=QMJ31mr9By5%2FAnnJ0QotXy3iNc8Bjn56oC2jeoKBVEg%3D&amp;reserved=0</a><br>
</div>
</span></font></div>
</div>
</body>
</html>