All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH 09/12] drm/ttm: use the parent resv for ghost objects
Date: Fri, 26 Apr 2019 14:36:35 +0200	[thread overview]
Message-ID: <20190426123638.40221-9-christian.koenig@amd.com> (raw)
In-Reply-To: <20190426123638.40221-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

  parent reply	other threads:[~2019-04-26 12:36 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-26 12:36 [PATCH 01/12] dma-buf: add struct dma_buf_attach_info Christian König
2019-04-26 12:36 ` [PATCH 02/12] dma-buf: add explicit buffer pinning v2 Christian König
2019-04-29  8:40   ` Daniel Vetter
2019-04-30 13:42     ` Christian König
2019-04-30 13:59       ` Daniel Vetter
2019-04-30 14:26         ` Christian König
2019-04-30 14:34           ` Daniel Vetter
2019-04-30 14:41             ` Koenig, Christian
2019-04-30 15:22               ` Daniel Vetter
2019-04-26 12:36 ` [PATCH 03/12] dma-buf: start caching of sg_table objects Christian König
2019-04-29  8:54   ` Daniel Vetter
2019-04-30 14:18   ` Daniel Vetter
2019-04-26 12:36 ` [PATCH 04/12] dma-buf: lock the reservation object during (un)map_dma_buf v4 Christian König
2019-04-26 12:36 ` [PATCH 05/12] dma-buf: add dma_buf_(un)map_attachment_locked variants v4 Christian König
2019-04-26 12:36 ` [PATCH 06/12] dma-buf: add optional invalidate_mappings callback v5 Christian König
2019-04-29  8:42   ` Daniel Vetter
2019-04-26 12:36 ` [PATCH 07/12] drm: remove prime sg_table caching Christian König
2019-04-26 12:36 ` [PATCH 08/12] drm/ttm: remove the backing store if no placement is given Christian König
2019-04-26 12:36 ` Christian König [this message]
2019-04-26 12:36 ` [PATCH 10/12] drm/amdgpu: add independent DMA-buf export v3 Christian König
2019-04-30 14:16   ` Daniel Vetter
2019-05-03 12:35     ` Christian König
2019-05-06  8:04       ` Daniel Vetter
2019-05-06 10:05         ` Koenig, Christian
2019-05-06 15:10           ` Daniel Vetter
2019-04-26 12:36 ` [PATCH 11/12] drm/amdgpu: add independent DMA-buf import v4 Christian König
2019-04-26 12:36 ` [PATCH 12/12] drm/amdgpu: add DMA-buf invalidation callback v2 Christian König
2019-04-29  8:24 ` [PATCH 01/12] dma-buf: add struct dma_buf_attach_info Daniel Vetter
2019-04-30 12:40   ` 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=20190426123638.40221-9-christian.koenig@amd.com \
    --to=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 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.