All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Ben Widawsky <benjamin.widawsky@intel.com>
Subject: [PATCH 7/9] drm/i915: Simplify i915_gem_object_ggtt_unpin
Date: Mon, 27 Jan 2014 19:10:57 +0100	[thread overview]
Message-ID: <1390846259-14915-8-git-send-email-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <1390846259-14915-1-git-send-email-daniel.vetter@ffwll.ch>

Split out from Chris vma-bind rework.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_drv.h | 10 ++++++++--
 drivers/gpu/drm/i915/i915_gem.c | 20 --------------------
 2 files changed, 8 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index dcab2b0a09ef..13991b8ce602 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2037,9 +2037,7 @@ int __must_check i915_gem_object_pin(struct drm_i915_gem_object *obj,
 				     struct i915_address_space *vm,
 				     uint32_t alignment,
 				     unsigned flags);
-void i915_gem_object_ggtt_unpin(struct drm_i915_gem_object *obj);
 int __must_check i915_vma_unbind(struct i915_vma *vma);
-int __must_check i915_gem_object_ggtt_unbind(struct drm_i915_gem_object *obj);
 int i915_gem_object_put_pages(struct drm_i915_gem_object *obj);
 void i915_gem_release_all_mmaps(struct drm_i915_private *dev_priv);
 void i915_gem_release_mmap(struct drm_i915_gem_object *obj);
@@ -2244,6 +2242,14 @@ i915_gem_obj_ggtt_pin(struct drm_i915_gem_object *obj,
 	return i915_gem_object_pin(obj, obj_to_ggtt(obj), alignment, flags | PIN_GLOBAL);
 }
 
+static inline int
+i915_gem_object_ggtt_unbind(struct drm_i915_gem_object *obj)
+{
+	return i915_vma_unbind(i915_gem_obj_to_ggtt(obj));
+}
+
+void i915_gem_object_ggtt_unpin(struct drm_i915_gem_object *obj);
+
 /* i915_gem_context.c */
 #define ctx_to_ppgtt(ctx) container_of((ctx)->vm, struct i915_hw_ppgtt, base)
 int __must_check i915_gem_context_init(struct drm_device *dev);
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 9f4dab7df5c0..680b300d7454 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2814,26 +2814,6 @@ int i915_vma_unbind(struct i915_vma *vma)
 	return 0;
 }
 
-/**
- * Unbinds an object from the global GTT aperture.
- */
-int
-i915_gem_object_ggtt_unbind(struct drm_i915_gem_object *obj)
-{
-	struct drm_i915_private *dev_priv = obj->base.dev->dev_private;
-	struct i915_address_space *ggtt = &dev_priv->gtt.base;
-
-	if (!i915_gem_obj_ggtt_bound(obj))
-		return 0;
-
-	if (i915_gem_obj_to_ggtt(obj)->pin_count)
-		return -EBUSY;
-
-	BUG_ON(obj->pages == NULL);
-
-	return i915_vma_unbind(i915_gem_obj_to_vma(obj, ggtt));
-}
-
 int i915_gpu_idle(struct drm_device *dev)
 {
 	drm_i915_private_t *dev_priv = dev->dev_private;
-- 
1.8.5.2

  parent reply	other threads:[~2014-01-27 18:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-27 18:10 Split-up of "drm/i915: Only bind each object rather than for every execbuffer" Daniel Vetter
2014-01-27 18:10 ` [PATCH 1/9] drm/i915: Consolidate binding parameters into flags Daniel Vetter
2014-01-27 21:47   ` Chris Wilson
2014-01-27 21:55     ` Daniel Vetter
2014-01-27 22:34   ` [PATCH] " Daniel Vetter
2014-01-28 13:09     ` Jani Nikula
2014-01-27 18:10 ` [PATCH 2/9] drm/i915: Don't set PIN_MAPPABLE for legacy ringbuffers Daniel Vetter
2014-01-27 18:10 ` [PATCH 3/9] drm/i915: Don't pin the status page as mappable Daniel Vetter
2014-01-27 18:10 ` [PATCH 4/9] drm/i915: Handle set_cache_level errors in the status page setup Daniel Vetter
2014-01-28 13:11   ` Jani Nikula
2014-01-27 18:10 ` [PATCH 5/9] drm/i915: Don't allocate context pages as mappable Daniel Vetter
2014-01-27 18:10 ` [PATCH 6/9] drm/i915: Allow blocking in the PDE alloc when running low on gtt space Daniel Vetter
2014-01-27 18:10 ` Daniel Vetter [this message]
2014-01-28 13:13   ` [PATCH 7/9] drm/i915: Simplify i915_gem_object_ggtt_unpin Jani Nikula
2014-01-28 14:21     ` Chris Wilson
2014-01-27 18:10 ` [PATCH 8/9] drm/i915: Directly return the vma from bind_to_vm Daniel Vetter
2014-01-28 13:21   ` Jani Nikula
2014-01-27 18:10 ` [PATCH 9/9] drm/i915: Only bind each object rather than for every execbuffer Daniel Vetter
2014-01-27 22:36   ` [PATCH] " Daniel Vetter
2014-01-28 13:29 ` Split-up of "drm/i915: Only bind each object rather than for every execbuffer" Jani Nikula

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=1390846259-14915-8-git-send-email-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=benjamin.widawsky@intel.com \
    --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 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.