From: David Weinehall <david.weinehall@linux.intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 1/2 v2 addendum] drm/i915: Allow parsing of variable size child device entries from VBT
Date: Thu, 13 Aug 2015 13:30:57 +0300 [thread overview]
Message-ID: <20150813103057.GN6150@boom> (raw)
In-Reply-To: <87h9o4u2kw.fsf@intel.com>
On Wed, Aug 12, 2015 at 03:13:35PM +0300, Jani Nikula wrote:
> On Wed, 12 Aug 2015, David Weinehall <david.weinehall@linux.intel.com> wrote:
> > Some more fixup is needed; the bits from Antti's patch
> > that actually expanded the struct to fully fit the newer
> > versions of the child_device_config was part of the second
> > patch; since that patch hasn't been merged yet we need this bit:
> >
> > This applies on top of the patch you already merged
> > (the Iboost patch will need corresponding adjustment to
> > remove the changes I split out):
> >
> > Expand common_child_dev_config to be able to fit all information
> > defined by the latest VBT specification.
> >
> > Signed-off-by: David Weinehall <david.weinehall@linux.intel.com>
> > CC: Antti Koskipaa <antti.koskipaa@linux.intel.com>
> > ---
> > intel_bios.c | 7 ++++++-
> > intel_bios.h | 4 ++++
> > 2 files changed, 10 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
> > index 990acc20771a..40e2cc4e7419 100644
> > --- a/drivers/gpu/drm/i915/intel_bios.c
> > +++ b/drivers/gpu/drm/i915/intel_bios.c
> > @@ -1038,6 +1038,10 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
> > DRM_DEBUG_KMS("No general definition block is found, no devices defined.\n");
> > return;
> > }
> > + /* Remember to keep this in sync with child_device_config;
> > + * whenever a new feature is added to BDB that causes that
> > + * struct to grow this needs to be updated too
> > + */
>
> BUILD_BUG_ON(something about sizeof child device config) ?
The idea is nice, but... We get the size to copy (expected_size)
from the version-switch statement (so it's not available during build);
thus we cannot know at compile time whether expected_size is larger than
sizeof(child_device_config).
This is yet another argument in favour of a version:feature
table I think; that would allow for compile-time validation.
Unless someone else volunteers to refactor this code I can dig in once
I get back from vacation.
Kind regards, David
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-08-13 10:31 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-10 11:10 [PATCH 0/2] VBT and I_boost fixes Antti Koskipaa
2015-07-10 11:10 ` [PATCH 1/2] drm/i915: Allow parsing of variable size child device entries from VBT Antti Koskipaa
2015-07-10 12:32 ` David Weinehall
2015-07-13 9:24 ` Daniel Vetter
2015-07-14 7:11 ` David Weinehall
2015-07-14 8:01 ` Daniel Vetter
2015-08-04 13:55 ` [PATCH 1/2 v2] " David Weinehall
2015-08-05 8:59 ` Daniel Vetter
2015-08-05 15:32 ` David Weinehall
2015-08-06 12:18 ` Daniel Vetter
2015-08-06 14:12 ` David Weinehall
2015-08-06 13:59 ` Michel Thierry
2015-08-06 14:08 ` David Weinehall
2015-08-06 15:31 ` Daniel Vetter
2015-08-12 10:29 ` [PATCH 1/2 v2 addendum] " David Weinehall
2015-08-12 12:13 ` Jani Nikula
2015-08-13 10:30 ` David Weinehall [this message]
2015-08-13 11:35 ` Jani Nikula
2015-08-12 14:19 ` Jani Nikula
2015-08-13 13:14 ` [PATCH 1/2 v2 addendum v2] " David Weinehall
2015-08-14 8:07 ` Timo Aaltonen
2015-08-14 8:42 ` Jani Nikula
2015-08-14 9:40 ` Jani Nikula
2015-07-10 11:10 ` [PATCH 2/2] drm/i915: Per-DDI I_boost override Antti Koskipaa
2015-08-06 14:11 ` David Weinehall
2015-08-06 15:31 ` 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=20150813103057.GN6150@boom \
--to=david.weinehall@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@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