From: Jani Nikula <jani.nikula@linux.intel.com>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
Ben Widawsky <benjamin.widawsky@intel.com>
Subject: Re: [PATCH] drm/i915: Consolidate binding parameters into flags
Date: Tue, 28 Jan 2014 15:09:42 +0200 [thread overview]
Message-ID: <87lhy045ih.fsf@intel.com> (raw)
In-Reply-To: <1390862093-12195-1-git-send-email-daniel.vetter@ffwll.ch>
On Tue, 28 Jan 2014, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> Anything more than just one bool parameter is just a pain to read,
> symbolic constants are much better.
>
> Split out from Chris' vma-binding rework patch.
>
> v2: Undo the behaviour change in object_pin that Chris spotted.
>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Ben Widawsky <benjamin.widawsky@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
[snip]
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index 032def901f98..9399a6fa4c2f 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -544,19 +544,23 @@ i915_gem_execbuffer_reserve_vma(struct i915_vma *vma,
> struct drm_i915_gem_object *obj = vma->obj;
> struct drm_i915_gem_exec_object2 *entry = vma->exec_entry;
> bool has_fenced_gpu_access = INTEL_INFO(ring->dev)->gen < 4;
> - bool need_fence, need_mappable;
> - u32 flags = (entry->flags & EXEC_OBJECT_NEEDS_GTT) &&
> - !vma->obj->has_global_gtt_mapping ? GLOBAL_BIND : 0;
> + bool need_fence;
> + unsigned flags;
> int ret;
>
> + flags = 0;
> +
> need_fence =
> has_fenced_gpu_access &&
> entry->flags & EXEC_OBJECT_NEEDS_FENCE &&
> obj->tiling_mode != I915_TILING_NONE;
> - need_mappable = need_fence || need_reloc_mappable(vma);
> + if (need_fence || need_reloc_mappable(vma))
> + flags |= PIN_MAPPABLE;
> +
> + if (entry->flags & EXEC_OBJECT_NEEDS_GTT)
> + flags |= PIN_GLOBAL;
It is not obvious to me that this together with the PIN_GLOBAL handling
in i915_gem_object_pin() do not introduce a functional change. (Stress
on obvious to _me_; it may be obvious to you.)
I would have thought it better to first change the two bool parameters
to two flags, and then add the new flag in a separate patch to not
confuse poor reviewers like myself.
[snip]
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> index d897a19f887f..a0793c929b95 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> @@ -531,9 +531,11 @@ init_pipe_control(struct intel_ring_buffer *ring)
> goto err;
> }
>
> - i915_gem_object_set_cache_level(ring->scratch.obj, I915_CACHE_LLC);
> + ret = i915_gem_object_set_cache_level(ring->scratch.obj, I915_CACHE_LLC);
> + if (ret)
> + goto err_unref;
This should be split out from the patch just like patch 4/9.
BR,
Jani.
--
Jani Nikula, Intel Open Source Technology Center
next prev parent reply other threads:[~2014-01-28 13:06 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 [this message]
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 ` [PATCH 7/9] drm/i915: Simplify i915_gem_object_ggtt_unpin Daniel Vetter
2014-01-28 13:13 ` 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=87lhy045ih.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=benjamin.widawsky@intel.com \
--cc=daniel.vetter@ffwll.ch \
--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