From: Arun Siluvery <arun.siluvery@linux.intel.com>
To: Michel Thierry <michel.thierry@intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915/gen9: Set value of Indirect Context Offset based on gen version
Date: Fri, 19 Feb 2016 15:19:50 +0000 [thread overview]
Message-ID: <56C73296.2040701@linux.intel.com> (raw)
In-Reply-To: <1455893892-25406-1-git-send-email-michel.thierry@intel.com>
On 19/02/2016 14:58, Michel Thierry wrote:
> The cache line offset for the Indirect CS context (0x21C8) varies from gen
> to gen.
>
> v2: Move it into a function (Arun), use MISSING_CASE (Chris)
>
> Cc: Arun Siluvery <arun.siluvery@linux.intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Michel Thierry <michel.thierry@intel.com>
> ---
> drivers/gpu/drm/i915/intel_lrc.c | 26 ++++++++++++++++++++++++--
> 1 file changed, 24 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index 5c0bf02..b1f2886 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -226,7 +226,8 @@ enum {
> FAULT_AND_CONTINUE /* Unsupported */
> };
> #define GEN8_CTX_ID_SHIFT 32
> -#define CTX_RCS_INDIRECT_CTX_OFFSET_DEFAULT 0x17
> +#define GEN8_CTX_RCS_INDIRECT_CTX_OFFSET_DEFAULT 0x17
> +#define GEN9_CTX_RCS_INDIRECT_CTX_OFFSET_DEFAULT 0x26
>
> static int intel_lr_context_pin(struct drm_i915_gem_request *rq);
> static void lrc_setup_hardware_status_page(struct intel_engine_cs *ring,
> @@ -2264,6 +2265,27 @@ make_rpcs(struct drm_device *dev)
> return rpcs;
> }
>
> +static u32 intel_lr_indirect_ctx_offset(struct intel_engine_cs *ring)
> +{
> + u32 indirect_ctx_offset;
> +
> + switch (INTEL_INFO(ring->dev)->gen) {
> + default:
> + MISSING_CASE(INTEL_INFO(ring->dev)->gen);
> + /* fall through */
> + case 9:
> + indirect_ctx_offset =
> + GEN9_CTX_RCS_INDIRECT_CTX_OFFSET_DEFAULT;
> + break;
> + case 8:
> + indirect_ctx_offset =
> + GEN8_CTX_RCS_INDIRECT_CTX_OFFSET_DEFAULT;
> + break;
> + }
> +
> + return indirect_ctx_offset;
> +}
> +
> static int
> populate_lr_context(struct intel_context *ctx, struct drm_i915_gem_object *ctx_obj,
> struct intel_engine_cs *ring, struct intel_ringbuffer *ringbuf)
> @@ -2336,7 +2358,7 @@ populate_lr_context(struct intel_context *ctx, struct drm_i915_gem_object *ctx_o
> (wa_ctx->indirect_ctx.size / CACHELINE_DWORDS);
>
> reg_state[CTX_RCS_INDIRECT_CTX_OFFSET+1] =
> - CTX_RCS_INDIRECT_CTX_OFFSET_DEFAULT << 6;
> + intel_lr_indirect_ctx_offset(ring) << 6;
>
> reg_state[CTX_BB_PER_CTX_PTR+1] =
> (ggtt_offset + wa_ctx->per_ctx.offset * sizeof(uint32_t)) |
>
Agrees with spec, looks good to me,
Reviewed-by: Arun Siluvery <arun.siluvery@linux.intel.com>
regards
Arun
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-02-19 15:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-19 14:05 [PATCH] drm/i915/gen9: Set value of Indirect Context Offset based on gen version Michel Thierry
2016-02-19 14:25 ` Chris Wilson
2016-02-19 14:58 ` [PATCH v2] " Michel Thierry
2016-02-19 15:19 ` Arun Siluvery [this message]
2016-02-19 16:42 ` ✗ Fi.CI.BAT: failure for drm/i915/gen9: Set value of Indirect Context Offset based on gen version (rev2) Patchwork
2016-02-22 10:14 ` [PATCH v3] drm/i915/gen9: Set value of Indirect Context Offset based on gen version Michel Thierry
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=56C73296.2040701@linux.intel.com \
--to=arun.siluvery@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=michel.thierry@intel.com \
/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.