From patchwork Wed Aug 12 10:29:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Weinehall X-Patchwork-Id: 7000061 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5BAA09F358 for ; Wed, 12 Aug 2015 10:29:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7EE8F20609 for ; Wed, 12 Aug 2015 10:29:52 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 31AF7205F7 for ; Wed, 12 Aug 2015 10:29:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4060A7A08A; Wed, 12 Aug 2015 03:29:49 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 1B0CA7A08A for ; Wed, 12 Aug 2015 03:29:48 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 12 Aug 2015 03:29:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,660,1432623600"; d="scan'208";a="747049885" Received: from dweineha-mobl3.fi.intel.com (HELO boom) ([10.237.72.77]) by orsmga001.jf.intel.com with ESMTP; 12 Aug 2015 03:29:47 -0700 Date: Wed, 12 Aug 2015 13:29:17 +0300 From: David Weinehall To: Daniel Vetter Message-ID: <20150812102917.GL6150@boom> Mail-Followup-To: Daniel Vetter , Michel Thierry , Antti Koskipaa , "intel-gfx@lists.freedesktop.org" References: <1436526655-2965-1-git-send-email-antti.koskipaa@linux.intel.com> <1436526655-2965-2-git-send-email-antti.koskipaa@linux.intel.com> <20150804135552.GC6150@boom> <20150805085900.GM17734@phenom.ffwll.local> <55C3682E.6080103@intel.com> <20150806140855.GE6150@boom> <20150806153102.GW17734@phenom.ffwll.local> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20150806153102.GW17734@phenom.ffwll.local> X-Editor: Vi Improved X-Accept-Language: Swedish, English X-GPG-Fingerprint: ED69 8CF5 6102 21B9 AFD1 9DB7 0B27 96FD 15DA A404 X-GPG-Key: http://www.acc.umu.se/~tao/files/pub_15daa404.gpg.asc X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "intel-gfx@lists.freedesktop.org" Subject: Re: [Intel-gfx] [PATCH 1/2 v2 addendum] drm/i915: Allow parsing of variable size child device entries from VBT X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 CC: Antti Koskipaa --- 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 + */ if (bdb->version < 195) { expected_size = 33; } else if (bdb->version == 195) { @@ -1051,7 +1055,8 @@ parse_device_mapping(struct drm_i915_private *dev_priv, } if (expected_size > sizeof(*p_child)) { - DRM_ERROR("child_device_config cannot fit in p_child\n"); + DRM_ERROR("child_device_config (size %u) cannot fit in p_child (size %u); bdb->version: %u\n", + expected_size, sizeof(*p_child), bdb->version); return; } diff --git a/drivers/gpu/drm/i915/intel_bios.h b/drivers/gpu/drm/i915/intel_bios.h index f7ad6a585129..71cb96f77870 100644 --- a/drivers/gpu/drm/i915/intel_bios.h +++ b/drivers/gpu/drm/i915/intel_bios.h @@ -239,6 +239,10 @@ struct common_child_dev_config { u8 not_common2[2]; u8 ddc_pin; u16 edid_ptr; + u8 obsolete; + u8 flags_1; + u8 not_common3[13]; + u8 iboost_level; } __packed; /* This field changes depending on the BDB version, so the most reliable way to