All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michał Grzelak" <michal.grzelak@intel.com>
To: Luca Coelho <luciano.coelho@intel.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [v6,3/4] drm/i915/display: harden shift in intel_ddi_compute_config_late()
Date: Wed, 1 Jul 2026 20:32:02 +0200 (CEST)	[thread overview]
Message-ID: <25e034f3-1940-f246-aee6-7aaced4b8e51@intel.com> (raw)
In-Reply-To: <20260609095525.570614-4-luciano.coelho@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1321 bytes --]

On Tue, 9 Jun 2026, Luca Coelho wrote:
> BIT() takes a non-negative shift amount, but cpu_transcoder is of type
> enum transcoder, which can in theory be INVALID_TRANSCODER (-1).
>
> This is not a problem with the current implementation, because
> cpu_transcoder is always valid when this code is reached, but it's
> more robust to cast to unsigned so the shift is always well-defined.
>
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_ddi.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index 6399b16405c8..51816c5bc80b 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -4635,8 +4635,8 @@ static int intel_ddi_compute_config_late(struct intel_encoder *encoder,
>
> 	if (crtc_state->master_transcoder == crtc_state->cpu_transcoder) {
> 		crtc_state->master_transcoder = INVALID_TRANSCODER;
> -		crtc_state->sync_mode_slaves_mask =
> -			port_sync_transcoders & ~BIT(crtc_state->cpu_transcoder);
> +		crtc_state->sync_mode_slaves_mask = port_sync_transcoders &
> +			~REG_BIT(crtc_state->cpu_transcoder);

Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>

BR,
Michał

> 	}
>
> 	return 0;
>

  reply	other threads:[~2026-07-01 18:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09  9:52 [PATCH v6 0/4] drm/i915/display: harden some bit-shifting operations Luca Coelho
2026-06-09  9:52 ` [PATCH v6 1/4] drm/i915/display: harden masks in HSW_AUD_PIN_ELD_CP_VLD macros Luca Coelho
2026-07-01 18:31   ` [v6, " Michał Grzelak
2026-06-09  9:52 ` [PATCH v6 2/4] drm/i915/display: harden shifts in ICL_DPCLKA_CFGCR0_DDI_CLK_SEL macros Luca Coelho
2026-07-01 18:31   ` [v6, " Michał Grzelak
2026-06-09  9:52 ` [PATCH v6 3/4] drm/i915/display: harden shift in intel_ddi_compute_config_late() Luca Coelho
2026-07-01 18:32   ` Michał Grzelak [this message]
2026-06-09  9:52 ` [PATCH v6 4/4] drm/i915/display: remove unnecessary PHY_NONE definition Luca Coelho
2026-07-01 18:36   ` [v6,4/4] " Michał Grzelak
2026-06-09 10:19 ` ✗ CI.checkpatch: warning for drm/i915/display: harden some bit-shifting operations (rev6) Patchwork
2026-06-09 10:21 ` ✓ CI.KUnit: success " Patchwork
2026-06-09 11:00 ` ✓ i915.CI.BAT: " Patchwork
2026-06-09 11:20 ` ✓ Xe.CI.BAT: " Patchwork
2026-06-09 23:10 ` ✓ Xe.CI.FULL: " Patchwork
2026-06-15  7:58 ` ✓ i915.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=25e034f3-1940-f246-aee6-7aaced4b8e51@intel.com \
    --to=michal.grzelak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=luciano.coelho@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.