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 <[email protected]>
---
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 <[email protected]>
BR,
Michał
}
return 0;