From 279b0df165e2ec4f853de03b3ee1c7961ac23513 Mon Sep 17 00:00:00 2001 From: Luca Coelho Date: Tue, 9 Jun 2026 12:52:38 +0300 Subject: [PATCH] drm/i915/display: harden shift in intel_ddi_compute_config_late() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Reviewed-by: MichaƂ Grzelak Link: https://patch.msgid.link/20260609095525.570614-4-luciano.coelho@intel.com Signed-off-by: Luca Coelho --- 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 dd9064592ec9..9b3b526e5e55 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi.c +++ b/drivers/gpu/drm/i915/display/intel_ddi.c @@ -4679,8 +4679,8 @@ static int intel_ddi_compute_config_late(struct intel_atomic_state *state, 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); } return 0;