Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Das, Nirmoy" <nirmoy.das@linux.intel.com>
To: Matthew Auld <matthew.auld@intel.com>, intel-gfx@lists.freedesktop.org
Cc: Nirmoy Das <nirmoy.das@intel.com>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Shuicheng Lin <shuicheng.lin@intel.com>
Subject: Re: [Intel-gfx] [PATCH 1/2] drm/i915/migrate: fix corner case in CCS aux copying
Date: Tue, 13 Dec 2022 12:17:11 +0100	[thread overview]
Message-ID: <e80b9078-bb90-7760-a17b-3a35c54a37df@linux.intel.com> (raw)
In-Reply-To: <20221212171958.82593-1-matthew.auld@intel.com>


On 12/12/2022 6:19 PM, Matthew Auld wrote:
> In the case of lmem -> lmem transfers, which is currently only possible
> with small-bar systems, we need to ensure we copy the CCS aux state
> as-is, rather than nuke it. This should fix some nasty display
> corruption sometimes seen on DG2 small-bar systems, when also using
> DG2_RC_CCS_CC for the surface.
>
> Fixes: e3afc690188b ("drm/i915/display: consider DG2_RC_CCS_CC when migrating buffers")
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Nirmoy Das <nirmoy.das@intel.com>
> Cc: Andrzej Hajda <andrzej.hajda@intel.com>
> Cc: Shuicheng Lin <shuicheng.lin@intel.com>
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>
> ---
>   drivers/gpu/drm/i915/gt/intel_migrate.c | 37 +++++++++++++++++++------
>   1 file changed, 29 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_migrate.c b/drivers/gpu/drm/i915/gt/intel_migrate.c
> index e08a739b7091..3f638f198796 100644
> --- a/drivers/gpu/drm/i915/gt/intel_migrate.c
> +++ b/drivers/gpu/drm/i915/gt/intel_migrate.c
> @@ -839,14 +839,35 @@ intel_context_migrate_copy(struct intel_context *ce,
>   			if (err)
>   				goto out_rq;
>   
> -			/*
> -			 * While we can't always restore/manage the CCS state,
> -			 * we still need to ensure we don't leak the CCS state
> -			 * from the previous user, so make sure we overwrite it
> -			 * with something.
> -			 */
> -			err = emit_copy_ccs(rq, dst_offset, INDIRECT_ACCESS,
> -					    dst_offset, DIRECT_ACCESS, len);
> +			if (src_is_lmem) {
> +				/*
> +				 * If the src is already in lmem, then we must
> +				 * be doing an lmem -> lmem transfer, and so
> +				 * should be safe to directly copy the CCS
> +				 * state. In this case we have either
> +				 * initialised the CCS aux state when first
> +				 * clearing the pages (since it is already
> +				 * allocated in lmem), or the user has
> +				 * potentially populated it, in which case we
> +				 * need to copy the CCS state as-is.
> +				 */
> +				err = emit_copy_ccs(rq,
> +						    dst_offset, INDIRECT_ACCESS,
> +						    src_offset, INDIRECT_ACCESS,
> +						    len);
> +			} else {
> +				/*
> +				 * While we can't always restore/manage the CCS
> +				 * state, we still need to ensure we don't leak
> +				 * the CCS state from the previous user, so make
> +				 * sure we overwrite it with something.
> +				 */
> +				err = emit_copy_ccs(rq,
> +						    dst_offset, INDIRECT_ACCESS,
> +						    dst_offset, DIRECT_ACCESS,
> +						    len);
> +			}
> +
>   			if (err)
>   				goto out_rq;
>   

  parent reply	other threads:[~2022-12-13 11:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-12 17:19 [Intel-gfx] [PATCH 1/2] drm/i915/migrate: fix corner case in CCS aux copying Matthew Auld
2022-12-12 17:19 ` [Intel-gfx] [PATCH 2/2] drm/i915/ttm: consider CCS for backup objects Matthew Auld
2022-12-13 11:13   ` Das, Nirmoy
2022-12-12 20:41 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [1/2] drm/i915/migrate: fix corner case in CCS aux copying Patchwork
2022-12-12 20:53 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-12-13 11:17 ` Das, Nirmoy [this message]
2022-12-13 15:20 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " 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=e80b9078-bb90-7760-a17b-3a35c54a37df@linux.intel.com \
    --to=nirmoy.das@linux.intel.com \
    --cc=andrzej.hajda@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    --cc=nirmoy.das@intel.com \
    --cc=shuicheng.lin@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox