From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: "Christian König" <ckoenig.leichtzumerken@gmail.com>,
matthew.auld@intel.com, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 01/10] drm/ttm: allocate resource object instead of embedding it v2
Date: Tue, 8 Jun 2021 08:55:53 +0200 [thread overview]
Message-ID: <dbc63965-d96c-1ebe-e198-d110129bf581@linux.intel.com> (raw)
In-Reply-To: <20210602100914.46246-1-christian.koenig@amd.com>
Hi,
On 6/2/21 12:09 PM, Christian König wrote:
> To improve the handling we want the establish the resource object as base
> class for the backend allocations.
>
> v2: add missing error handling
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 +-
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 54 +++++++-------
> drivers/gpu/drm/nouveau/nouveau_bo.c | 2 +-
> drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
> drivers/gpu/drm/ttm/ttm_bo.c | 83 ++++++++--------------
> drivers/gpu/drm/ttm/ttm_bo_util.c | 43 ++++++-----
> drivers/gpu/drm/ttm/ttm_resource.c | 31 +++++---
> drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 2 +-
> include/drm/ttm/ttm_bo_api.h | 1 -
> include/drm/ttm/ttm_bo_driver.h | 10 ++-
> include/drm/ttm/ttm_resource.h | 4 +-
> 11 files changed, 110 insertions(+), 126 deletions(-)
...
>
> @@ -629,7 +628,7 @@ static void ttm_bo_move_pipeline_evict(struct ttm_buffer_object *bo,
> }
> spin_unlock(&from->move_lock);
>
> - ttm_resource_free(bo, bo->resource);
> + ttm_resource_free(bo, &bo->resource);
>
> dma_fence_put(bo->moving);
> bo->moving = dma_fence_get(fence);
> @@ -678,11 +677,11 @@ int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo)
> if (ret)
> ttm_bo_wait(bo, false, false);
>
> - ttm_resource_alloc(bo, &sys_mem, bo->resource);
> + ret = ttm_resource_alloc(bo, &sys_mem, &bo->resource);
> bo->ttm = NULL;
>
> dma_resv_unlock(&ghost->base._resv);
> ttm_bo_put(ghost);
>
> - return 0;
> + return ret;
Here we re-introduce a late point of failure, which I guess leaves the
bo in an undefined state? Same thing with my optimization for the idle
case. Needs fixing as soon as possible.
/Thomas
prev parent reply other threads:[~2021-06-08 6:56 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-02 10:09 [PATCH 01/10] drm/ttm: allocate resource object instead of embedding it v2 Christian König
2021-06-02 10:09 ` [PATCH 02/10] drm/ttm: flip over the range manager to self allocated nodes Christian König
2021-06-02 11:44 ` Thomas Hellström (Intel)
2021-06-02 12:11 ` Christian König
2021-06-02 12:33 ` Thomas Hellström (Intel)
2021-06-02 13:07 ` Christian König
2021-06-02 14:13 ` Thomas Hellström (Intel)
2021-06-02 14:17 ` Christian König
2021-06-02 15:28 ` Thomas Hellström (Intel)
2021-06-02 18:41 ` Christian König
2021-06-02 18:52 ` Thomas Hellström (Intel)
2021-06-02 18:53 ` Christian König
2021-06-02 10:09 ` [PATCH 03/10] drm/ttm: flip over the sys " Christian König
2021-06-03 7:51 ` Matthew Auld
2021-06-02 10:09 ` [PATCH 04/10] drm/amdgpu: revert "drm/amdgpu: stop allocating dummy GTT nodes" Christian König
2021-06-02 10:09 ` [PATCH 05/10] drm/amdkfd: use resource cursor in svm_migrate_copy_to_vram v2 Christian König
2021-06-03 9:44 ` Matthew Auld
2021-06-02 10:09 ` [PATCH 06/10] drm/amdgpu: switch the GTT backend to self alloc Christian König
2021-06-02 10:09 ` [PATCH 07/10] drm/amdgpu: switch the VRAM " Christian König
2021-06-02 10:09 ` [PATCH 08/10] drm/nouveau: switch the TTM backends " Christian König
2021-06-02 10:09 ` [PATCH 09/10] drm/vmwgfx: " Christian König
2021-06-02 10:09 ` [PATCH 10/10] drm/ttm: flip the switch for driver allocated resources v2 Christian König
2021-06-07 10:15 ` Thomas Hellström (Intel)
2021-06-07 10:37 ` Christian König
2021-06-07 10:44 ` Thomas Hellström (Intel)
2021-06-03 8:45 ` [PATCH 01/10] drm/ttm: allocate resource object instead of embedding it v2 Matthew Auld
2021-06-04 11:54 ` Christian König
2021-06-04 9:33 ` Thomas Hellström (Intel)
2021-06-07 16:40 ` Thomas Hellström (Intel)
2021-06-07 17:06 ` Thomas Hellström (Intel)
2021-06-07 17:54 ` Christian König
2021-06-07 17:58 ` Thomas Hellström (Intel)
2021-06-07 17:59 ` Christian König
2021-06-08 5:29 ` Thomas Hellström (Intel)
2021-06-08 7:14 ` Christian König
2021-06-08 7:17 ` Thomas Hellström (Intel)
2021-06-08 7:21 ` Christian König
2021-06-08 9:38 ` Das, Nirmoy
2021-06-08 9:40 ` Das, Nirmoy
2021-06-08 9:42 ` Christian König
2021-06-08 9:48 ` Das, Nirmoy
2021-06-07 17:10 ` Christian König
2021-06-08 6:55 ` Thomas Hellström [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=dbc63965-d96c-1ebe-e198-d110129bf581@linux.intel.com \
--to=thomas.hellstrom@linux.intel.com \
--cc=ckoenig.leichtzumerken@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=matthew.auld@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox