From: Ben Widawsky <benjamin.widawsky@intel.com>
To: Intel GFX <intel-gfx@lists.freedesktop.org>
Cc: Ben Widawsky <ben@bwidawsk.net>,
Ben Widawsky <benjamin.widawsky@intel.com>
Subject: [PATCH 2/5] drm/i915: bind m&f cleanup
Date: Fri, 9 Aug 2013 22:12:13 -0700 [thread overview]
Message-ID: <1376111536-12461-2-git-send-email-benjamin.widawsky@intel.com> (raw)
In-Reply-To: <1376111536-12461-1-git-send-email-benjamin.widawsky@intel.com>
Cleanup the map and fenceable setting during bind to make more sense,
and not check i915_is_ggtt() 2 unnecessary times
Recommended-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
drivers/gpu/drm/i915/i915_gem.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index b91a7f0..a60c773 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3173,18 +3173,16 @@ search_free:
list_move_tail(&obj->global_list, &dev_priv->mm.bound_list);
list_add_tail(&vma->mm_list, &vm->inactive_list);
- fenceable =
- i915_is_ggtt(vm) &&
- i915_gem_obj_ggtt_size(obj) == fence_size &&
- (i915_gem_obj_ggtt_offset(obj) & (fence_alignment - 1)) == 0;
+ if (i915_is_ggtt(vm)) {
+ fenceable =
+ i915_gem_obj_ggtt_size(obj) == fence_size &&
+ (i915_gem_obj_ggtt_offset(obj) & (fence_alignment - 1)) == 0;
- mappable =
- i915_is_ggtt(vm) &&
- vma->node.start + obj->base.size <= dev_priv->gtt.mappable_end;
+ mappable =
+ vma->node.start + obj->base.size <= dev_priv->gtt.mappable_end;
- /* Map and fenceable only changes if the VM is the global GGTT */
- if (i915_is_ggtt(vm))
obj->map_and_fenceable = mappable && fenceable;
+ }
WARN_ON(map_and_fenceable & !obj->map_and_fenceable);
--
1.8.3.4
next prev parent reply other threads:[~2013-08-10 5:22 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-10 5:12 [PATCH 1/5] drm/i915: WARN_ON failed map_and_fenceable Ben Widawsky
2013-08-10 5:12 ` Ben Widawsky [this message]
2013-08-10 8:41 ` [PATCH 2/5] drm/i915: bind m&f cleanup Chris Wilson
2013-08-13 0:17 ` Ben Widawsky
2013-08-10 5:12 ` [PATCH 3/5] drm/i915: Remove node only when allocated Ben Widawsky
2013-08-10 8:45 ` Chris Wilson
2013-08-13 1:37 ` Ben Widawsky
2013-08-10 5:12 ` [PATCH 4/5] drm: WARN when removing unallocated node Ben Widawsky
2013-08-10 8:48 ` Chris Wilson
2013-08-10 5:12 ` [PATCH 5/5] drm/i915: Convert execbuf code to use vmas Ben Widawsky
2013-08-10 9:01 ` Chris Wilson
2013-08-10 9:10 ` Chris Wilson
2013-08-10 9:13 ` Chris Wilson
2013-08-13 1:50 ` Ben Widawsky
2013-08-10 8:43 ` [PATCH 1/5] drm/i915: WARN_ON failed map_and_fenceable Chris Wilson
2013-08-10 8:58 ` Daniel Vetter
2013-08-10 8:58 ` Daniel Vetter
2013-08-10 17:17 ` Ben Widawsky
2013-08-10 18:05 ` Daniel Vetter
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=1376111536-12461-2-git-send-email-benjamin.widawsky@intel.com \
--to=benjamin.widawsky@intel.com \
--cc=ben@bwidawsk.net \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox