All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 0/4] drm/i915/display: harden some bit-shifting operations
@ 2026-06-09  9:52 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
                   ` (9 more replies)
  0 siblings, 10 replies; 15+ messages in thread
From: Luca Coelho @ 2026-06-09  9:52 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.

In v2:
   * Use REG_* helpers instead of BIT with casting (Jani);
   * Remove unnecessary PHY_NULL, instead of casting it (Jani).

In v3:
   * Fixed small whitespace damage (Jani).

In v4:
   * Fixed missing whitespace after if (patchwork).

In v5:
   * Just rebased.

In v6:
   * Fixed the placement of a parenthesis (Co-Pilot -- GPT 5.5).

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: remove unnecessary PHY_NONE definition

 drivers/gpu/drm/i915/display/intel_audio_regs.h  | 16 ++++++++++++----
 drivers/gpu/drm/i915/display/intel_ddi.c         |  4 ++--
 drivers/gpu/drm/i915/display/intel_display.c     | 10 ++++++----
 drivers/gpu/drm/i915/display/intel_display.h     |  2 --
 .../drm/i915/display/intel_display_power_well.c  |  6 +++++-
 .../gpu/drm/i915/display/intel_display_regs.h    | 16 +++++++++++++---
 drivers/gpu/drm/i915/display/intel_hti.c         |  3 ---
 7 files changed, 38 insertions(+), 19 deletions(-)

-- 
2.53.0


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

end of thread, other threads:[~2026-07-01 18:36 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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   ` [v6,3/4] " Michał Grzelak
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

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.