All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nirmoy <nirmodas@amd.com>
To: "Christian König" <christian.koenig@amd.com>,
	"Nirmoy Das" <nirmoy.das@amd.com>,
	amd-gfx@lists.freedesktop.org
Cc: alexander.deucher@amd.com
Subject: Re: [PATCH 2/7] drm/amdgpu: add a new identifier for amdgpu_bo
Date: Fri, 21 May 2021 15:54:26 +0200	[thread overview]
Message-ID: <a1a0b4ae-98dd-b434-7a07-d46c84d2a1b0@amd.com> (raw)
In-Reply-To: <38fd15b4-aacc-9be6-deaf-9fcd61d59477@amd.com>


On 5/21/21 2:58 PM, Christian König wrote:
> Am 21.05.21 um 14:45 schrieb Nirmoy Das:
>> Add has_shadow to identify if a BO is shadowed.
>
> Ok that is not going into the right direction.


I was expecting this :) but wasn't sure how to handle it.

>
>
> Instead of identifying which BOs have a shadow we need to identify if 
> this is a VM BO or not.
>
> I think the first think you need to do is to move the shadow handling 
> from amdgpu_cs_validate() into amdgpu_vm_validate_pt_bos().
>
> And then do it only for ttm_bo_type_kernel BOs, cause those are the 
> PD/PT BOs.


Thanks, this sounds good.


Nirmoy

>
> Regards,
> Christian.
>
>>
>> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 ++
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 5 ++---
>>   2 files changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c 
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>> index 61b1edcb490a..eb3ce33cbfff 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
>> @@ -619,6 +619,7 @@ int amdgpu_bo_create(struct amdgpu_device *adev,
>>       }
>>       if (!bp->resv)
>>           amdgpu_bo_unreserve(bo);
>> +    bo->has_shadow = false;
>>       *bo_ptr = bo;
>>         trace_amdgpu_bo_create(bo);
>> @@ -657,6 +658,7 @@ int amdgpu_bo_create_shadow(struct amdgpu_device 
>> *adev,
>>       r = amdgpu_bo_create(adev, &bp, &bo->shadow);
>>       if (!r) {
>>           bo->shadow->parent = amdgpu_bo_ref(bo);
>> +        bo->has_shadow = true;
>>           mutex_lock(&adev->shadow_list_lock);
>>           list_add_tail(&bo->shadow->shadow_list, &adev->shadow_list);
>>           mutex_unlock(&adev->shadow_list_lock);
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h 
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
>> index a7fbf5f7051e..3a0e6ca88563 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
>> @@ -104,9 +104,8 @@ struct amdgpu_bo {
>>       struct amdgpu_vm_bo_base    *vm_bo;
>>       /* Constant after initialization */
>>       struct amdgpu_bo        *parent;
>> -    struct amdgpu_bo        *shadow;
>> -
>> -
>> +    struct amdgpu_bo                *shadow;
>> +    bool                has_shadow;
>>     #ifdef CONFIG_MMU_NOTIFIER
>>       struct mmu_interval_notifier    notifier;
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  reply	other threads:[~2021-05-21 13:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-21 12:45 [PATCH 1/7] drm/amdgpu: add amdgpu_bo_vm bo type Nirmoy Das
2021-05-21 12:45 ` [PATCH 2/7] drm/amdgpu: add a new identifier for amdgpu_bo Nirmoy Das
2021-05-21 12:58   ` Christian König
2021-05-21 13:54     ` Nirmoy [this message]
2021-05-21 12:45 ` [PATCH 3/7] drm/amdgpu: use amdgpu_bo_vm for vm code Nirmoy Das
2021-05-21 12:45 ` [PATCH 4/7] drm/amdgpu: create shadow bo directly Nirmoy Das
2021-05-21 12:45 ` [PATCH 5/7] drm/amdgpu: switch to amdgpu_bo_vm's shadow Nirmoy Das
2021-05-21 12:45 ` [PATCH 6/7] drm/amdgpu: remove unused code Nirmoy Das
2021-05-21 12:45 ` [PATCH 7/7] drm/amdgpu: do not allocate entries separately Nirmoy Das
2021-05-21 13:01   ` Christian König
2021-05-21 14:04     ` Nirmoy
2021-05-21 14:54 ` [PATCH 1/7] drm/amdgpu: add amdgpu_bo_vm bo type Alex Deucher
2021-05-21 15:19   ` Nirmoy

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=a1a0b4ae-98dd-b434-7a07-d46c84d2a1b0@amd.com \
    --to=nirmodas@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=nirmoy.das@amd.com \
    --subject='Re: [PATCH 2/7] drm/amdgpu: add a new identifier for amdgpu_bo' \
    /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

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.