All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nirmoy Das <nirmoy.das@linux.intel.com>
To: Andi Shyti <andi.shyti@linux.intel.com>,
	Jonathan Cavitt <jonathan.cavitt@intel.com>,
	Matt Roper <matthew.d.roper@intel.com>,
	Chris Wilson <chris@chris-wilson.co.uk>,
	Mika Kuoppala <mika.kuoppala@linux.intel.com>,
	Nirmoy Das <nirmoy.das@intel.com>
Cc: Intel GFX <intel-gfx@lists.freedesktop.org>,
	DRI Devel <dri-devel@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH v3 3/5] drm/i915/gt: Enable the CCS_FLUSH bit in the pipe control
Date: Mon, 17 Jul 2023 16:12:18 +0200	[thread overview]
Message-ID: <19e253d7-7291-78f9-bd54-e02ea6fa92fc@linux.intel.com> (raw)
In-Reply-To: <20230717125134.399115-4-andi.shyti@linux.intel.com>


On 7/17/2023 2:51 PM, Andi Shyti wrote:
> Enable the CCS_FLUSH bit 13 in the control pipe for render and
> compute engines in platforms starting from Meteor Lake (BSPEC
> 43904 and 47112).
>
> Fixes: 972282c4cf24 ("drm/i915/gen12: Add aux table invalidate for all engines")
> Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
> Cc: Jonathan Cavitt <jonathan.cavitt@intel.com>
> Cc: Nirmoy Das <nirmoy.das@intel.com>
> Cc: <stable@vger.kernel.org> # v5.8+
> ---
>   drivers/gpu/drm/i915/gt/gen8_engine_cs.c     | 12 +++++++++++-
>   drivers/gpu/drm/i915/gt/intel_engine_types.h |  1 +
>   drivers/gpu/drm/i915/gt/intel_gpu_commands.h |  1 +
>   3 files changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/gen8_engine_cs.c b/drivers/gpu/drm/i915/gt/gen8_engine_cs.c
> index bee3b7dc595cf..04484385189ad 100644
> --- a/drivers/gpu/drm/i915/gt/gen8_engine_cs.c
> +++ b/drivers/gpu/drm/i915/gt/gen8_engine_cs.c
> @@ -207,7 +207,7 @@ int gen12_emit_flush_rcs(struct i915_request *rq, u32 mode)
>   	 * memory traffic is quiesced prior.
>   	 */
>   	if ((mode & EMIT_INVALIDATE) && !HAS_FLAT_CCS(engine->i915))
> -		mode |= EMIT_FLUSH;
> +		mode |= EMIT_FLUSH | EMIT_CCS_FLUSH;
>   
>   	if (mode & EMIT_FLUSH) {
>   		u32 flags = 0;
> @@ -232,6 +232,16 @@ int gen12_emit_flush_rcs(struct i915_request *rq, u32 mode)
>   
>   		flags |= PIPE_CONTROL_CS_STALL;
>   
> +		/*
> +		 * When required, in MTL+ platforms, in the render and compute
> +		 * engines we need to set the CCS_FLUSH bit in the pipe control
> +		 */
> +		if (mode & EMIT_CCS_FLUSH &&
> +		    GRAPHICS_VER_FULL(rq->i915) >= IP_VER(12, 70) &&
> +		    (engine->class == RENDER_CLASS ||
> +		     engine->class == COMPUTE_CLASS))
PIPE_CONTROL is only available for render and compute so we can skip 
this engine check.
> +			flags |= PIPE_CONTROL_CCS_FLUSH;

This "flags" is applied to DWORD 1 of PIPE_CONTROL but we need this for 
DWORD 0


Regards,

Nirmoy

> +
>   		if (!HAS_3D_PIPELINE(engine->i915))
>   			flags &= ~PIPE_CONTROL_3D_ARCH_FLAGS;
>   		else if (engine->class == COMPUTE_CLASS)
> diff --git a/drivers/gpu/drm/i915/gt/intel_engine_types.h b/drivers/gpu/drm/i915/gt/intel_engine_types.h
> index e99a6fa03d453..e2cae9d02bd62 100644
> --- a/drivers/gpu/drm/i915/gt/intel_engine_types.h
> +++ b/drivers/gpu/drm/i915/gt/intel_engine_types.h
> @@ -514,6 +514,7 @@ struct intel_engine_cs {
>   	int		(*emit_flush)(struct i915_request *request, u32 mode);
>   #define EMIT_INVALIDATE	BIT(0)
>   #define EMIT_FLUSH	BIT(1)
> +#define EMIT_CCS_FLUSH	BIT(2) /* MTL+ */
>   #define EMIT_BARRIER	(EMIT_INVALIDATE | EMIT_FLUSH)
>   	int		(*emit_bb_start)(struct i915_request *rq,
>   					 u64 offset, u32 length,
> diff --git a/drivers/gpu/drm/i915/gt/intel_gpu_commands.h b/drivers/gpu/drm/i915/gt/intel_gpu_commands.h
> index 5d143e2a8db03..5df7cce23197c 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gpu_commands.h
> +++ b/drivers/gpu/drm/i915/gt/intel_gpu_commands.h
> @@ -299,6 +299,7 @@
>   #define   PIPE_CONTROL_QW_WRITE				(1<<14)
>   #define   PIPE_CONTROL_POST_SYNC_OP_MASK                (3<<14)
>   #define   PIPE_CONTROL_DEPTH_STALL			(1<<13)
> +#define   PIPE_CONTROL_CCS_FLUSH			(1<<13) /* MTL+ */
>   #define   PIPE_CONTROL_WRITE_FLUSH			(1<<12)
>   #define   PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH	(1<<12) /* gen6+ */
>   #define   PIPE_CONTROL_INSTRUCTION_CACHE_INVALIDATE	(1<<11) /* MBZ on ILK */

  reply	other threads:[~2023-07-17 14:12 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17 12:51 [Intel-gfx] [PATCH v3 0/5] Update AUX invalidation sequence Andi Shyti
2023-07-17 12:51 ` Andi Shyti
2023-07-17 12:51 ` [Intel-gfx] [PATCH v3 1/5] drm/i915/gt: Cleanup aux invalidation registers Andi Shyti
2023-07-17 12:51   ` Andi Shyti
2023-07-17 17:33   ` [Intel-gfx] " Andrzej Hajda
2023-07-17 12:51 ` [Intel-gfx] [PATCH v3 2/5] drm/i915/gt: Ensure memory quiesced before invalidation Andi Shyti
2023-07-17 12:51   ` Andi Shyti
2023-07-17 14:12   ` [Intel-gfx] " Nirmoy Das
2023-07-17 14:12     ` Nirmoy Das
2023-07-17 17:42   ` [Intel-gfx] " Andrzej Hajda
2023-07-17 12:51 ` [Intel-gfx] [PATCH v3 3/5] drm/i915/gt: Enable the CCS_FLUSH bit in the pipe control Andi Shyti
2023-07-17 12:51   ` Andi Shyti
2023-07-17 14:12   ` Nirmoy Das [this message]
2023-07-17 12:51 ` [Intel-gfx] [PATCH v3 4/5] drm/i915/gt: Poll aux invalidation register bit on invalidation Andi Shyti
2023-07-17 12:51   ` Andi Shyti
2023-07-17 12:51 ` [Intel-gfx] [PATCH v3 5/5] drm/i915/gt: Support aux invalidation on all engines Andi Shyti
2023-07-17 12:51   ` Andi Shyti
2023-07-17 14:16   ` [Intel-gfx] " Nirmoy Das
2023-07-17 14:16     ` Nirmoy Das
2023-07-17 15:53 ` [Intel-gfx] ✓ Fi.CI.BAT: success for Update AUX invalidation sequence (rev3) Patchwork

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=19e253d7-7291-78f9-bd54-e02ea6fa92fc@linux.intel.com \
    --to=nirmoy.das@linux.intel.com \
    --cc=andi.shyti@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jonathan.cavitt@intel.com \
    --cc=matthew.d.roper@intel.com \
    --cc=mika.kuoppala@linux.intel.com \
    --cc=nirmoy.das@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.