All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luben Tuikov <luben.tuikov@amd.com>
To: Felix Kuehling <felix.kuehling@amd.com>,
	Guchun Chen <guchun.chen@amd.com>,
	amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/amdgpu: use adev_to_drm to get drm_device
Date: Wed, 9 Jun 2021 11:20:48 -0400	[thread overview]
Message-ID: <59df3448-f49c-1390-5031-327293bc1f38@amd.com> (raw)
In-Reply-To: <ab48ac1a-16a4-3bc2-13e4-bb3c1fb6a3ba@amd.com>

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

  reply	other threads:[~2021-06-09 15:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=59df3448-f49c-1390-5031-327293bc1f38@amd.com \
    --to=luben.tuikov@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=felix.kuehling@amd.com \
    --cc=guchun.chen@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.