dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org,
	linux-media@vger.kernel.org, intel-gfx@lists.freedesktop.org,
	daniel@ffwll.ch
Subject: [PATCH 2/5] drm/ttm: remove the backing store if no placement is given
Date: Mon, 17 Feb 2020 16:45:06 +0100	[thread overview]
Message-ID: <20200217154509.2265-3-christian.koenig@amd.com> (raw)
In-Reply-To: <20200217154509.2265-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 229205e499db..a56cb2a2b4ad 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -1225,6 +1225,18 @@ int ttm_bo_validate(struct ttm_buffer_object *bo,
 	uint32_t new_flags;
 
 	dma_resv_assert_held(bo->base.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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2020-02-17 15:45 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-17 15:45 RFC: Unpinned DMA-buf handling Christian König
2020-02-17 15:45 ` [PATCH 1/5] dma-buf: add dynamic DMA-buf handling v14 Christian König
2020-02-17 15:50   ` Christian König
2020-02-17 15:45 ` Christian König [this message]
2020-02-17 15:45 ` [PATCH 3/5] drm/amdgpu: use allowed_domains for exported DMA-bufs Christian König
2020-02-17 15:45 ` [PATCH 4/5] drm/amdgpu: add amdgpu_dma_buf_pin/unpin v2 Christian König
2020-02-17 15:45 ` [PATCH 5/5] drm/amdgpu: implement amdgpu_gem_prime_move_notify v2 Christian König
2020-02-17 17:55   ` Daniel Vetter
2020-02-17 18:58     ` Christian König
2020-02-17 19:38       ` Daniel Vetter
2020-02-18 10:42         ` Christian König
2020-02-18 20:17     ` Thomas Hellström (VMware)
2020-02-18 21:01       ` Daniel Vetter
2020-02-19  6:42         ` Thomas Hellström (VMware)
2020-02-20  9:39           ` Thomas Hellström (VMware)
2020-02-20 18:04             ` Daniel Vetter
2020-02-20 19:46               ` Thomas Hellström (VMware)
2020-02-20 20:08                 ` Daniel Vetter
2020-02-20 22:51                   ` Thomas Hellström (VMware)
2020-02-21 17:12                     ` Daniel Vetter
2020-02-21 19:45                       ` Thomas Hellström (VMware)
2020-02-23 15:45                       ` Christian König
2020-02-23 16:54                         ` Thomas Hellström (VMware)
2020-02-24 18:46                           ` Christian König
2020-02-24 21:11                             ` Thomas Hellström (VMware)
2020-02-25 17:16                             ` Daniel Vetter
2020-02-26 16:32                               ` Daniel Vetter
2020-02-27  9:20                                 ` Christian König
2020-02-27  9:38                                   ` Daniel Vetter
  -- strict thread matches above, loose matches on Subject: below --
2019-10-29 10:40 RFC: Unpinned DMA-buf handling Christian König
2019-10-29 10:40 ` [PATCH 2/5] 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=20200217154509.2265-3-christian.koenig@amd.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-media@vger.kernel.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).