All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdgpu: drop multiple bo_unreserve() calls in amdgpu_gem_op_ioctl()
@ 2017-02-09 22:28 Samuel Pitoiset
       [not found] ` <20170209222824.3267-1-samuel.pitoiset-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 13+ messages in thread
From: Samuel Pitoiset @ 2017-02-09 22:28 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Samuel Pitoiset

Move amdgpu_bo_unreserve() outside of the switch. While we are
at it, add a missing break in the default case.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index 1dc59aafec71..ae4658a10e2c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -660,7 +660,6 @@ int amdgpu_gem_op_ioctl(struct drm_device *dev, void *data,
 		info.alignment = robj->tbo.mem.page_alignment << PAGE_SHIFT;
 		info.domains = robj->prefered_domains;
 		info.domain_flags = robj->flags;
-		amdgpu_bo_unreserve(robj);
 		if (copy_to_user(out, &info, sizeof(info)))
 			r = -EFAULT;
 		break;
@@ -668,7 +667,6 @@ int amdgpu_gem_op_ioctl(struct drm_device *dev, void *data,
 	case AMDGPU_GEM_OP_SET_PLACEMENT:
 		if (amdgpu_ttm_tt_get_usermm(robj->tbo.ttm)) {
 			r = -EPERM;
-			amdgpu_bo_unreserve(robj);
 			break;
 		}
 		robj->prefered_domains = args->value & (AMDGPU_GEM_DOMAIN_VRAM |
@@ -677,14 +675,13 @@ int amdgpu_gem_op_ioctl(struct drm_device *dev, void *data,
 		robj->allowed_domains = robj->prefered_domains;
 		if (robj->allowed_domains == AMDGPU_GEM_DOMAIN_VRAM)
 			robj->allowed_domains |= AMDGPU_GEM_DOMAIN_GTT;
-
-		amdgpu_bo_unreserve(robj);
 		break;
 	default:
-		amdgpu_bo_unreserve(robj);
 		r = -EINVAL;
+		break;
 	}
 
+	amdgpu_bo_unreserve(robj);
 out:
 	drm_gem_object_unreference_unlocked(gobj);
 	return r;
-- 
2.11.1

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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-02-10 17:06 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-09 22:28 [PATCH 1/2] drm/amdgpu: drop multiple bo_unreserve() calls in amdgpu_gem_op_ioctl() Samuel Pitoiset
     [not found] ` <20170209222824.3267-1-samuel.pitoiset-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-02-09 22:28   ` [PATCH 2/2] drm/amdgpu: use amdgpu_gem_va_check() in amdgpu_gem_va_update_vm() Samuel Pitoiset
     [not found]     ` <20170209222824.3267-2-samuel.pitoiset-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-02-10  2:58       ` zhoucm1
2017-02-10 10:02       ` Christian König
2017-02-10 17:06       ` Alex Deucher
2017-02-10  2:55   ` [PATCH 1/2] drm/amdgpu: drop multiple bo_unreserve() calls in amdgpu_gem_op_ioctl() zhoucm1
     [not found]     ` <589D2B9C.309-5C7GfCeVMHo@public.gmane.org>
2017-02-10 10:11       ` Samuel Pitoiset
     [not found]         ` <0c47615f-6e93-eea1-418c-f846a0c1d3ae-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-02-10 10:19           ` Christian König
     [not found]             ` <f297f821-678a-392a-2786-0307dc7a54ad-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-02-10 10:22               ` Samuel Pitoiset
     [not found]                 ` <fcf33caf-41c4-5344-ede7-9be1cecf813c-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-02-10 10:37                   ` Christian König
     [not found]                     ` <185ea16c-7062-f137-2234-a19f845062a6-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-02-10 11:09                       ` Samuel Pitoiset
2017-02-10 10:02   ` Christian König
     [not found]     ` <35f1c55d-5ade-ffd0-6c9f-95fc891e1d77-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-02-10 10:17       ` Samuel Pitoiset

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.