All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH 5/7] drm/amdgpu: don't allocate zero sized kernel BOs
Date: Fri, 14 Sep 2018 21:12:44 +0200	[thread overview]
Message-ID: <20180914191246.1609-5-christian.koenig@amd.com> (raw)
In-Reply-To: <20180914191246.1609-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>

Just free the BO if the size is should be zero.

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

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index e1f32a196f6d..d282e923d1b4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -250,6 +250,11 @@ int amdgpu_bo_create_reserved(struct amdgpu_device *adev,
 	bool free = false;
 	int r;
 
+	if (!size) {
+		amdgpu_bo_unref(bo_ptr);
+		return 0;
+	}
+
 	memset(&bp, 0, sizeof(bp));
 	bp.size = size;
 	bp.byte_align = align;
-- 
2.14.1

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

  parent reply	other threads:[~2018-09-14 19:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-14 19:12 [PATCH 1/7] drm/amdgpu: add GDS, GWS and OA debugfs files Christian König
     [not found] ` <20180914191246.1609-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-09-14 19:12   ` [PATCH 2/7] drm/amdgpu: fix up GDS/GWS/OA shifting Christian König
     [not found]     ` <20180914191246.1609-2-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-09-14 20:26       ` Alex Deucher
     [not found]         ` <CADnq5_PjhBf1_DB6bgTiafPf=DE_g3AY+FsuZ0pj+4VDNPhRJg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-09-15  7:52           ` Christian König
     [not found]             ` <aac8a166-b879-2694-6938-f7104f1903b9-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-09-17 12:27               ` Christian König
2018-09-17 14:32               ` Deucher, Alexander
2018-09-14 19:12   ` [PATCH 3/7] drm/amdgpu: stop crashing on GDS/GWS/OA eviction Christian König
     [not found]     ` <20180914191246.1609-3-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-09-14 20:07       ` Alex Deucher
2018-09-14 19:12   ` [PATCH 4/7] drm/amdgpu: initialize GDS/GWS/OA domains even when they are zero sized Christian König
     [not found]     ` <20180914191246.1609-4-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-09-14 20:14       ` Alex Deucher
     [not found]         ` <CADnq5_OEi6MBaHp7qx_0dS9SbxCrXiyKPSx5xKdq-3FwtTBsNg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-09-17 12:25           ` Christian König
2018-09-14 19:12   ` Christian König [this message]
     [not found]     ` <20180914191246.1609-5-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-09-14 20:16       ` [PATCH 5/7] drm/amdgpu: don't allocate zero sized kernel BOs Alex Deucher
2018-09-14 19:12   ` [PATCH 6/7] drm/amdgpu: drop size check Christian König
     [not found]     ` <20180914191246.1609-6-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-09-14 20:17       ` Alex Deucher
2018-09-14 19:12   ` [PATCH 7/7] drm/amdgpu: move reserving GDS/GWS/OA into common code Christian König
     [not found]     ` <20180914191246.1609-7-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-09-14 20:18       ` Alex Deucher
2018-09-14 20:07   ` [PATCH 1/7] drm/amdgpu: add GDS, GWS and OA debugfs files Alex Deucher

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=20180914191246.1609-5-christian.koenig@amd.com \
    --to=ckoenig.leichtzumerken-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.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.