From: Daniel Vetter <daniel@ffwll.ch>
To: ville.syrjala@linux.intel.com
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 07/15] drm/i915: Add BUILD_BUG_ON()s for DDI translation table sizes
Date: Thu, 10 Dec 2015 14:28:32 +0100 [thread overview]
Message-ID: <20151210132832.GE20822@phenom.ffwll.local> (raw)
In-Reply-To: <1449597590-6971-8-git-send-email-ville.syrjala@linux.intel.com>
On Tue, Dec 08, 2015 at 07:59:42PM +0200, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> The DDI translation tables are supposed to be of certain size,
> so let's add some compile time asserts to enforce that..
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Not sure this is worth it really. Next patch seems more valuable. Not
against it, but imo needs someone to really rave about it.
-Daniel
> ---
> drivers/gpu/drm/i915/intel_ddi.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index 5d0b03d6d388..838cbbe33517 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -351,6 +351,10 @@ intel_dig_port_supports_hdmi(const struct intel_digital_port *intel_dig_port)
> static const struct ddi_buf_trans *
> skl_get_buf_trans_dp(struct drm_i915_private *dev_priv, int *n_entries)
> {
> + BUILD_BUG_ON(ARRAY_SIZE(skl_y_ddi_translations_dp) != 9);
> + BUILD_BUG_ON(ARRAY_SIZE(skl_u_ddi_translations_dp) != 9);
> + BUILD_BUG_ON(ARRAY_SIZE(skl_ddi_translations_dp) != 9);
> +
> if (IS_SKL_ULX(dev_priv)) {
> *n_entries = ARRAY_SIZE(skl_y_ddi_translations_dp);
> return skl_y_ddi_translations_dp;
> @@ -366,6 +370,10 @@ skl_get_buf_trans_dp(struct drm_i915_private *dev_priv, int *n_entries)
> static const struct ddi_buf_trans *
> skl_get_buf_trans_edp(struct drm_i915_private *dev_priv, int *n_entries)
> {
> + BUILD_BUG_ON(ARRAY_SIZE(skl_y_ddi_translations_edp) != 10);
> + BUILD_BUG_ON(ARRAY_SIZE(skl_u_ddi_translations_edp) != 10);
> + BUILD_BUG_ON(ARRAY_SIZE(skl_ddi_translations_edp) != 10);
> +
> if (dev_priv->edp_low_vswing) {
> if (IS_SKL_ULX(dev_priv)) {
> *n_entries = ARRAY_SIZE(skl_y_ddi_translations_edp);
> @@ -436,6 +444,10 @@ static void intel_prepare_ddi_buffers(struct drm_i915_private *dev_priv,
> dev_priv->vbt.ddi_port_info[port].dp_boost_level)
> iboost_bit = 1<<31;
> } else if (IS_BROADWELL(dev_priv)) {
> + BUILD_BUG_ON(ARRAY_SIZE(bdw_ddi_translations_fdi) != 9);
> + BUILD_BUG_ON(ARRAY_SIZE(bdw_ddi_translations_dp) != 9);
> + BUILD_BUG_ON(ARRAY_SIZE(bdw_ddi_translations_edp) != 9);
> +
> ddi_translations_fdi = bdw_ddi_translations_fdi;
> ddi_translations_dp = bdw_ddi_translations_dp;
> ddi_translations_edp = bdw_ddi_translations_edp;
> @@ -445,6 +457,9 @@ static void intel_prepare_ddi_buffers(struct drm_i915_private *dev_priv,
> n_hdmi_entries = ARRAY_SIZE(bdw_ddi_translations_hdmi);
> hdmi_default_entry = 7;
> } else if (IS_HASWELL(dev_priv)) {
> + BUILD_BUG_ON(ARRAY_SIZE(hsw_ddi_translations_fdi) != 9);
> + BUILD_BUG_ON(ARRAY_SIZE(hsw_ddi_translations_dp) != 9);
> +
> ddi_translations_fdi = hsw_ddi_translations_fdi;
> ddi_translations_dp = hsw_ddi_translations_dp;
> ddi_translations_edp = hsw_ddi_translations_dp;
> --
> 2.4.10
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-12-10 13:28 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-08 17:59 [PATCH 00/15] drm/i915: Cure DDI from multiple personality disorder ville.syrjala
2015-12-08 17:59 ` [PATCH 01/15] drm/i915: Pass the correct encoder to intel_ddi_clk_select() with MST ville.syrjala
2015-12-10 13:17 ` Daniel Vetter
2015-12-08 17:59 ` [PATCH 02/15] drm/i915: Check max number of lanes when registering DDI ports ville.syrjala
2015-12-10 13:19 ` Daniel Vetter
2015-12-08 17:59 ` [PATCH 03/15] drm/i915: Store max lane count in intel_digital_port ville.syrjala
2015-12-10 13:22 ` Daniel Vetter
2015-12-10 13:31 ` Ville Syrjälä
2015-12-10 14:08 ` Daniel Vetter
2015-12-08 17:59 ` [PATCH 04/15] drm/i915: Remove pointless 'ddi_translations' local variable ville.syrjala
2015-12-10 13:22 ` Daniel Vetter
2015-12-08 17:59 ` [PATCH 05/15] drm/i915: Eliminate duplicated skl_get_buf_trans_dp() ville.syrjala
2015-12-10 13:24 ` Daniel Vetter
2015-12-08 17:59 ` [PATCH 06/15] drm/i915: Pass around dev_priv for ddi buffer programming ville.syrjala
2015-12-10 13:25 ` Daniel Vetter
2015-12-08 17:59 ` [PATCH 07/15] drm/i915: Add BUILD_BUG_ON()s for DDI translation table sizes ville.syrjala
2015-12-10 13:28 ` Daniel Vetter [this message]
2015-12-10 14:43 ` Ville Syrjälä
2015-12-08 17:59 ` [PATCH 08/15] drm/i915: Reject >9 ddi translation entried if port != A/E on SKL ville.syrjala
2015-12-10 13:30 ` Daniel Vetter
2015-12-10 13:42 ` Ville Syrjälä
2015-12-10 14:09 ` Daniel Vetter
2015-12-08 17:59 ` [PATCH 09/15] drm/i915: Kill intel_prepare_ddi() ville.syrjala
2015-12-10 13:37 ` Daniel Vetter
2015-12-10 14:00 ` Ville Syrjälä
2015-12-08 17:59 ` [PATCH 10/15] drm/i915: Split the problematic dual-role DDI encoder into two encoders ville.syrjala
2015-12-08 18:21 ` kbuild test robot
2015-12-10 13:47 ` Daniel Vetter
2015-12-10 14:10 ` Ville Syrjälä
2015-12-10 14:20 ` Daniel Vetter
2015-12-08 17:59 ` [PATCH 11/15] drm/i915: Explicitly use ddi bug trans entry 9 for hdmi ville.syrjala
2015-12-10 13:48 ` Daniel Vetter
2015-12-10 14:41 ` Ville Syrjälä
2015-12-11 17:22 ` Daniel Vetter
2015-12-08 17:59 ` [PATCH 12/15] drm/i915: Split DP/eDP/FDI and HDMI/DVI DDI buffer programming apart ville.syrjala
2015-12-10 13:52 ` Daniel Vetter
2015-12-10 14:15 ` Ville Syrjälä
2015-12-08 17:59 ` [PATCH 13/15] drm/i915: Add a sanity check for 'hdmi_default_entry' ville.syrjala
2015-12-10 13:54 ` Daniel Vetter
2015-12-08 17:59 ` [PATCH 14/15] drm/i915: Get the iboost setting based on the port type ville.syrjala
2015-12-10 13:55 ` Daniel Vetter
2015-12-10 14:17 ` Ville Syrjälä
2015-12-08 17:59 ` [PATCH 15/15] drm/i915: Simplify intel_ddi_get_encoder_port() ville.syrjala
2015-12-10 13:57 ` Daniel Vetter
2015-12-10 14:19 ` Ville Syrjälä
2016-01-12 14:52 ` [PATCH 00/15] drm/i915: Cure DDI from multiple personality disorder Ville Syrjälä
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=20151210132832.GE20822@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=ville.syrjala@linux.intel.com \
/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