public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	amd-gfx@lists.freedesktop.org
Subject: [PATCH 2/6] drm/ttm: remove the backing store if no placement is given
Date: Tue, 18 Jun 2019 13:54:51 +0200	[thread overview]
Message-ID: <20190618115455.1253-2-christian.koenig@amd.com> (raw)
In-Reply-To: <20190618115455.1253-1-christian.koenig@amd.com>

Pipeline removal of the BOs backing store when no placement is given
during validation.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/ttm/ttm_bo.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index c7de667d482a..682a1a035b35 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -1240,6 +1240,18 @@ int ttm_bo_validate(struct ttm_buffer_object *bo,
 	uint32_t new_flags;
 
 	reservation_object_assert_held(bo->resv);
+
+	/*
+	 * Remove the backing store if no placement is given.
+	 */
+	if (!placement->num_placement && !placement->num_busy_placement) {
+		ret = ttm_bo_pipeline_gutting(bo);
+		if (ret)
+			return ret;
+
+		return ttm_tt_create(bo, false);
+	}
+
 	/*
 	 * Check whether we need to move buffer.
 	 */
-- 
2.17.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-06-18 11:54 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-18 11:54 [PATCH 1/6] dma-buf: add dynamic DMA-buf handling v10 Christian König
2019-06-18 11:54 ` Christian König [this message]
2019-06-18 11:54 ` [PATCH 3/6] drm/ttm: use the parent resv for ghost objects v2 Christian König
     [not found] ` <20190618115455.1253-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2019-06-18 11:54   ` [PATCH 4/6] drm/amdgpu: use allowed_domains for exported DMA-bufs Christian König
2019-06-18 11:54 ` [PATCH 5/6] drm/amdgpu: add independent DMA-buf export v6 Christian König
2019-06-18 11:54 ` [PATCH 6/6] drm/amdgpu: add independent DMA-buf import v6 Christian König
2019-06-18 12:28 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/6] dma-buf: add dynamic DMA-buf handling v10 Patchwork
2019-06-18 12:30 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-06-18 13:29 ` ✓ Fi.CI.BAT: success " Patchwork
2019-06-19 13:48   ` Christian König
2019-06-19  0:33 ` ✓ Fi.CI.IGT: " Patchwork
2019-06-21  9:20 ` [Intel-gfx] [PATCH 1/6] " Daniel Vetter
     [not found]   ` <20190621092022.GB12905-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2019-06-21  9:55     ` Christian König
2019-06-21 10:32       ` Daniel Vetter
2019-06-21 12:06         ` Christian König
     [not found]           ` <78db8951-2e62-2a9d-3d87-3b458fbba880-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-06-21 16:27             ` [Intel-gfx] " Daniel Vetter
     [not found]               ` <20190621162753.GI12905-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2019-06-24 11:23                 ` Koenig, Christian
2019-06-24 13:58                   ` Christian König
2019-06-24 14:41                     ` Daniel Vetter
2019-06-25  7:20                       ` Koenig, Christian
     [not found]                         ` <d2933e7a-5dd1-70af-cbb6-69755fcbbc5e-5C7GfCeVMHo@public.gmane.org>
2019-06-25  7:40                           ` [Intel-gfx] " Daniel Vetter
     [not found]                   ` <4d868c4c-cc00-bfa9-b6f5-969b76497cab-5C7GfCeVMHo@public.gmane.org>
2019-06-24 14:38                     ` Daniel Vetter
  -- strict thread matches above, loose matches on Subject: below --
2019-06-26 12:23 [PATCH 1/6] dma-buf: add dynamic DMA-buf handling v13 Christian König
     [not found] ` <20190626122310.1498-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2019-06-26 12:23   ` [PATCH 2/6] drm/ttm: remove the backing store if no placement is given Christian König
2019-06-25 12:46 [PATCH 1/6] dma-buf: add dynamic DMA-buf handling v12 Christian König
2019-06-25 12:46 ` [PATCH 2/6] drm/ttm: remove the backing store if no placement is given Christian König
2019-06-24 13:58 [PATCH 1/6] dma-buf: add dynamic DMA-buf handling v11 Christian König
     [not found] ` <20190624135839.1661-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2019-06-24 13:58   ` [PATCH 2/6] drm/ttm: remove the backing store if no placement is given Christian König
2019-06-17 11:34 [PATCH 1/6] dma-buf: add dynamic DMA-buf handling v10 Christian König
2019-06-17 11:34 ` [PATCH 2/6] drm/ttm: remove the backing store if no placement is given Christian König
2019-06-07 12:50 [PATCH 1/6] dma-buf: add dynamic DMA-buf handling v9 Christian König
2019-06-07 12:50 ` [PATCH 2/6] drm/ttm: remove the backing store if no placement is given 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=20190618115455.1253-2-christian.koenig@amd.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@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