mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lizhi Hou <lizhi.hou@amd.com>
To: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Cc: Maling list - DRI developers <dri-devel@lists.freedesktop.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V1] accel/amdxdna: Revise device bo creation and free
Date: Mon, 16 Jun 2025 22:37:15 -0700	[thread overview]
Message-ID: <958b71f4-fa5b-6aee-df9b-0b4b35c2fe0f@amd.com> (raw)
In-Reply-To: <3e8e19f2-29dc-4644-82cc-85aae6b2598d@linux.intel.com>

Pushed to drm-misc-next

On 6/16/25 04:30, Jacek Lawrynowicz wrote:
> Hi,
>
> On 6/16/2025 11:14 AM, Lizhi Hou wrote:
>> The device bo is allocated from the device heap memory. (a trunk of
>> memory dedicated to device)
>>
>> Rename amdxdna_gem_insert_node_locked to amdxdna_gem_heap_alloc
>> and move related sanity checks into it.
>>
>> Add amdxdna_gem_dev_obj_free and move device bo free code into it.
>>
>> Calculate the kernel virtual address of device bo by the device
>> heap memory address and offset.
>>
>> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
>> ---
>>   drivers/accel/amdxdna/aie2_ctx.c    |   2 +-
>>   drivers/accel/amdxdna/amdxdna_gem.c | 193 +++++++++++++++-------------
>>   drivers/accel/amdxdna/amdxdna_gem.h |   3 +-
>>   3 files changed, 106 insertions(+), 92 deletions(-)
>>
> ...
>
>> @@ -855,10 +868,12 @@ int amdxdna_drm_sync_bo_ioctl(struct drm_device *dev,
>>   
>>   	if (is_import_bo(abo))
>>   		drm_clflush_sg(abo->base.sgt);
>> -	else if (abo->type == AMDXDNA_BO_DEV)
>> -		drm_clflush_pages(abo->mem.pages, abo->mem.nr_pages);
>> -	else
>> +	else if (abo->mem.kva)
>> +		drm_clflush_virt_range(abo->mem.kva + args->offset, args->size);
>> +	else if (abo->base.pages)
>>   		drm_clflush_pages(abo->base.pages, gobj->size >> PAGE_SHIFT);
>> +	else
>> +		WARN(1, "Can not get flush memory");
> drm_WARN() would also give you the device that caused the warning in case there may be multiple xdna accels.
>
> Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
>
> Regards,
> Jacek
>

      parent reply	other threads:[~2025-06-17  5:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-16  9:14 Lizhi Hou
     [not found] ` <3e8e19f2-29dc-4644-82cc-85aae6b2598d@linux.intel.com>
2025-06-17  5:37   ` Lizhi Hou [this message]

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=958b71f4-fa5b-6aee-df9b-0b4b35c2fe0f@amd.com \
    --to=lizhi.hou@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jacek.lawrynowicz@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®