From: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
To: "Christian König" <ckoenig.leichtzumerken@gmail.com>,
dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
alexander.deucher@amd.com
Subject: Re: [PATCH 6/6] drm/amdgpu: use the new drm_exec object for CS v2
Date: Thu, 29 Jun 2023 17:20:02 +0900 [thread overview]
Message-ID: <17e929a5-d94f-8370-6aad-cf93490c6ad7@gmail.com> (raw)
In-Reply-To: <20230628104446.1369-7-christian.koenig@amd.com>
On 6/28/23 19:44, Christian König wrote:
> @@ -958,18 +904,57 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
> e->user_invalidated = userpage_invalidated;
> }
>
> - r = ttm_eu_reserve_buffers(&p->ticket, &p->validated, true,
> - &duplicates);
> - if (unlikely(r != 0)) {
> - if (r != -ERESTARTSYS)
> - DRM_ERROR("ttm_eu_reserve_buffers failed.\n");
> - goto out_free_user_pages;
> + drm_exec_until_all_locked(&p->exec) {
> + r = amdgpu_vm_lock_pd(&fpriv->vm, &p->exec, 1 + p->gang_size);
> + drm_exec_retry_on_contention(&p->exec);
> + if (unlikely(r))
> + goto out_free_user_pages;
> +
> + amdgpu_bo_list_for_each_entry(e, p->bo_list) {
> + /* One fence for TTM and one for each CS job */
> + r = drm_exec_prepare_obj(&p->exec, &e->bo->tbo.base,
> + 1 + p->gang_size);
> + drm_exec_retry_on_contention(&p->exec);
> + if (unlikely(r))
> + goto out_free_user_pages;
> +
> + e->bo_va = amdgpu_vm_bo_find(vm, e->bo);
> + e->range = NULL;
Still leaking.
> + }
> +
> + if (p->uf_bo) {
> + r = drm_exec_prepare_obj(&p->exec, &p->uf_bo->tbo.base,
> + 1 + p->gang_size);
> + drm_exec_retry_on_contention(&p->exec);
> + if (unlikely(r))
> + goto out_free_user_pages;
> + }
> }
next prev parent reply other threads:[~2023-06-29 8:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-28 10:44 AMDGPU patches for the drm_exec context Christian König
2023-06-28 10:44 ` [PATCH 1/6] drm: execution context for GEM buffers v6 Christian König
2023-06-28 10:44 ` [PATCH 2/6] drm: add drm_exec selftests v4 Christian König
2023-06-28 10:44 ` [PATCH 3/6] drm/amdkfd: switch over to using drm_exec v2 Christian König
2023-06-28 10:44 ` [PATCH 4/6] drm/amdgpu: use drm_exec for GEM and CSA handling Christian König
2023-06-29 8:20 ` Tatsuyuki Ishi
2023-06-28 10:44 ` [PATCH 5/6] drm/amdgpu: use drm_exec for MES testing Christian König
2023-06-28 10:44 ` [PATCH 6/6] drm/amdgpu: use the new drm_exec object for CS v2 Christian König
2023-06-29 8:20 ` Tatsuyuki Ishi [this message]
2023-06-29 13:58 ` 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=17e929a5-d94f-8370-6aad-cf93490c6ad7@gmail.com \
--to=ishitatsuyuki@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=ckoenig.leichtzumerken@gmail.com \
--cc=dri-devel@lists.freedesktop.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;
as well as URLs for NNTP newsgroup(s).