All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chunming Zhou <david1.zhou@amd.com>
To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: christian.koenig@amd.com
Subject: [PATCH 2/2] [WIP]drm/amdgpu: fix scheduling balance
Date: Fri, 26 Jan 2018 18:22:47 +0800	[thread overview]
Message-ID: <20180126102247.17923-2-david1.zhou@amd.com> (raw)
In-Reply-To: <20180126102247.17923-1-david1.zhou@amd.com>

Change-Id: I6535023db57d4ff5e79f7928595bf8ff1f60f23f
Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c  | 4 ++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
index 7abc1f3251ea..5bed3d8e364a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
@@ -173,6 +173,10 @@ static int amdgpu_gtt_mgr_new(struct ttm_mem_type_manager *man,
 		spin_unlock(&mgr->lock);
 		return 0;
 	}
+	if (!ttm_man_check_bo(man, tbo, place)) {
+		spin_unlock(&mgr->lock);
+		return 0;
+	}
 	atomic64_sub(mem->num_pages, &mgr->available);
 	spin_unlock(&mgr->lock);
 
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
index 9aca653bec07..7202599bb67f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
@@ -121,6 +121,9 @@ static int amdgpu_vram_mgr_new(struct ttm_mem_type_manager *man,
 	unsigned i;
 	int r;
 
+	if (!ttm_man_check_bo(man, tbo, place))
+		return 0;
+
 	lpfn = place->lpfn;
 	if (!lpfn)
 		lpfn = man->size;
-- 
2.14.1

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

  reply	other threads:[~2018-01-26 10:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-26 10:22 [PATCH 1/2] [WIP]drm/ttm: add waiter list to prevent allocation not in order Chunming Zhou
2018-01-26 10:22 ` Chunming Zhou [this message]
2018-01-26 10:31 ` Christian König
2018-01-26 12:36   ` Zhou, David(ChunMing)
     [not found]   ` <2beeea26-9426-6956-fbc7-ada52088b6a6-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-26 12:36     ` Zhou, David(ChunMing)
     [not found]   ` <5a6b20fc.024e650a.6778d.4aafSMTPIN_ADDED_BROKEN@mx.google.com>
     [not found]     ` <5a6b20fc.024e650a.6778d.4aafSMTPIN_ADDED_BROKEN-ATjtLOhZ0NVl57MIdRCFDg@public.gmane.org>
2018-01-26 12:43       ` Christian König
     [not found]         ` <b1a6305e-1ff8-430b-8b72-c08d469de73b-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-26 13:04           ` Christian König
     [not found]             ` <8ba40eb5-095b-2a95-d73a-16c141eb64a9-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-26 13:21               ` Zhou, David(ChunMing)
2018-01-26 13:21             ` Zhou, David(ChunMing)
     [not found]             ` <5a6b2b4c.c441650a.c40de.5db1SMTPIN_ADDED_BROKEN@mx.google.com>
2018-01-26 13:24               ` Christian König
     [not found]                 ` <acdfee36-ae2f-b90f-cab7-ebe8fd40fbd6-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-26 13:50                   ` Zhou, David(ChunMing)
2018-01-26 13:50                 ` Zhou, David(ChunMing)
2018-01-26 13:59                 ` Christian König
2018-01-26 14:35                   ` Christian König
     [not found]                     ` <a6d78bba-bbe9-769b-f9d3-665cdd8c04da-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-31 10:30                       ` Chunming Zhou
     [not found]                         ` <cdb7726b-a82d-494c-a98c-ca0100f323cc-5C7GfCeVMHo@public.gmane.org>
2018-01-31 10:54                           ` Christian König
2018-02-05  8:22                             ` Chunming Zhou
     [not found]                               ` <d2ec14e8-d4cd-a312-5e23-ef2e2198d6ea-5C7GfCeVMHo@public.gmane.org>
2018-02-05 12:21                                 ` 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=20180126102247.17923-2-david1.zhou@amd.com \
    --to=david1.zhou@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.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.