From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: sumit.semwal@linaro.org, linux-media@vger.kernel.org,
dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org,
linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org
Subject: [PATCH 08/12] drm/ttm: use the parent resv for ghost objects
Date: Tue, 16 Apr 2019 20:38:37 +0200 [thread overview]
Message-ID: <20190416183841.1577-9-christian.koenig@amd.com> (raw)
In-Reply-To: <20190416183841.1577-1-christian.koenig@amd.com>
This way we can even pipeline imported BO evictions.
Signed-off-by: Christian König <christian.koenig@amd.com>
---
drivers/gpu/drm/ttm/ttm_bo_util.c | 18 +-----------------
1 file changed, 1 insertion(+), 17 deletions(-)
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index 895d77d799e4..97f35c4bda35 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -486,7 +486,6 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
struct ttm_buffer_object **new_obj)
{
struct ttm_transfer_obj *fbo;
- int ret;
fbo = kmalloc(sizeof(*fbo), GFP_KERNEL);
if (!fbo)
@@ -517,10 +516,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
kref_init(&fbo->base.kref);
fbo->base.destroy = &ttm_transfered_destroy;
fbo->base.acc_size = 0;
- fbo->base.resv = &fbo->base.ttm_resv;
- reservation_object_init(fbo->base.resv);
- ret = reservation_object_trylock(fbo->base.resv);
- WARN_ON(!ret);
+ reservation_object_init(&fbo->base.ttm_resv);
*new_obj = &fbo->base;
return 0;
@@ -716,8 +712,6 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
if (ret)
return ret;
- reservation_object_add_excl_fence(ghost_obj->resv, fence);
-
/**
* If we're not moving to fixed memory, the TTM object
* needs to stay alive. Otherwhise hang it on the ghost
@@ -729,7 +723,6 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
else
bo->ttm = NULL;
- ttm_bo_unreserve(ghost_obj);
ttm_bo_put(ghost_obj);
}
@@ -772,8 +765,6 @@ int ttm_bo_pipeline_move(struct ttm_buffer_object *bo,
if (ret)
return ret;
- reservation_object_add_excl_fence(ghost_obj->resv, fence);
-
/**
* If we're not moving to fixed memory, the TTM object
* needs to stay alive. Otherwhise hang it on the ghost
@@ -785,7 +776,6 @@ int ttm_bo_pipeline_move(struct ttm_buffer_object *bo,
else
bo->ttm = NULL;
- ttm_bo_unreserve(ghost_obj);
ttm_bo_put(ghost_obj);
} else if (from->flags & TTM_MEMTYPE_FLAG_FIXED) {
@@ -841,16 +831,10 @@ int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo)
if (ret)
return ret;
- ret = reservation_object_copy_fences(ghost->resv, bo->resv);
- /* Last resort, wait for the BO to be idle when we are OOM */
- if (ret)
- ttm_bo_wait(bo, false, false);
-
memset(&bo->mem, 0, sizeof(bo->mem));
bo->mem.mem_type = TTM_PL_SYSTEM;
bo->ttm = NULL;
- ttm_bo_unreserve(ghost);
ttm_bo_put(ghost);
return 0;
--
2.17.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
WARNING: multiple messages have this Message-ID (diff)
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: sumit.semwal@linaro.org, linux-media@vger.kernel.org,
dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org,
linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org
Subject: [PATCH 08/12] drm/ttm: use the parent resv for ghost objects
Date: Tue, 16 Apr 2019 20:38:37 +0200 [thread overview]
Message-ID: <20190416183841.1577-9-christian.koenig@amd.com> (raw)
In-Reply-To: <20190416183841.1577-1-christian.koenig@amd.com>
This way we can even pipeline imported BO evictions.
Signed-off-by: Christian König <christian.koenig@amd.com>
---
drivers/gpu/drm/ttm/ttm_bo_util.c | 18 +-----------------
1 file changed, 1 insertion(+), 17 deletions(-)
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index 895d77d799e4..97f35c4bda35 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -486,7 +486,6 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
struct ttm_buffer_object **new_obj)
{
struct ttm_transfer_obj *fbo;
- int ret;
fbo = kmalloc(sizeof(*fbo), GFP_KERNEL);
if (!fbo)
@@ -517,10 +516,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
kref_init(&fbo->base.kref);
fbo->base.destroy = &ttm_transfered_destroy;
fbo->base.acc_size = 0;
- fbo->base.resv = &fbo->base.ttm_resv;
- reservation_object_init(fbo->base.resv);
- ret = reservation_object_trylock(fbo->base.resv);
- WARN_ON(!ret);
+ reservation_object_init(&fbo->base.ttm_resv);
*new_obj = &fbo->base;
return 0;
@@ -716,8 +712,6 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
if (ret)
return ret;
- reservation_object_add_excl_fence(ghost_obj->resv, fence);
-
/**
* If we're not moving to fixed memory, the TTM object
* needs to stay alive. Otherwhise hang it on the ghost
@@ -729,7 +723,6 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
else
bo->ttm = NULL;
- ttm_bo_unreserve(ghost_obj);
ttm_bo_put(ghost_obj);
}
@@ -772,8 +765,6 @@ int ttm_bo_pipeline_move(struct ttm_buffer_object *bo,
if (ret)
return ret;
- reservation_object_add_excl_fence(ghost_obj->resv, fence);
-
/**
* If we're not moving to fixed memory, the TTM object
* needs to stay alive. Otherwhise hang it on the ghost
@@ -785,7 +776,6 @@ int ttm_bo_pipeline_move(struct ttm_buffer_object *bo,
else
bo->ttm = NULL;
- ttm_bo_unreserve(ghost_obj);
ttm_bo_put(ghost_obj);
} else if (from->flags & TTM_MEMTYPE_FLAG_FIXED) {
@@ -841,16 +831,10 @@ int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo)
if (ret)
return ret;
- ret = reservation_object_copy_fences(ghost->resv, bo->resv);
- /* Last resort, wait for the BO to be idle when we are OOM */
- if (ret)
- ttm_bo_wait(bo, false, false);
-
memset(&bo->mem, 0, sizeof(bo->mem));
bo->mem.mem_type = TTM_PL_SYSTEM;
bo->ttm = NULL;
- ttm_bo_unreserve(ghost);
ttm_bo_put(ghost);
return 0;
--
2.17.1
next prev parent reply other threads:[~2019-04-16 18:38 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-16 18:38 dynamic DMA-buf sharing between devices Christian König
2019-04-16 18:38 ` Christian König
2019-04-16 18:38 ` [PATCH 01/12] dma-buf: add dynamic caching of sg_table Christian König
2019-04-16 18:38 ` [PATCH 02/12] dma-buf: add dma_buf_(un)map_attachment_locked variants v3 Christian König
2019-05-27 10:56 ` Christian König
2019-04-16 18:38 ` [PATCH 03/12] dma-buf: lock the reservation object during (un)map_dma_buf v3 Christian König
2019-04-16 18:38 ` Christian König
[not found] ` <20190416183841.1577-4-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2019-04-17 14:08 ` Daniel Vetter
2019-04-17 14:08 ` Daniel Vetter
2019-04-17 14:14 ` Christian König
2019-04-17 14:26 ` Daniel Vetter
2019-04-17 14:26 ` Daniel Vetter
[not found] ` <20190417142632.GF13337-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2019-04-17 17:10 ` Christian König
2019-04-17 17:10 ` Christian König
[not found] ` <20190416183841.1577-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2019-04-16 18:38 ` [PATCH 04/12] dma-buf: add optional invalidate_mappings callback v5 Christian König
2019-04-16 18:38 ` Christian König
[not found] ` <20190416183841.1577-5-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2019-04-17 14:01 ` Daniel Vetter
2019-04-17 14:01 ` Daniel Vetter
[not found] ` <20190417140116.GC13337-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2019-04-17 14:33 ` Daniel Vetter
2019-04-17 14:33 ` Daniel Vetter
2019-04-17 19:07 ` Daniel Vetter
2019-04-17 19:07 ` Daniel Vetter
2019-04-17 19:13 ` Christian König
2019-04-17 19:13 ` Christian König
2019-04-18 8:08 ` Daniel Vetter
[not found] ` <20190418080826.GN13337-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2019-04-18 8:28 ` Koenig, Christian
2019-04-18 8:28 ` Koenig, Christian
2019-04-18 8:40 ` Daniel Vetter
2019-04-18 8:40 ` Daniel Vetter
2019-04-16 18:38 ` [PATCH 05/12] dma-buf: add explicit buffer pinning Christian König
2019-04-16 18:38 ` Christian König
[not found] ` <20190416183841.1577-6-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2019-04-17 14:20 ` Daniel Vetter
2019-04-17 14:20 ` Daniel Vetter
[not found] ` <20190417142002.GE13337-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2019-04-17 14:30 ` Daniel Vetter
2019-04-17 14:30 ` Daniel Vetter
2019-04-17 14:40 ` Daniel Vetter
2019-04-17 19:05 ` Daniel Vetter
2019-04-19 19:05 ` Alex Deucher
2019-04-16 18:38 ` [PATCH 07/12] drm/ttm: remove the backing store if no placement is given Christian König
2019-04-16 18:38 ` Christian König
2019-04-16 18:38 ` [PATCH 11/12] drm/amdgpu: add DMA-buf pin/unpin implementation Christian König
2019-04-16 18:38 ` Christian König
2019-04-16 18:38 ` [PATCH 12/12] drm/amdgpu: add DMA-buf invalidation callback v2 Christian König
2019-04-16 18:38 ` Christian König
2019-04-17 13:52 ` dynamic DMA-buf sharing between devices Chunming Zhou
2019-04-17 13:52 ` Chunming Zhou
2019-04-17 13:59 ` Christian König
2019-04-17 14:14 ` Chunming Zhou
2019-04-16 18:38 ` [PATCH 06/12] drm: remove prime sg_table caching Christian König
2019-04-16 18:38 ` Christian König
2019-04-16 18:38 ` Christian König [this message]
2019-04-16 18:38 ` [PATCH 08/12] drm/ttm: use the parent resv for ghost objects Christian König
2019-04-16 18:38 ` [PATCH 09/12] drm/amdgpu: add independent DMA-buf export v3 Christian König
2019-04-16 18:38 ` [PATCH 10/12] drm/amdgpu: add independent DMA-buf import v4 Christian König
2019-04-18 9:13 ` dynamic DMA-buf sharing between devices Daniel Vetter
[not found] ` <20190418091315.GU13337-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2019-04-18 10:57 ` Christian König
2019-04-18 10:57 ` Christian König
2019-04-27 0:01 ` [PATCH 01/12] dma-buf: add dynamic caching of sg_table Liam Mark
2019-05-22 16:17 ` Sumit Semwal
2019-05-22 17:27 ` Christian König
2019-05-22 17:27 ` Christian König
2019-05-22 18:30 ` Daniel Vetter
2019-05-23 11:21 ` Koenig, Christian
2019-05-23 11:30 ` Daniel Vetter
2019-05-23 11:32 ` Daniel Vetter
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=20190416183841.1577-9-christian.koenig@amd.com \
--to=ckoenig.leichtzumerken@gmail.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=sumit.semwal@linaro.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 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.