From: Yu Dai <yu.dai@intel.com>
To: Dave Gordon <david.s.gordon@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 09/17 v2] drm/i915: Expose two LRC functions for GuC submission mode
Date: Thu, 25 Jun 2015 13:57:16 -0700 [thread overview]
Message-ID: <558C6B2C.9020805@intel.com> (raw)
In-Reply-To: <1435243213-22308-10-git-send-email-david.s.gordon@intel.com>
On 06/25/2015 07:40 AM, Dave Gordon wrote:
> GuC submission is basically execlist submission, but with the GuC
> handling the actual writes to the ELSP and the resulting context
> switch interrupts. So to prepare a context for submission via the
> GuC, we need some of the same functions used in execlist mode.
> This commit exposes two such functions, changing their names to
> better describe what they do (they're related to logical ring
> contexts rather than to execlists per se).
>
> v2:
> Replaces previous "drm/i915: Move execlists defines from .c to .h"
>
> Issue: VIZ-4884
> Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
> ---
> drivers/gpu/drm/i915/intel_lrc.c | 27 +++++++++++++--------------
> drivers/gpu/drm/i915/intel_lrc.h | 5 +++++
> 2 files changed, 18 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index e5f4040..a77b22d 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -264,8 +264,8 @@ u32 intel_execlists_ctx_id(struct drm_i915_gem_object *ctx_obj)
> return lrca >> 12;
> }
>
> -static uint64_t execlists_ctx_descriptor(struct intel_engine_cs *ring,
> - struct drm_i915_gem_object *ctx_obj)
> +uint64_t intel_lr_context_descriptor(struct intel_engine_cs *ring,
> + struct drm_i915_gem_object *ctx_obj)
> {
> struct drm_device *dev = ring->dev;
> uint64_t desc;
> @@ -306,13 +306,13 @@ static void execlists_elsp_write(struct intel_engine_cs *ring,
>
> /* XXX: You must always write both descriptors in the order below. */
> if (ctx_obj1)
> - temp = execlists_ctx_descriptor(ring, ctx_obj1);
> + temp = intel_lr_context_descriptor(ring, ctx_obj1);
> else
> temp = 0;
> desc[1] = (u32)(temp >> 32);
> desc[0] = (u32)temp;
>
> - temp = execlists_ctx_descriptor(ring, ctx_obj0);
> + temp = intel_lr_context_descriptor(ring, ctx_obj0);
> desc[3] = (u32)(temp >> 32);
> desc[2] = (u32)temp;
>
> @@ -331,10 +331,10 @@ static void execlists_elsp_write(struct intel_engine_cs *ring,
> spin_unlock(&dev_priv->uncore.lock);
> }
>
> -static int execlists_update_context(struct drm_i915_gem_object *ctx_obj,
> - struct drm_i915_gem_object *ring_obj,
> - struct i915_hw_ppgtt *ppgtt,
> - u32 tail)
> +/* Update the ringbuffer pointer and tail offset in a saved context image */
> +void intel_lr_context_update(struct drm_i915_gem_object *ctx_obj,
> + struct drm_i915_gem_object *ring_obj,
> + u32 tail)
> {
> struct page *page;
> uint32_t *reg_state;
> @@ -342,12 +342,11 @@ static int execlists_update_context(struct drm_i915_gem_object *ctx_obj,
> page = i915_gem_object_get_page(ctx_obj, 1);
> reg_state = kmap_atomic(page);
>
> - reg_state[CTX_RING_TAIL+1] = tail;
> reg_state[CTX_RING_BUFFER_START+1] = i915_gem_obj_ggtt_offset(ring_obj);
> + if (tail != ~0u)
> + reg_state[CTX_RING_TAIL+1] = tail;
I actually regret my original copycat of this function for guc. Because
updating ring tail is moved to guc, there is no need to call this for
each submission. Maybe we should split this call into two parts. The
updating of ring buffer base is moved to where ring buffer is newly
mapped. And the updating of tail is kept here for execlist submission only.
Alex
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-06-25 20:58 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-25 14:39 [PATCH 00/17 v2] Batch submission via GuC Dave Gordon
2015-06-25 14:39 ` [PATCH 01/17 v2] drm/i915: Add i915_gem_object_create_from_data() Dave Gordon
2015-06-25 14:39 ` [PATCH 02/17 v2] drm/i915: Embedded microcontroller (uC) firmware loading support Dave Gordon
2015-06-25 14:39 ` [PATCH 03/17 v2] drm/i915: Add GuC-related module parameters Dave Gordon
2015-06-25 14:40 ` [PATCH 04/17 v2] drm/i915: Add GuC-related header files Dave Gordon
2015-07-03 3:16 ` O'Rourke, Tom
2015-06-25 14:40 ` [PATCH 05/17 v2] drm/i915: GuC-specific firmware loader Dave Gordon
2015-06-25 14:40 ` [PATCH 06/17 v2] drm/i915: Debugfs interface to read GuC load status Dave Gordon
2015-06-25 14:40 ` [PATCH 07/17 v2] drm/i915: Split late for_each_ring loop from i915_gem_init_hw() Dave Gordon
2015-06-25 14:40 ` [PATCH 08/17 v2] drm/i915: Defer default hardware context initialisation until first open Dave Gordon
2015-06-25 14:40 ` [PATCH 09/17 v2] drm/i915: Expose two LRC functions for GuC submission mode Dave Gordon
2015-06-25 20:57 ` Yu Dai [this message]
2015-06-26 7:31 ` Chris Wilson
2015-06-26 13:14 ` Dave Gordon
2015-06-25 14:40 ` [PATCH 10/17 v2] drm/i915: GuC submission setup, phase 1 Dave Gordon
2015-06-25 14:40 ` [PATCH 11/17 v2] drm/i915: Enable GuC firmware log Dave Gordon
2015-06-25 14:40 ` [PATCH 12/17 v2] drm/i915: Implementation of GuC client Dave Gordon
2015-06-25 14:40 ` [PATCH 13/17 v2] drm/i915: Interrupt routing for GuC submission Dave Gordon
2015-06-25 14:40 ` [PATCH 14/17 v2] drm/i915: Integrate GuC-based command submission Dave Gordon
2015-06-25 14:40 ` [PATCH 15/17 v2] drm/i915: Debugfs interface for GuC submission statistics Dave Gordon
2015-06-25 14:40 ` [PATCH 16/17 v2] Documentation/drm: kerneldoc for GuC Dave Gordon
2015-06-25 14:40 ` [PATCH 17/17 v2] drm/i915: Enable GuC submission, where supported Dave Gordon
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=558C6B2C.9020805@intel.com \
--to=yu.dai@intel.com \
--cc=david.s.gordon@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox