From: Jani Nikula <jani.nikula@linux.intel.com>
To: ville.syrjala@linux.intel.com, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 07/10] drm/i915: Allow 27 bytes child_dev for VBT <109
Date: Wed, 16 Dec 2015 10:58:10 +0200 [thread overview]
Message-ID: <871tamu5wd.fsf@intel.com> (raw)
In-Reply-To: <1450110229-30450-8-git-send-email-ville.syrjala@linux.intel.com>
On Mon, 14 Dec 2015, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> My 85x has VBT version 108 which has a child dev size of 27 bytes.
> Let's allow that without printing an error.
>
> We still want to reject the actual parsin since for that we need
> the child device size to be at least 33 bytes. So we should still
> check for that, but let's make it print a debug message only instead
> of an error.
>
> While at it, toss in a BUILD_BUG_ON() to verify our struct
> old_child_dev_config is in fact 33 bytes.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
This is scary stuff, but
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
as far as the code goes. I don't have the history books to check this
against.
> ---
> drivers/gpu/drm/i915/intel_bios.c | 19 +++++++++++--------
> 1 file changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
> index 070470fe9a91..770b825dabc0 100644
> --- a/drivers/gpu/drm/i915/intel_bios.c
> +++ b/drivers/gpu/drm/i915/intel_bios.c
> @@ -1089,7 +1089,10 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
> DRM_DEBUG_KMS("No general definition block is found, no devices defined.\n");
> return;
> }
> - if (bdb->version < 195) {
> + if (bdb->version < 109) {
> + expected_size = 27;
> + } else if (bdb->version < 195) {
> + BUILD_BUG_ON(sizeof(struct old_child_dev_config) != 33);
> expected_size = sizeof(struct old_child_dev_config);
> } else if (bdb->version == 195) {
> expected_size = 37;
> @@ -1102,18 +1105,18 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
> bdb->version, expected_size);
> }
>
> - /* The legacy sized child device config is the minimum we need. */
> - if (p_defs->child_dev_size < sizeof(struct old_child_dev_config)) {
> - DRM_ERROR("Child device config size %u is too small.\n",
> - p_defs->child_dev_size);
> - return;
> - }
> -
> /* Flag an error for unexpected size, but continue anyway. */
> if (p_defs->child_dev_size != expected_size)
> DRM_ERROR("Unexpected child device config size %u (expected %u for VBT version %u)\n",
> p_defs->child_dev_size, expected_size, bdb->version);
>
> + /* The legacy sized child device config is the minimum we need. */
> + if (p_defs->child_dev_size < sizeof(struct old_child_dev_config)) {
> + DRM_DEBUG_KMS("Child device config size %u is too small.\n",
> + p_defs->child_dev_size);
> + return;
> + }
> +
> /* get the block size of general definitions */
> block_size = get_blocksize(p_defs);
> /* get the number of child device */
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
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-16 8:58 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-14 16:23 [PATCH 00/10] drm/i915: Fixes from my attempt at running igt on gen2 ville.syrjala
2015-12-14 16:23 ` [PATCH 01/10] drm/i915: Release mmaps on partial ggtt vma unbind ville.syrjala
2015-12-14 17:01 ` Chris Wilson
2015-12-14 17:26 ` Ville Syrjälä
2015-12-14 16:23 ` [PATCH 02/10] drm/i915: Cleanup phys status page too ville.syrjala
2015-12-14 17:04 ` Chris Wilson
2016-01-11 18:48 ` [PATCH v2 " ville.syrjala
2016-01-12 10:00 ` Daniel Vetter
2015-12-14 16:23 ` [PATCH 03/10] drm/i915: Write out crc frame counts in hex ville.syrjala
2015-12-16 10:23 ` Daniel Vetter
2015-12-16 10:58 ` Ville Syrjälä
2015-12-16 11:09 ` Daniel Vetter
2015-12-14 16:23 ` [PATCH 04/10] drm/i915: Wait for pipe to start before sampling vblank timestamps on gen2 ville.syrjala
2015-12-16 10:25 ` Daniel Vetter
2015-12-14 16:23 ` [PATCH 05/10] drm/i915: Use drm_vblank_count() on gen2 for crc frame count ville.syrjala
2015-12-16 10:30 ` Daniel Vetter
2015-12-16 12:51 ` Ville Syrjälä
2015-12-16 15:28 ` Daniel Vetter
2015-12-16 17:22 ` Ville Syrjälä
2015-12-21 11:54 ` Daniel Vetter
2015-12-14 16:23 ` [PATCH 06/10] drm/i915: Enable vblank_disable_immediate on gen2 ville.syrjala
2015-12-16 10:31 ` Daniel Vetter
2015-12-16 10:41 ` Chris Wilson
2015-12-14 16:23 ` [PATCH 07/10] drm/i915: Allow 27 bytes child_dev for VBT <109 ville.syrjala
2015-12-16 8:58 ` Jani Nikula [this message]
2015-12-14 16:23 ` [PATCH 08/10] drm/i915: Expect child dev size of 22 bytes for VBT < 106 ville.syrjala
2015-12-16 8:58 ` Jani Nikula
2015-12-14 16:23 ` [PATCH 09/10] drm/i915: Reject < 8 byte batches on 830/845 ville.syrjala
2015-12-14 17:07 ` Chris Wilson
2015-12-14 17:29 ` Ville Syrjälä
2015-12-16 10:36 ` Daniel Vetter
2015-12-16 10:43 ` Chris Wilson
2015-12-16 10:50 ` Daniel Vetter
2015-12-14 16:23 ` [PATCH 10/10] drm/i915: Use MI_BATCH_BUFFER_START " ville.syrjala
2015-12-14 16:58 ` Chris Wilson
2015-12-14 17:25 ` Ville Syrjälä
2015-12-15 10:09 ` Chris Wilson
2015-12-15 10:24 ` Chris Wilson
2015-12-15 11:05 ` Ville Syrjälä
2015-12-15 11:22 ` Chris Wilson
2015-12-15 11:43 ` Ville Syrjälä
2016-01-12 7:49 ` ✗ failure: Fi.CI.BAT Patchwork
2016-01-12 14:54 ` [PATCH 00/10] drm/i915: Fixes from my attempt at running igt on gen2 Ville Syrjälä
2016-01-12 16:02 ` Daniel Vetter
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=871tamu5wd.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--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 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.