Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nirmoy Das <nirmoy.das@linux.intel.com>
To: Matthew Auld <matthew.auld@intel.com>, intel-xe@lists.freedesktop.org
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	"Nirmoy Das" <nirmoy.das@intel.com>
Subject: Re: [PATCH] drm/xe/pat: sanity check compression and coh_mode
Date: Wed, 28 Aug 2024 14:05:56 +0200	[thread overview]
Message-ID: <815e4cfa-ce2e-4de5-9a04-b1727d705602@linux.intel.com> (raw)
In-Reply-To: <20240828092257.169063-2-matthew.auld@intel.com>


On 8/28/2024 11:22 AM, Matthew Auld wrote:
> There is an implicit assumption in the driver that compression and
> coh_1way+ are mutually exclusive. If this is ever not true then userptr
> and imported dma-buf from external device will have uncleared ccs state.
> Add a build bug for this so we don't forget.
>
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> Cc: Nirmoy Das <nirmoy.das@intel.com>
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_pat.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_pat.c b/drivers/gpu/drm/xe/xe_pat.c
> index 722278cc23fc..f92a1c61956d 100644
> --- a/drivers/gpu/drm/xe/xe_pat.c
> +++ b/drivers/gpu/drm/xe/xe_pat.c
> @@ -100,6 +100,10 @@ static const struct xe_pat_table_entry xelpg_pat_table[] = {
>    * Reserved entries should be programmed with the maximum caching, minimum
>    * coherency (which matches an all-0's encoding), so we can just omit them
>    * in the table.
> + *
> + * Note: There is an implicit assumption in the driver that compression and
> + * coh_1way+ are mutually exclusive. If this is ever not true then userptr
> + * and imported dma-buf from external device will have uncleared ccs state.
>    */
>   #define XE2_PAT(no_promote, comp_en, l3clos, l3_policy, l4_policy, __coh_mode) \
>   	{ \
> @@ -109,7 +113,8 @@ static const struct xe_pat_table_entry xelpg_pat_table[] = {
>   			REG_FIELD_PREP(XE2_L3_POLICY, l3_policy) | \
>   			REG_FIELD_PREP(XE2_L4_POLICY, l4_policy) | \
>   			REG_FIELD_PREP(XE2_COH_MODE, __coh_mode), \
> -		.coh_mode = __coh_mode ? XE_COH_AT_LEAST_1WAY : XE_COH_NONE \
> +		.coh_mode = (BUILD_BUG_ON_ZERO(__coh_mode && comp_en) || __coh_mode) ? \
> +			XE_COH_AT_LEAST_1WAY : XE_COH_NONE \
>   	}
>   
>   static const struct xe_pat_table_entry xe2_pat_table[] = {

  reply	other threads:[~2024-08-28 12:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-28  9:22 [PATCH] drm/xe/pat: sanity check compression and coh_mode Matthew Auld
2024-08-28 12:05 ` Nirmoy Das [this message]
2024-08-28 12:30 ` ✓ CI.Patch_applied: success for " Patchwork
2024-08-28 12:30 ` ✓ CI.checkpatch: " Patchwork
2024-08-28 12:32 ` ✓ CI.KUnit: " Patchwork
2024-08-28 12:44 ` ✓ CI.Build: " Patchwork
2024-08-28 12:46 ` ✓ CI.Hooks: " Patchwork
2024-08-28 12:47 ` ✓ CI.checksparse: " Patchwork
2024-08-28 13:07 ` ✓ CI.BAT: " Patchwork
2024-08-28 20:20 ` ✓ CI.FULL: " 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=815e4cfa-ce2e-4de5-9a04-b1727d705602@linux.intel.com \
    --to=nirmoy.das@linux.intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    --cc=nirmoy.das@intel.com \
    --cc=thomas.hellstrom@linux.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