From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/i915: Only mark as map-and-fenceable when bound into the GGTT
Date: Mon, 3 Nov 2014 16:17:57 +0100 [thread overview]
Message-ID: <20141103151757.GS26941@phenom.ffwll.local> (raw)
In-Reply-To: <1414763633-20399-1-git-send-email-chris@chris-wilson.co.uk>
On Fri, Oct 31, 2014 at 01:53:52PM +0000, Chris Wilson wrote:
> @@ -4091,6 +4078,7 @@ i915_gem_object_pin(struct drm_i915_gem_object *obj,
> }
> }
>
> + bound = vma ? vma->bound : 0;
> if (vma == NULL || !drm_mm_node_allocated(&vma->node)) {
> vma = i915_gem_object_bind_to_vm(obj, vm, alignment, flags);
> if (IS_ERR(vma))
> @@ -4100,6 +4088,29 @@ i915_gem_object_pin(struct drm_i915_gem_object *obj,
> if (flags & PIN_GLOBAL && !(vma->bound & GLOBAL_BIND))
> vma->bind_vma(vma, obj->cache_level, GLOBAL_BIND);
>
> + if ((bound ^ vma->bound) & GLOBAL_BIND) {
Shouldn't we have a && i915_is_ggtt(vma->vm) check here too?
Then we could just look at the vma's drm_mm node instead of jumping
through the helpers here. Which gets us one inch closer to tracking
mappable in the ggtt vma, without increasing the diff ;-)
-Daniel
> + bool mappable, fenceable;
> + u32 fence_size, fence_alignment;
> +
> + fence_size = i915_gem_get_gtt_size(obj->base.dev,
> + obj->base.size,
> + obj->tiling_mode);
> + fence_alignment = i915_gem_get_gtt_alignment(obj->base.dev,
> + obj->base.size,
> + obj->tiling_mode,
> + true);
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2014-11-03 15:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-31 13:53 [PATCH 1/2] drm/i915: Only mark as map-and-fenceable when bound into the GGTT Chris Wilson
2014-10-31 13:53 ` [PATCH 2/2] drm/i915: Request PIN_GLOBAL when pinning a vma for GTT relocations Chris Wilson
2014-11-03 15:20 ` Daniel Vetter
2014-11-03 20:49 ` Chris Wilson
2014-11-04 9:21 ` Daniel Vetter
2014-11-04 10:23 ` Daniel Vetter
2014-11-03 8:13 ` [PATCH 1/2] drm/i915: Only mark as map-and-fenceable when bound into the GGTT Chris Wilson
2014-11-03 15:17 ` Daniel Vetter [this message]
2014-11-03 20:45 ` Chris Wilson
2014-11-03 20:52 ` Chris Wilson
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=20141103151757.GS26941@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=chris@chris-wilson.co.uk \
--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