From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH 3/7] drm/i915: Assert that device info bitmasks have enough bits
Date: Thu, 11 May 2023 19:55:30 +0300 [thread overview]
Message-ID: <20230511165534.10266-4-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20230511165534.10266-1-ville.syrjala@linux.intel.com>
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Sprinkle in some BUILD_BUG_ON()s to make sure some of
the bitmasks used in the device info have enough bits.
Do we have a better place for this sort of stuff?
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/intel_device_info.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c
index bb10e8e78a94..ce257446b712 100644
--- a/drivers/gpu/drm/i915/intel_device_info.c
+++ b/drivers/gpu/drm/i915/intel_device_info.c
@@ -414,6 +414,10 @@ void intel_device_info_runtime_init(struct drm_i915_private *dev_priv)
struct intel_runtime_info *runtime = RUNTIME_INFO(dev_priv);
enum pipe pipe;
+ BUILD_BUG_ON(BITS_PER_TYPE(runtime->pipe_mask) < I915_MAX_PIPES);
+ BUILD_BUG_ON(BITS_PER_TYPE(runtime->cpu_transcoder_mask) < I915_MAX_TRANSCODERS);
+ BUILD_BUG_ON(BITS_PER_TYPE(runtime->port_mask) < I915_MAX_PORTS);
+
/* Wa_14011765242: adl-s A0,A1 */
if (IS_ADLS_DISPLAY_STEP(dev_priv, STEP_A0, STEP_A2))
for_each_pipe(dev_priv, pipe)
--
2.39.3
next prev parent reply other threads:[~2023-05-11 16:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-11 16:55 [Intel-gfx] [PATCH 0/7] drm/i915: Init DDI ports based on port_mask Ville Syrjala
2023-05-11 16:55 ` [Intel-gfx] [PATCH 1/7] drm/i915: Remove bogus DDI-F from hsw/bdw output init Ville Syrjala
2023-05-24 15:33 ` Lucas De Marchi
2023-05-11 16:55 ` [Intel-gfx] [PATCH 2/7] drm/i915: Introduce device info port_mask Ville Syrjala
2023-05-11 16:55 ` Ville Syrjala [this message]
2023-05-24 15:48 ` [Intel-gfx] [PATCH 3/7] drm/i915: Assert that device info bitmasks have enough bits Lucas De Marchi
2023-05-25 9:27 ` Jani Nikula
2023-05-11 16:55 ` [Intel-gfx] [PATCH 4/7] drm/i915: Assert that the port being initialized is valid Ville Syrjala
2023-05-11 16:55 ` [Intel-gfx] [PATCH 5/7] drm/i915: Beef up SDVO/HDMI port checks Ville Syrjala
2023-05-11 16:55 ` [Intel-gfx] [PATCH 6/7] drm/i915: Init DDI outputs based on port_mask on skl+ Ville Syrjala
2023-05-11 16:55 ` [Intel-gfx] [PATCH 7/7] drm/i915: Convert HSW/BDW to use port_mask for DDI probe Ville Syrjala
2023-05-24 14:52 ` [Intel-gfx] [PATCH v2 " Ville Syrjala
2023-05-11 21:04 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Init DDI ports based on port_mask Patchwork
2023-05-11 21:04 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-05-11 21:11 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-05-24 21:05 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915: Init DDI ports based on port_mask (rev2) 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=20230511165534.10266-4-ville.syrjala@linux.intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox