[Intel-gfx] [PATCH 04/25] drm/i915: Add basic support for parsing of VBT OEM Custom Block

Jesse Barnes jbarnes at virtuousgeek.org
Wed Mar 21 20:48:25 CET 2012


From: Rohit Jain <rohit.jain at intel.com>

Added support for parsing the OEM Customizable Modes Block (#20)
in the VBIOS table.

Signed-off-by: Rohit Jain <rohit.jain at intel.com>
Reviewed-by: Shobhit Kumar <shobhit.kumar at intel.com>
Reviewed-by: Vijay A. Purushothaman <vijay.a.purushothaman at intel.com>
Acked-by: Jesse Barnes <jesse.barnes at intel.com>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov at intel.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
---
 drivers/gpu/drm/i915/intel_bios.c |   15 +++++++++++++++
 drivers/gpu/drm/i915/intel_bios.h |   36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 8168d8f..6c170ca 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -450,6 +450,20 @@ parse_driver_features(struct drm_i915_private *dev_priv,
 }
 
 static void
+parse_oem_custom_data(struct drm_i915_private *dev_priv,
+		       struct bdb_header *bdb)
+{
+	struct bdb_oem_custom *oem_data;
+
+	oem_data = find_section(bdb, BDB_OEM_CUSTOM);
+	if (!oem_data)
+		return;
+
+	/* TBD: Read relevant info into dev_priv */
+	return;
+}
+
+static void
 parse_edp(struct drm_i915_private *dev_priv, struct bdb_header *bdb)
 {
 	struct bdb_edp *edp;
@@ -685,6 +699,7 @@ intel_parse_bios(struct drm_device *dev)
 	parse_sdvo_device_mapping(dev_priv, bdb);
 	parse_device_mapping(dev_priv, bdb);
 	parse_driver_features(dev_priv, bdb);
+	parse_oem_custom_data(dev_priv, bdb);
 	parse_edp(dev_priv, bdb);
 
 	if (bios)
diff --git a/drivers/gpu/drm/i915/intel_bios.h b/drivers/gpu/drm/i915/intel_bios.h
index dbda6e3..11ff802 100644
--- a/drivers/gpu/drm/i915/intel_bios.h
+++ b/drivers/gpu/drm/i915/intel_bios.h
@@ -432,6 +432,42 @@ struct bdb_driver_features {
 	u8 custom_vbt_version;
 } __attribute__((packed));
 
+struct oem_mode_info {
+	/* Mode Flags */
+	u8 mode_flag_video_bios:1;
+	u8 mode_flag_driver:1;
+	u8 mode_flag_reserved:6;
+
+	/* Display Flags */
+	u8 crt:1;
+	u8 tv:1;
+	u8 efp:1;
+	u8 lfp:1;
+	u8 crt2:1;
+	u8 tv2:1;
+	u8 efp2:1;
+	u8 lfp2:1;
+
+	u16 x_res;
+	u16 y_res;
+
+	/* Colour Depth */
+	u8 color_depth_8bpp:1;
+	u8 color_depth_16bpp:1;
+	u8 color_depth_32bpp:1;
+	u8 color_depth_reserved:5;
+
+	u8 refresh_rate;
+
+	/* TBD: OEM DTD Value (18 bytes) */
+} __attribute__((packed));
+
+struct bdb_oem_custom {
+	u8 num_rows;
+	u8 row_size;
+	struct oem_mode_info mode_info[6]; /* mode_info[]? */
+} __attribute__((packed));
+
 #define EDP_18BPP	0
 #define EDP_24BPP	1
 #define EDP_30BPP	2
-- 
1.7.5.4




More information about the Intel-gfx mailing list