Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: lirongqing <lirongqing@baidu.com>,
	Matthew Brost <matthew.brost@intel.com>,
	 Rodrigo Vivi <rodrigo.vivi@intel.com>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	 Matthew Auld <matthew.auld@intel.com>,
	intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/xe: Fix operator precedence bug in emit_flush_invalidate
Date: Wed, 13 May 2026 16:57:52 +0200	[thread overview]
Message-ID: <233b5a1e9383e9c9ac6a10beee635cfcffc2336b.camel@linux.intel.com> (raw)
In-Reply-To: <20260513113725.2313-1-lirongqing@baidu.com>

On Wed, 2026-05-13 at 07:37 -0400, lirongqing wrote:
> From: Li RongQing <lirongqing@baidu.com>
> 
> The expression:
>     MI_FLUSH_IMM_DW | (flush_flags & MI_INVALIDATE_TLB) ?: 0;
> 
> is parsed as:
>     (MI_FLUSH_DW | MI_FLUSH_DW_OP_STOREDW | MI_FLUSH_IMM_DW |
>      (flush_flags & MI_INVALIDATE_TLB)) ?: 0;
> 
> Since the combined constant flags are always non-zero, the GNU
> extension
> '?: 0' acts as a no-op and does not change the value. Remove this
> redundant
> and confusing logic.
> 
> Signed-off-by: Li RongQing <lirongqing@baidu.com>

Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>

Will push to drm-xe-next once CI is clean.


> ---
>  drivers/gpu/drm/xe/xe_ring_ops.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_ring_ops.c
> b/drivers/gpu/drm/xe/xe_ring_ops.c
> index cfeb4fc..ee468d3 100644
> --- a/drivers/gpu/drm/xe/xe_ring_ops.c
> +++ b/drivers/gpu/drm/xe/xe_ring_ops.c
> @@ -144,7 +144,7 @@ static int emit_bb_start(u64 batch_addr, u32
> ppgtt_flag, u32 *dw, int i)
>  static int emit_flush_invalidate(u32 addr, u32 val, u32 flush_flags,
> u32 *dw, int i)
>  {
>  	dw[i++] = MI_FLUSH_DW | MI_FLUSH_DW_OP_STOREDW |
> -		  MI_FLUSH_IMM_DW | (flush_flags &
> MI_INVALIDATE_TLB) ?: 0;
> +		  MI_FLUSH_IMM_DW | (flush_flags &
> MI_INVALIDATE_TLB);
>  
>  	dw[i++] = addr | MI_FLUSH_DW_USE_GTT;
>  	dw[i++] = 0;

  reply	other threads:[~2026-05-13 14:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 11:37 [PATCH] drm/xe: Fix operator precedence bug in emit_flush_invalidate lirongqing
2026-05-13 14:57 ` Thomas Hellström [this message]
2026-05-13 16:29 ` ✗ LGCI.VerificationFailed: failure for " 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=233b5a1e9383e9c9ac6a10beee635cfcffc2336b.camel@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lirongqing@baidu.com \
    --cc=matthew.auld@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=simona@ffwll.ch \
    /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