Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] drm/i915/display: harden some bit-shifting operations
@ 2026-05-19 11:11 Luca Coelho
  2026-05-19 11:11 ` [PATCH 1/4] drm/i915/display: harden masks in HSW_AUD_PIN_ELD_CP_VLD macros Luca Coelho
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Luca Coelho @ 2026-05-19 11:11 UTC (permalink / raw)
  To: intel-gfx; +Cc: intel-xe

Hi,

This patchset addresses a number of potential undefined behaviors in
bit-shifting operations where the shift amount is derived from an enum
that can in theory hold a negative value (e.g. INVALID_TRANSCODER,
PHY_NONE), as reported by static analyzers.

None of these are actual problems with the current implementation,
because the values are always valid when the code is reached, but
it's more robust to make the shifts always well-defined.

Please review.

Cheers,
Luca.


Luca Coelho (4):
  drm/i915/display: harden masks in HSW_AUD_PIN_ELD_CP_VLD macros
  drm/i915/display: harden shifts in ICL_DPCLKA_CFGCR0_DDI_CLK_SEL
    macros
  drm/i915/display: harden shift in intel_ddi_compute_config_late()
  drm/i915/display: harden shift in intel_pmdemand_update_phys_mask()

 drivers/gpu/drm/i915/display/intel_audio_regs.h  | 16 ++++++++++++----
 drivers/gpu/drm/i915/display/intel_ddi.c         |  4 ++--
 .../gpu/drm/i915/display/intel_display_regs.h    | 13 ++++++++++---
 drivers/gpu/drm/i915/display/intel_pmdemand.c    |  2 +-
 4 files changed, 25 insertions(+), 10 deletions(-)

-- 
2.53.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-05-21  6:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-19 11:11 [PATCH 0/4] drm/i915/display: harden some bit-shifting operations Luca Coelho
2026-05-19 11:11 ` [PATCH 1/4] drm/i915/display: harden masks in HSW_AUD_PIN_ELD_CP_VLD macros Luca Coelho
2026-05-19 11:49   ` Jani Nikula
2026-05-21  6:47     ` Luca Coelho
2026-05-19 11:11 ` [PATCH 2/4] drm/i915/display: harden shifts in ICL_DPCLKA_CFGCR0_DDI_CLK_SEL macros Luca Coelho
2026-05-19 11:50   ` Jani Nikula
2026-05-19 11:11 ` [PATCH 3/4] drm/i915/display: harden shift in intel_ddi_compute_config_late() Luca Coelho
2026-05-19 11:11 ` [PATCH 4/4] drm/i915/display: harden shift in intel_pmdemand_update_phys_mask() Luca Coelho
2026-05-19 12:08   ` Jani Nikula
2026-05-19 13:41 ` ✓ i915.CI.BAT: success for drm/i915/display: harden some bit-shifting operations Patchwork
2026-05-20 13:52 ` ✓ i915.CI.Full: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox