public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 00/10] drm/i915/bios: child device config refactoring
@ 2017-08-24 18:53 Jani Nikula
  2017-08-24 18:53 ` [PATCH 01/10] drm/i915/bios: amend child device config parameters Jani Nikula
                   ` (11 more replies)
  0 siblings, 12 replies; 15+ messages in thread
From: Jani Nikula @ 2017-08-24 18:53 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

Refactor and clarify the child device config definitions and
parsing. Turn the top level union to handle old and new BDB versions
inside out; have a common struct with unions for the conflicting parts
inside instead.

This should make it easier to add new child device config fields in the
future.

BR,
Jani.


Jani Nikula (10):
  drm/i915/bios: amend child device config parameters
  drm/i915/bios: document BDB versions of child device config fields
  drm/i915/bios: remove the raw version of child device config
  drm/i915/bios: add legacy contents to common child device config
  drm/i915/bios: throw away high level child device union
  drm/i915/bios: throw away struct old_child_dev_config
  drm/i915/bios: document child device config dvo_port values a bit
    better
  drm/i915/bios: group device type definitions together
  drm/i915/bios: throw away unused DVO_* macros
  drm/i915/bios: drop the rest of the p_ prefixes from pointers

 drivers/gpu/drm/i915/i915_drv.h       |   2 +-
 drivers/gpu/drm/i915/intel_bios.c     | 196 +++++++++++------------
 drivers/gpu/drm/i915/intel_vbt_defs.h | 284 ++++++++++++++++++----------------
 3 files changed, 252 insertions(+), 230 deletions(-)

-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 01/10] drm/i915/bios: amend child device config parameters
  2017-08-24 18:53 [PATCH 00/10] drm/i915/bios: child device config refactoring Jani Nikula
@ 2017-08-24 18:53 ` Jani Nikula
  2017-08-25 12:38   ` Ville Syrjälä
  2017-08-24 18:54 ` [PATCH 02/10] drm/i915/bios: document BDB versions of child device config fields Jani Nikula
                   ` (10 subsequent siblings)
  11 siblings, 1 reply; 15+ messages in thread
From: Jani Nikula @ 2017-08-24 18:53 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, Paulo Zanoni

Add both some new and some old fields to child device config
parameters. Prepare for switching to just one child device config. Use
naming from struct old_child_dev_config for common fields.

No functional changes.

Cc: Animesh Manna <animesh.manna@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_vbt_defs.h | 31 +++++++++++++++++++++++++++----
 1 file changed, 27 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_vbt_defs.h b/drivers/gpu/drm/i915/intel_vbt_defs.h
index a92e7762f596..9ad05b2c44e0 100644
--- a/drivers/gpu/drm/i915/intel_vbt_defs.h
+++ b/drivers/gpu/drm/i915/intel_vbt_defs.h
@@ -260,13 +260,28 @@ struct old_child_dev_config {
 /* This one contains field offsets that are known to be common for all BDB
  * versions. Notice that the meaning of the contents contents may still change,
  * but at least the offsets are consistent. */
-
 struct common_child_dev_config {
 	u16 handle;
 	u16 device_type;
-	u8 not_common1[12];
+	u8 i2c_speed;
+	u8 dp_onboard_redriver;					/* 158 */
+	u8 dp_ondock_redriver;					/* 158 */
+	u8 hdmi_level_shifter_value:4;				/* 169 */
+	u8 hdmi_max_data_rate:4;				/* 204 */
+	u16 dtd_buf_ptr;					/* 161 */
+	u8 edidless_efp:1;					/* 161 */
+	u8 compression_enable:1;				/* 198 */
+	u8 compression_method:1;				/* 198 */
+	u8 ganged_edp:1;					/* 202 */
+	u8 reserved0:4;
+	u8 compression_structure_index:4;			/* 198 */
+	u8 reserved1:4;
+	u8 slave_port;						/* 202 */
+	u8 reserved2;
+	u16 addin_offset;
 	u8 dvo_port;
-	u8 not_common2[2];
+	u8 i2c_pin;
+	u8 slave_addr;
 	u8 ddc_pin;
 	u16 edid_ptr;
 	u8 dvo_cfg; /* See DEVICE_CFG_* above */
@@ -281,7 +296,15 @@ struct common_child_dev_config {
 	u8 tmds_support:1;
 	u8 support_reserved:5;
 	u8 aux_channel;
-	u8 not_common3[11];
+	u8 dongle_detect;
+	u8 capabilities;
+	u8 dvo_wiring; /* See DEVICE_WIRE_* above */
+	u8 mipi_bridge_type;					/* 171 */
+	u16 extended_type;
+	u8 dvo_function;
+	u8 flags2;						/* 195 */
+	u8 dp_gpio_index;					/* 195 */
+	u16 dp_gpio_pin_num;					/* 195 */
 	u8 iboost_level;
 } __packed;
 
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 02/10] drm/i915/bios: document BDB versions of child device config fields
  2017-08-24 18:53 [PATCH 00/10] drm/i915/bios: child device config refactoring Jani Nikula
  2017-08-24 18:53 ` [PATCH 01/10] drm/i915/bios: amend child device config parameters Jani Nikula
@ 2017-08-24 18:54 ` Jani Nikula
  2017-08-24 18:54 ` [PATCH 03/10] drm/i915/bios: remove the raw version of child device config Jani Nikula
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Jani Nikula @ 2017-08-24 18:54 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, Paulo Zanoni

Document everything that was introduced after version 155, which seems
to be the baseline for some of the later documentation. No functional
changes.

Cc: Animesh Manna <animesh.manna@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_vbt_defs.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_vbt_defs.h b/drivers/gpu/drm/i915/intel_vbt_defs.h
index 9ad05b2c44e0..6bc28e57f805 100644
--- a/drivers/gpu/drm/i915/intel_vbt_defs.h
+++ b/drivers/gpu/drm/i915/intel_vbt_defs.h
@@ -285,15 +285,15 @@ struct common_child_dev_config {
 	u8 ddc_pin;
 	u16 edid_ptr;
 	u8 dvo_cfg; /* See DEVICE_CFG_* above */
-	u8 efp_routed:1;
-	u8 lane_reversal:1;
-	u8 lspcon:1;
-	u8 iboost:1;
-	u8 hpd_invert:1;
+	u8 efp_routed:1;					/* 158 */
+	u8 lane_reversal:1;					/* 184 */
+	u8 lspcon:1;						/* 192 */
+	u8 iboost:1;						/* 196 */
+	u8 hpd_invert:1;					/* 196 */
 	u8 flag_reserved:3;
-	u8 hdmi_support:1;
-	u8 dp_support:1;
-	u8 tmds_support:1;
+	u8 hdmi_support:1;					/* 158 */
+	u8 dp_support:1;					/* 158 */
+	u8 tmds_support:1;					/* 158 */
 	u8 support_reserved:5;
 	u8 aux_channel;
 	u8 dongle_detect;
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 03/10] drm/i915/bios: remove the raw version of child device config
  2017-08-24 18:53 [PATCH 00/10] drm/i915/bios: child device config refactoring Jani Nikula
  2017-08-24 18:53 ` [PATCH 01/10] drm/i915/bios: amend child device config parameters Jani Nikula
  2017-08-24 18:54 ` [PATCH 02/10] drm/i915/bios: document BDB versions of child device config fields Jani Nikula
@ 2017-08-24 18:54 ` Jani Nikula
  2017-08-24 18:54 ` [PATCH 04/10] drm/i915/bios: add legacy contents to common " Jani Nikula
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Jani Nikula @ 2017-08-24 18:54 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, Paulo Zanoni

Convert the only user of the raw field, switching to the recently added
struct fields. No functional changes.

Cc: Animesh Manna <animesh.manna@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_bios.c     | 2 +-
 drivers/gpu/drm/i915/intel_vbt_defs.h | 3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 183e87e8ea31..9481c906044b 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -1210,7 +1210,7 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,
 
 	if (bdb->version >= 158) {
 		/* The VBT HDMI level shift values match the table we have. */
-		hdmi_level_shift = child->raw[7] & 0xF;
+		hdmi_level_shift = child->common.hdmi_level_shifter_value;
 		DRM_DEBUG_KMS("VBT HDMI level shift for port %c: %d\n",
 			      port_name(port),
 			      hdmi_level_shift);
diff --git a/drivers/gpu/drm/i915/intel_vbt_defs.h b/drivers/gpu/drm/i915/intel_vbt_defs.h
index 6bc28e57f805..293b9e3a6653 100644
--- a/drivers/gpu/drm/i915/intel_vbt_defs.h
+++ b/drivers/gpu/drm/i915/intel_vbt_defs.h
@@ -312,9 +312,6 @@ struct common_child_dev_config {
 /* This field changes depending on the BDB version, so the most reliable way to
  * read it is by checking the BDB version and reading the raw pointer. */
 union child_device_config {
-	/* This one is safe to be used anywhere, but the code should still check
-	 * the BDB version. */
-	u8 raw[33];
 	/* This one should only be kept for legacy code. */
 	struct old_child_dev_config old;
 	/* This one should also be safe to use anywhere, even without version
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 04/10] drm/i915/bios: add legacy contents to common child device config
  2017-08-24 18:53 [PATCH 00/10] drm/i915/bios: child device config refactoring Jani Nikula
                   ` (2 preceding siblings ...)
  2017-08-24 18:54 ` [PATCH 03/10] drm/i915/bios: remove the raw version of child device config Jani Nikula
@ 2017-08-24 18:54 ` Jani Nikula
  2017-08-24 18:54 ` [PATCH 05/10] drm/i915/bios: throw away high level child device union Jani Nikula
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Jani Nikula @ 2017-08-24 18:54 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, Paulo Zanoni

Add legacy contents to common child device config, in preparation for
using a single child device config. Use unions where BDB versions of the
config differ. Use the naming from old_child_dev_config for legacy
fields.

No functional changes.

Cc: Animesh Manna <animesh.manna@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_vbt_defs.h | 101 +++++++++++++++++++++++-----------
 1 file changed, 70 insertions(+), 31 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_vbt_defs.h b/drivers/gpu/drm/i915/intel_vbt_defs.h
index 293b9e3a6653..42d7339f73f9 100644
--- a/drivers/gpu/drm/i915/intel_vbt_defs.h
+++ b/drivers/gpu/drm/i915/intel_vbt_defs.h
@@ -257,27 +257,49 @@ struct old_child_dev_config {
 	u8  dvo_function;
 } __packed;
 
-/* This one contains field offsets that are known to be common for all BDB
- * versions. Notice that the meaning of the contents contents may still change,
- * but at least the offsets are consistent. */
+/*
+ * The child device config, aka the display device data structure, provides a
+ * description of a port and its configuration on the platform.
+ *
+ * The child device config size has been increased, and fields have been added
+ * and their meaning has changed over time. Care must be taken when accessing
+ * basically any of the fields to ensure the correct interpretation for the BDB
+ * version in question.
+ *
+ * When we copy the child device configs to dev_priv->vbt.child_dev, we reserve
+ * space for the full structure below, and initialize the tail not actually
+ * present in VBT to zeros. Accessing those fields is fine, as long as the
+ * default zero is taken into account, again according to the BDB version.
+ *
+ * BDB versions 155 and below are considered legacy, and version 155 seems to be
+ * a baseline for some of the VBT documentation. When adding new fields, please
+ * include the BDB version when the field was added, if it's above that.
+ */
 struct common_child_dev_config {
 	u16 handle;
 	u16 device_type;
-	u8 i2c_speed;
-	u8 dp_onboard_redriver;					/* 158 */
-	u8 dp_ondock_redriver;					/* 158 */
-	u8 hdmi_level_shifter_value:4;				/* 169 */
-	u8 hdmi_max_data_rate:4;				/* 204 */
-	u16 dtd_buf_ptr;					/* 161 */
-	u8 edidless_efp:1;					/* 161 */
-	u8 compression_enable:1;				/* 198 */
-	u8 compression_method:1;				/* 198 */
-	u8 ganged_edp:1;					/* 202 */
-	u8 reserved0:4;
-	u8 compression_structure_index:4;			/* 198 */
-	u8 reserved1:4;
-	u8 slave_port;						/* 202 */
-	u8 reserved2;
+
+	union {
+		u8  device_id[10]; /* ascii string */
+		struct {
+			u8 i2c_speed;
+			u8 dp_onboard_redriver;			/* 158 */
+			u8 dp_ondock_redriver;			/* 158 */
+			u8 hdmi_level_shifter_value:4;		/* 169 */
+			u8 hdmi_max_data_rate:4;		/* 204 */
+			u16 dtd_buf_ptr;			/* 161 */
+			u8 edidless_efp:1;			/* 161 */
+			u8 compression_enable:1;		/* 198 */
+			u8 compression_method:1;		/* 198 */
+			u8 ganged_edp:1;			/* 202 */
+			u8 reserved0:4;
+			u8 compression_structure_index:4;	/* 198 */
+			u8 reserved1:4;
+			u8 slave_port;				/* 202 */
+			u8 reserved2;
+		} __packed;
+	} __packed;
+
 	u16 addin_offset;
 	u8 dvo_port;
 	u8 i2c_pin;
@@ -285,21 +307,38 @@ struct common_child_dev_config {
 	u8 ddc_pin;
 	u16 edid_ptr;
 	u8 dvo_cfg; /* See DEVICE_CFG_* above */
-	u8 efp_routed:1;					/* 158 */
-	u8 lane_reversal:1;					/* 184 */
-	u8 lspcon:1;						/* 192 */
-	u8 iboost:1;						/* 196 */
-	u8 hpd_invert:1;					/* 196 */
-	u8 flag_reserved:3;
-	u8 hdmi_support:1;					/* 158 */
-	u8 dp_support:1;					/* 158 */
-	u8 tmds_support:1;					/* 158 */
-	u8 support_reserved:5;
-	u8 aux_channel;
-	u8 dongle_detect;
+
+	union {
+		struct {
+			u8 dvo2_port;
+			u8 i2c2_pin;
+			u8 slave2_addr;
+			u8 ddc2_pin;
+		} __packed;
+		struct {
+			u8 efp_routed:1;			/* 158 */
+			u8 lane_reversal:1;			/* 184 */
+			u8 lspcon:1;				/* 192 */
+			u8 iboost:1;				/* 196 */
+			u8 hpd_invert:1;			/* 196 */
+			u8 flag_reserved:3;
+			u8 hdmi_support:1;			/* 158 */
+			u8 dp_support:1;			/* 158 */
+			u8 tmds_support:1;			/* 158 */
+			u8 support_reserved:5;
+			u8 aux_channel;
+			u8 dongle_detect;
+		} __packed;
+	} __packed;
+
 	u8 capabilities;
 	u8 dvo_wiring; /* See DEVICE_WIRE_* above */
-	u8 mipi_bridge_type;					/* 171 */
+
+	union {
+		u8 dvo2_wiring;
+		u8 mipi_bridge_type;				/* 171 */
+	} __packed;
+
 	u16 extended_type;
 	u8 dvo_function;
 	u8 flags2;						/* 195 */
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 05/10] drm/i915/bios: throw away high level child device union
  2017-08-24 18:53 [PATCH 00/10] drm/i915/bios: child device config refactoring Jani Nikula
                   ` (3 preceding siblings ...)
  2017-08-24 18:54 ` [PATCH 04/10] drm/i915/bios: add legacy contents to common " Jani Nikula
@ 2017-08-24 18:54 ` Jani Nikula
  2017-08-24 18:54 ` [PATCH 06/10] drm/i915/bios: throw away struct old_child_dev_config Jani Nikula
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Jani Nikula @ 2017-08-24 18:54 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, Paulo Zanoni

All the child device config fields, including legacy, are now available
in the same struct, so use it for everything.

As this change touches plenty of code with "p_child", rename them to
"child" while at it. Also do some simple unification and constification
where not intrusive. This in the name of avoiding extra cleanup churn
for the same lines as here.

No functional changes.

Cc: Animesh Manna <animesh.manna@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h       |   2 +-
 drivers/gpu/drm/i915/intel_bios.c     | 119 ++++++++++++++++++----------------
 drivers/gpu/drm/i915/intel_vbt_defs.h |  13 +---
 3 files changed, 65 insertions(+), 69 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 7587ef53026b..185a7bf75598 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1723,7 +1723,7 @@ struct intel_vbt_data {
 	int crt_ddc_pin;
 
 	int child_dev_num;
-	union child_device_config *child_dev;
+	struct child_device_config *child_dev;
 
 	struct ddi_vbt_port_info ddi_port_info[I915_MAX_PORTS];
 	struct sdvo_device_mapping sdvo_mappings[2];
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 9481c906044b..a0c1a7deb2a9 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -452,7 +452,7 @@ parse_general_definitions(struct drm_i915_private *dev_priv,
 	}
 }
 
-static const union child_device_config *
+static const struct child_device_config *
 child_device_ptr(const struct bdb_general_definitions *p_defs, int i)
 {
 	return (const void *) &p_defs->devices[i * p_defs->child_dev_size];
@@ -464,7 +464,7 @@ parse_sdvo_device_mapping(struct drm_i915_private *dev_priv,
 {
 	struct sdvo_device_mapping *p_mapping;
 	const struct bdb_general_definitions *p_defs;
-	const struct old_child_dev_config *child; /* legacy */
+	const struct child_device_config *child;
 	int i, child_device_num, count;
 	u16	block_size;
 
@@ -479,7 +479,7 @@ parse_sdvo_device_mapping(struct drm_i915_private *dev_priv,
 	 * device size matches that of the *legacy* child device config
 	 * struct. Thus, SDVO mapping will be skipped for newer VBT.
 	 */
-	if (p_defs->child_dev_size != sizeof(*child)) {
+	if (p_defs->child_dev_size != sizeof(struct old_child_dev_config)) {
 		DRM_DEBUG_KMS("Unsupported child device size for SDVO mapping.\n");
 		return;
 	}
@@ -490,7 +490,7 @@ parse_sdvo_device_mapping(struct drm_i915_private *dev_priv,
 		p_defs->child_dev_size;
 	count = 0;
 	for (i = 0; i < child_device_num; i++) {
-		child = &child_device_ptr(p_defs, i)->old;
+		child = child_device_ptr(p_defs, i);
 		if (!child->device_type) {
 			/* skip the device block if device type is invalid */
 			continue;
@@ -1113,7 +1113,7 @@ static void sanitize_aux_ch(struct drm_i915_private *dev_priv,
 static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,
 			   const struct bdb_header *bdb)
 {
-	union child_device_config *it, *child = NULL;
+	struct child_device_config *it, *child = NULL;
 	struct ddi_vbt_port_info *info = &dev_priv->vbt.ddi_port_info[port];
 	uint8_t hdmi_level_shift;
 	int i, j;
@@ -1141,7 +1141,7 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,
 			if (dvo_ports[port][j] == -1)
 				break;
 
-			if (it->common.dvo_port == dvo_ports[port][j]) {
+			if (it->dvo_port == dvo_ports[port][j]) {
 				if (child) {
 					DRM_DEBUG_KMS("More than one child device for port %c in VBT, using the first.\n",
 						      port_name(port));
@@ -1154,14 +1154,14 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,
 	if (!child)
 		return;
 
-	aux_channel = child->common.aux_channel;
-	ddc_pin = child->common.ddc_pin;
+	aux_channel = child->aux_channel;
+	ddc_pin = child->ddc_pin;
 
-	is_dvi = child->common.device_type & DEVICE_TYPE_TMDS_DVI_SIGNALING;
-	is_dp = child->common.device_type & DEVICE_TYPE_DISPLAYPORT_OUTPUT;
-	is_crt = child->common.device_type & DEVICE_TYPE_ANALOG_OUTPUT;
-	is_hdmi = is_dvi && (child->common.device_type & DEVICE_TYPE_NOT_HDMI_OUTPUT) == 0;
-	is_edp = is_dp && (child->common.device_type & DEVICE_TYPE_INTERNAL_CONNECTOR);
+	is_dvi = child->device_type & DEVICE_TYPE_TMDS_DVI_SIGNALING;
+	is_dp = child->device_type & DEVICE_TYPE_DISPLAYPORT_OUTPUT;
+	is_crt = child->device_type & DEVICE_TYPE_ANALOG_OUTPUT;
+	is_hdmi = is_dvi && (child->device_type & DEVICE_TYPE_NOT_HDMI_OUTPUT) == 0;
+	is_edp = is_dp && (child->device_type & DEVICE_TYPE_INTERNAL_CONNECTOR);
 
 	info->supports_dvi = is_dvi;
 	info->supports_hdmi = is_hdmi;
@@ -1210,7 +1210,7 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,
 
 	if (bdb->version >= 158) {
 		/* The VBT HDMI level shift values match the table we have. */
-		hdmi_level_shift = child->common.hdmi_level_shifter_value;
+		hdmi_level_shift = child->hdmi_level_shifter_value;
 		DRM_DEBUG_KMS("VBT HDMI level shift for port %c: %d\n",
 			      port_name(port),
 			      hdmi_level_shift);
@@ -1218,11 +1218,11 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,
 	}
 
 	/* Parse the I_boost config for SKL and above */
-	if (bdb->version >= 196 && child->common.iboost) {
-		info->dp_boost_level = translate_iboost(child->common.iboost_level & 0xF);
+	if (bdb->version >= 196 && child->iboost) {
+		info->dp_boost_level = translate_iboost(child->iboost_level & 0xF);
 		DRM_DEBUG_KMS("VBT (e)DP boost level for port %c: %d\n",
 			      port_name(port), info->dp_boost_level);
-		info->hdmi_boost_level = translate_iboost(child->common.iboost_level >> 4);
+		info->hdmi_boost_level = translate_iboost(child->iboost_level >> 4);
 		DRM_DEBUG_KMS("VBT HDMI boost level for port %c: %d\n",
 			      port_name(port), info->hdmi_boost_level);
 	}
@@ -1251,8 +1251,8 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
 		     const struct bdb_header *bdb)
 {
 	const struct bdb_general_definitions *p_defs;
-	const union child_device_config *p_child;
-	union child_device_config *child_dev_ptr;
+	const struct child_device_config *p_child;
+	struct child_device_config *child_dev_ptr;
 	int i, child_device_num, count;
 	u8 expected_size;
 	u16 block_size;
@@ -1301,7 +1301,7 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
 	/* get the number of child device that is present */
 	for (i = 0; i < child_device_num; i++) {
 		p_child = child_device_ptr(p_defs, i);
-		if (!p_child->common.device_type) {
+		if (!p_child->device_type) {
 			/* skip the device block if device type is invalid */
 			continue;
 		}
@@ -1321,7 +1321,7 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
 	count = 0;
 	for (i = 0; i < child_device_num; i++) {
 		p_child = child_device_ptr(p_defs, i);
-		if (!p_child->common.device_type) {
+		if (!p_child->device_type) {
 			/* skip the device block if device type is invalid */
 			continue;
 		}
@@ -1343,12 +1343,12 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
 		 */
 		if (bdb->version < 196) {
 			/* Set default values for bits added from v196 */
-			child_dev_ptr->common.iboost = 0;
-			child_dev_ptr->common.hpd_invert = 0;
+			child_dev_ptr->iboost = 0;
+			child_dev_ptr->hpd_invert = 0;
 		}
 
 		if (bdb->version < 192)
-			child_dev_ptr->common.lspcon = 0;
+			child_dev_ptr->lspcon = 0;
 	}
 	return;
 }
@@ -1559,7 +1559,7 @@ void intel_bios_init(struct drm_i915_private *dev_priv)
  */
 bool intel_bios_is_tv_present(struct drm_i915_private *dev_priv)
 {
-	union child_device_config *p_child;
+	const struct child_device_config *child;
 	int i;
 
 	if (!dev_priv->vbt.int_tv_support)
@@ -1569,11 +1569,11 @@ bool intel_bios_is_tv_present(struct drm_i915_private *dev_priv)
 		return true;
 
 	for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
-		p_child = dev_priv->vbt.child_dev + i;
+		child = dev_priv->vbt.child_dev + i;
 		/*
 		 * If the device type is not TV, continue.
 		 */
-		switch (p_child->old.device_type) {
+		switch (child->device_type) {
 		case DEVICE_TYPE_INT_TV:
 		case DEVICE_TYPE_TV:
 		case DEVICE_TYPE_TV_SVIDEO_COMPOSITE:
@@ -1584,7 +1584,7 @@ bool intel_bios_is_tv_present(struct drm_i915_private *dev_priv)
 		/* Only when the addin_offset is non-zero, it is regarded
 		 * as present.
 		 */
-		if (p_child->old.addin_offset)
+		if (child->addin_offset)
 			return true;
 	}
 
@@ -1601,14 +1601,14 @@ bool intel_bios_is_tv_present(struct drm_i915_private *dev_priv)
  */
 bool intel_bios_is_lvds_present(struct drm_i915_private *dev_priv, u8 *i2c_pin)
 {
+	const struct child_device_config *child;
 	int i;
 
 	if (!dev_priv->vbt.child_dev_num)
 		return true;
 
 	for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
-		union child_device_config *uchild = dev_priv->vbt.child_dev + i;
-		struct old_child_dev_config *child = &uchild->old;
+		child = dev_priv->vbt.child_dev + i;
 
 		/* If the device type is not LFP, continue.
 		 * We have to check both the new identifiers as well as the
@@ -1650,6 +1650,7 @@ bool intel_bios_is_lvds_present(struct drm_i915_private *dev_priv, u8 *i2c_pin)
  */
 bool intel_bios_is_port_present(struct drm_i915_private *dev_priv, enum port port)
 {
+	const struct child_device_config *child;
 	static const struct {
 		u16 dp, hdmi;
 	} port_mapping[] = {
@@ -1668,12 +1669,12 @@ bool intel_bios_is_port_present(struct drm_i915_private *dev_priv, enum port por
 		return false;
 
 	for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
-		const union child_device_config *p_child =
-			&dev_priv->vbt.child_dev[i];
-		if ((p_child->common.dvo_port == port_mapping[port].dp ||
-		     p_child->common.dvo_port == port_mapping[port].hdmi) &&
-		    (p_child->common.device_type & (DEVICE_TYPE_TMDS_DVI_SIGNALING |
-						    DEVICE_TYPE_DISPLAYPORT_OUTPUT)))
+		child = dev_priv->vbt.child_dev + i;
+
+		if ((child->dvo_port == port_mapping[port].dp ||
+		     child->dvo_port == port_mapping[port].hdmi) &&
+		    (child->device_type & (DEVICE_TYPE_TMDS_DVI_SIGNALING |
+					   DEVICE_TYPE_DISPLAYPORT_OUTPUT)))
 			return true;
 	}
 
@@ -1689,7 +1690,7 @@ bool intel_bios_is_port_present(struct drm_i915_private *dev_priv, enum port por
  */
 bool intel_bios_is_port_edp(struct drm_i915_private *dev_priv, enum port port)
 {
-	union child_device_config *p_child;
+	const struct child_device_config *child;
 	static const short port_mapping[] = {
 		[PORT_B] = DVO_PORT_DPB,
 		[PORT_C] = DVO_PORT_DPC,
@@ -1705,10 +1706,10 @@ bool intel_bios_is_port_edp(struct drm_i915_private *dev_priv, enum port port)
 		return false;
 
 	for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
-		p_child = dev_priv->vbt.child_dev + i;
+		child = dev_priv->vbt.child_dev + i;
 
-		if (p_child->common.dvo_port == port_mapping[port] &&
-		    (p_child->common.device_type & DEVICE_TYPE_eDP_BITS) ==
+		if (child->dvo_port == port_mapping[port] &&
+		    (child->device_type & DEVICE_TYPE_eDP_BITS) ==
 		    (DEVICE_TYPE_eDP & DEVICE_TYPE_eDP_BITS))
 			return true;
 	}
@@ -1716,7 +1717,7 @@ bool intel_bios_is_port_edp(struct drm_i915_private *dev_priv, enum port port)
 	return false;
 }
 
-static bool child_dev_is_dp_dual_mode(const union child_device_config *p_child,
+static bool child_dev_is_dp_dual_mode(const struct child_device_config *child,
 				      enum port port)
 {
 	static const struct {
@@ -1735,16 +1736,16 @@ static bool child_dev_is_dp_dual_mode(const union child_device_config *p_child,
 	if (port == PORT_A || port >= ARRAY_SIZE(port_mapping))
 		return false;
 
-	if ((p_child->common.device_type & DEVICE_TYPE_DP_DUAL_MODE_BITS) !=
+	if ((child->device_type & DEVICE_TYPE_DP_DUAL_MODE_BITS) !=
 	    (DEVICE_TYPE_DP_DUAL_MODE & DEVICE_TYPE_DP_DUAL_MODE_BITS))
 		return false;
 
-	if (p_child->common.dvo_port == port_mapping[port].dp)
+	if (child->dvo_port == port_mapping[port].dp)
 		return true;
 
 	/* Only accept a HDMI dvo_port as DP++ if it has an AUX channel */
-	if (p_child->common.dvo_port == port_mapping[port].hdmi &&
-	    p_child->common.aux_channel != 0)
+	if (child->dvo_port == port_mapping[port].hdmi &&
+	    child->aux_channel != 0)
 		return true;
 
 	return false;
@@ -1753,13 +1754,13 @@ static bool child_dev_is_dp_dual_mode(const union child_device_config *p_child,
 bool intel_bios_is_port_dp_dual_mode(struct drm_i915_private *dev_priv,
 				     enum port port)
 {
+	const struct child_device_config *child;
 	int i;
 
 	for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
-		const union child_device_config *p_child =
-			&dev_priv->vbt.child_dev[i];
+		child = dev_priv->vbt.child_dev + i;
 
-		if (child_dev_is_dp_dual_mode(p_child, port))
+		if (child_dev_is_dp_dual_mode(child, port))
 			return true;
 	}
 
@@ -1776,17 +1777,17 @@ bool intel_bios_is_port_dp_dual_mode(struct drm_i915_private *dev_priv,
 bool intel_bios_is_dsi_present(struct drm_i915_private *dev_priv,
 			       enum port *port)
 {
-	union child_device_config *p_child;
+	const struct child_device_config *child;
 	u8 dvo_port;
 	int i;
 
 	for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
-		p_child = dev_priv->vbt.child_dev + i;
+		child = dev_priv->vbt.child_dev + i;
 
-		if (!(p_child->common.device_type & DEVICE_TYPE_MIPI_OUTPUT))
+		if (!(child->device_type & DEVICE_TYPE_MIPI_OUTPUT))
 			continue;
 
-		dvo_port = p_child->common.dvo_port;
+		dvo_port = child->dvo_port;
 
 		switch (dvo_port) {
 		case DVO_PORT_MIPIA:
@@ -1816,16 +1817,19 @@ bool
 intel_bios_is_port_hpd_inverted(struct drm_i915_private *dev_priv,
 				enum port port)
 {
+	const struct child_device_config *child;
 	int i;
 
 	if (WARN_ON_ONCE(!IS_GEN9_LP(dev_priv)))
 		return false;
 
 	for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
-		if (!dev_priv->vbt.child_dev[i].common.hpd_invert)
+		child = dev_priv->vbt.child_dev + i;
+
+		if (!child->hpd_invert)
 			continue;
 
-		switch (dev_priv->vbt.child_dev[i].common.dvo_port) {
+		switch (child->dvo_port) {
 		case DVO_PORT_DPA:
 		case DVO_PORT_HDMIA:
 			if (port == PORT_A)
@@ -1860,16 +1864,19 @@ bool
 intel_bios_is_lspcon_present(struct drm_i915_private *dev_priv,
 				enum port port)
 {
+	const struct child_device_config *child;
 	int i;
 
 	if (!HAS_LSPCON(dev_priv))
 		return false;
 
 	for (i = 0; i < dev_priv->vbt.child_dev_num; i++) {
-		if (!dev_priv->vbt.child_dev[i].common.lspcon)
+		child = dev_priv->vbt.child_dev + i;
+
+		if (!child->lspcon)
 			continue;
 
-		switch (dev_priv->vbt.child_dev[i].common.dvo_port) {
+		switch (child->dvo_port) {
 		case DVO_PORT_DPA:
 		case DVO_PORT_HDMIA:
 			if (port == PORT_A)
diff --git a/drivers/gpu/drm/i915/intel_vbt_defs.h b/drivers/gpu/drm/i915/intel_vbt_defs.h
index 42d7339f73f9..c8c15e5425e0 100644
--- a/drivers/gpu/drm/i915/intel_vbt_defs.h
+++ b/drivers/gpu/drm/i915/intel_vbt_defs.h
@@ -275,7 +275,7 @@ struct old_child_dev_config {
  * a baseline for some of the VBT documentation. When adding new fields, please
  * include the BDB version when the field was added, if it's above that.
  */
-struct common_child_dev_config {
+struct child_device_config {
 	u16 handle;
 	u16 device_type;
 
@@ -347,17 +347,6 @@ struct common_child_dev_config {
 	u8 iboost_level;
 } __packed;
 
-
-/* This field changes depending on the BDB version, so the most reliable way to
- * read it is by checking the BDB version and reading the raw pointer. */
-union child_device_config {
-	/* This one should only be kept for legacy code. */
-	struct old_child_dev_config old;
-	/* This one should also be safe to use anywhere, even without version
-	 * checks. */
-	struct common_child_dev_config common;
-} __packed;
-
 struct bdb_general_definitions {
 	/* DDC GPIO */
 	u8 crt_ddc_gmbus_pin;
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 06/10] drm/i915/bios: throw away struct old_child_dev_config
  2017-08-24 18:53 [PATCH 00/10] drm/i915/bios: child device config refactoring Jani Nikula
                   ` (4 preceding siblings ...)
  2017-08-24 18:54 ` [PATCH 05/10] drm/i915/bios: throw away high level child device union Jani Nikula
@ 2017-08-24 18:54 ` Jani Nikula
  2017-08-24 18:54 ` [PATCH 07/10] drm/i915/bios: document child device config dvo_port values a bit better Jani Nikula
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Jani Nikula @ 2017-08-24 18:54 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, Paulo Zanoni

The old_child_dev_config struct is no longer needed except for its size;
replace with a macro. No functional change.

Cc: Animesh Manna <animesh.manna@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_bios.c     |  7 +++----
 drivers/gpu/drm/i915/intel_vbt_defs.h | 27 +--------------------------
 2 files changed, 4 insertions(+), 30 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index a0c1a7deb2a9..dd732a5f9361 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -479,7 +479,7 @@ parse_sdvo_device_mapping(struct drm_i915_private *dev_priv,
 	 * device size matches that of the *legacy* child device config
 	 * struct. Thus, SDVO mapping will be skipped for newer VBT.
 	 */
-	if (p_defs->child_dev_size != sizeof(struct old_child_dev_config)) {
+	if (p_defs->child_dev_size != LEGACY_CHILD_DEVICE_CONFIG_SIZE) {
 		DRM_DEBUG_KMS("Unsupported child device size for SDVO mapping.\n");
 		return;
 	}
@@ -1267,8 +1267,7 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
 	} else if (bdb->version < 111) {
 		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);
+		expected_size = LEGACY_CHILD_DEVICE_CONFIG_SIZE;
 	} else if (bdb->version == 195) {
 		expected_size = 37;
 	} else if (bdb->version <= 197) {
@@ -1286,7 +1285,7 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
 			  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)) {
+	if (p_defs->child_dev_size < LEGACY_CHILD_DEVICE_CONFIG_SIZE) {
 		DRM_DEBUG_KMS("Child device config size %u is too small.\n",
 			      p_defs->child_dev_size);
 		return;
diff --git a/drivers/gpu/drm/i915/intel_vbt_defs.h b/drivers/gpu/drm/i915/intel_vbt_defs.h
index c8c15e5425e0..fc67b2ed6a20 100644
--- a/drivers/gpu/drm/i915/intel_vbt_defs.h
+++ b/drivers/gpu/drm/i915/intel_vbt_defs.h
@@ -230,32 +230,7 @@ struct bdb_general_features {
 #define DEVICE_PORT_DVOB	0x01
 #define DEVICE_PORT_DVOC	0x02
 
-/*
- * We used to keep this struct but without any version control. We should avoid
- * using it in the future, but it should be safe to keep using it in the old
- * code. Do not change; we rely on its size.
- */
-struct old_child_dev_config {
-	u16 handle;
-	u16 device_type;
-	u8  device_id[10]; /* ascii string */
-	u16 addin_offset;
-	u8  dvo_port; /* See Device_PORT_* above */
-	u8  i2c_pin;
-	u8  slave_addr;
-	u8  ddc_pin;
-	u16 edid_ptr;
-	u8  dvo_cfg; /* See DEVICE_CFG_* above */
-	u8  dvo2_port;
-	u8  i2c2_pin;
-	u8  slave2_addr;
-	u8  ddc2_pin;
-	u8  capabilities;
-	u8  dvo_wiring;/* See DEVICE_WIRE_* above */
-	u8  dvo2_wiring;
-	u16 extended_type;
-	u8  dvo_function;
-} __packed;
+#define LEGACY_CHILD_DEVICE_CONFIG_SIZE		33
 
 /*
  * The child device config, aka the display device data structure, provides a
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 07/10] drm/i915/bios: document child device config dvo_port values a bit better
  2017-08-24 18:53 [PATCH 00/10] drm/i915/bios: child device config refactoring Jani Nikula
                   ` (5 preceding siblings ...)
  2017-08-24 18:54 ` [PATCH 06/10] drm/i915/bios: throw away struct old_child_dev_config Jani Nikula
@ 2017-08-24 18:54 ` Jani Nikula
  2017-08-24 18:54 ` [PATCH 08/10] drm/i915/bios: group device type definitions together Jani Nikula
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Jani Nikula @ 2017-08-24 18:54 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, Paulo Zanoni

Move closer to child device config struct while at it. No functional
changes.

Cc: Animesh Manna <animesh.manna@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_vbt_defs.h | 41 ++++++++++++++++++-----------------
 1 file changed, 21 insertions(+), 20 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_vbt_defs.h b/drivers/gpu/drm/i915/intel_vbt_defs.h
index fc67b2ed6a20..b0a5a89b2ac5 100644
--- a/drivers/gpu/drm/i915/intel_vbt_defs.h
+++ b/drivers/gpu/drm/i915/intel_vbt_defs.h
@@ -226,10 +226,30 @@ struct bdb_general_features {
 #define DEVICE_WIRE_DVOB_MASTER 0x0d
 #define DEVICE_WIRE_DVOC_MASTER 0x0e
 
+/* dvo_port pre BDB 155 */
 #define DEVICE_PORT_DVOA	0x00 /* none on 845+ */
 #define DEVICE_PORT_DVOB	0x01
 #define DEVICE_PORT_DVOC	0x02
 
+/* dvo_port BDB 155+ */
+#define DVO_PORT_HDMIA		0
+#define DVO_PORT_HDMIB		1
+#define DVO_PORT_HDMIC		2
+#define DVO_PORT_HDMID		3
+#define DVO_PORT_LVDS		4
+#define DVO_PORT_TV		5
+#define DVO_PORT_CRT		6
+#define DVO_PORT_DPB		7
+#define DVO_PORT_DPC		8
+#define DVO_PORT_DPD		9
+#define DVO_PORT_DPA		10
+#define DVO_PORT_DPE		11				/* 193 */
+#define DVO_PORT_HDMIE		12				/* 193 */
+#define DVO_PORT_MIPIA		21				/* 171 */
+#define DVO_PORT_MIPIB		22				/* 171 */
+#define DVO_PORT_MIPIC		23				/* 171 */
+#define DVO_PORT_MIPID		24				/* 171 */
+
 #define LEGACY_CHILD_DEVICE_CONFIG_SIZE		33
 
 /*
@@ -276,7 +296,7 @@ struct child_device_config {
 	} __packed;
 
 	u16 addin_offset;
-	u8 dvo_port;
+	u8 dvo_port; /* See DEVICE_PORT_* and DVO_PORT_* above */
 	u8 i2c_pin;
 	u8 slave_addr;
 	u8 ddc_pin;
@@ -824,25 +844,6 @@ struct bdb_psr {
 #define		DVO_C		2
 #define		DVO_D		3
 
-/* Possible values for the "DVO Port" field for versions >= 155: */
-#define DVO_PORT_HDMIA	0
-#define DVO_PORT_HDMIB	1
-#define DVO_PORT_HDMIC	2
-#define DVO_PORT_HDMID	3
-#define DVO_PORT_LVDS	4
-#define DVO_PORT_TV	5
-#define DVO_PORT_CRT	6
-#define DVO_PORT_DPB	7
-#define DVO_PORT_DPC	8
-#define DVO_PORT_DPD	9
-#define DVO_PORT_DPA	10
-#define DVO_PORT_DPE	11
-#define DVO_PORT_HDMIE	12
-#define DVO_PORT_MIPIA	21
-#define DVO_PORT_MIPIB	22
-#define DVO_PORT_MIPIC	23
-#define DVO_PORT_MIPID	24
-
 /* Block 52 contains MIPI configuration block
  * 6 * bdb_mipi_config, followed by 6 pps data block
  * block below
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 08/10] drm/i915/bios: group device type definitions together
  2017-08-24 18:53 [PATCH 00/10] drm/i915/bios: child device config refactoring Jani Nikula
                   ` (6 preceding siblings ...)
  2017-08-24 18:54 ` [PATCH 07/10] drm/i915/bios: document child device config dvo_port values a bit better Jani Nikula
@ 2017-08-24 18:54 ` Jani Nikula
  2017-08-24 18:54 ` [PATCH 09/10] drm/i915/bios: throw away unused DVO_* macros Jani Nikula
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Jani Nikula @ 2017-08-24 18:54 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, Paulo Zanoni

No idea why some definitions were defined at a different place from the
rest. Move them together. No functional changes.

Cc: Animesh Manna <animesh.manna@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_vbt_defs.h | 103 +++++++++++++++++-----------------
 1 file changed, 51 insertions(+), 52 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_vbt_defs.h b/drivers/gpu/drm/i915/intel_vbt_defs.h
index b0a5a89b2ac5..15803a020a97 100644
--- a/drivers/gpu/drm/i915/intel_vbt_defs.h
+++ b/drivers/gpu/drm/i915/intel_vbt_defs.h
@@ -206,6 +206,56 @@ struct bdb_general_features {
 #define DEVICE_TYPE_LFP_LVDS_DUAL	0x5162
 #define DEVICE_TYPE_LFP_LVDS_DUAL_HDCP	0x51e2
 
+/* Add the device class for LFP, TV, HDMI */
+#define DEVICE_TYPE_INT_LFP		0x1022
+#define DEVICE_TYPE_INT_TV		0x1009
+#define DEVICE_TYPE_HDMI		0x60D2
+#define DEVICE_TYPE_DP			0x68C6
+#define DEVICE_TYPE_DP_DUAL_MODE	0x60D6
+#define DEVICE_TYPE_eDP			0x78C6
+
+#define DEVICE_TYPE_CLASS_EXTENSION	(1 << 15)
+#define DEVICE_TYPE_POWER_MANAGEMENT	(1 << 14)
+#define DEVICE_TYPE_HOTPLUG_SIGNALING	(1 << 13)
+#define DEVICE_TYPE_INTERNAL_CONNECTOR	(1 << 12)
+#define DEVICE_TYPE_NOT_HDMI_OUTPUT	(1 << 11)
+#define DEVICE_TYPE_MIPI_OUTPUT		(1 << 10)
+#define DEVICE_TYPE_COMPOSITE_OUTPUT	(1 << 9)
+#define DEVICE_TYPE_DUAL_CHANNEL	(1 << 8)
+#define DEVICE_TYPE_HIGH_SPEED_LINK	(1 << 6)
+#define DEVICE_TYPE_LVDS_SINGALING	(1 << 5)
+#define DEVICE_TYPE_TMDS_DVI_SIGNALING	(1 << 4)
+#define DEVICE_TYPE_VIDEO_SIGNALING	(1 << 3)
+#define DEVICE_TYPE_DISPLAYPORT_OUTPUT	(1 << 2)
+#define DEVICE_TYPE_DIGITAL_OUTPUT	(1 << 1)
+#define DEVICE_TYPE_ANALOG_OUTPUT	(1 << 0)
+
+/*
+ * Bits we care about when checking for DEVICE_TYPE_eDP. Depending on the
+ * system, the other bits may or may not be set for eDP outputs.
+ */
+#define DEVICE_TYPE_eDP_BITS \
+	(DEVICE_TYPE_INTERNAL_CONNECTOR |	\
+	 DEVICE_TYPE_MIPI_OUTPUT |		\
+	 DEVICE_TYPE_COMPOSITE_OUTPUT |		\
+	 DEVICE_TYPE_DUAL_CHANNEL |		\
+	 DEVICE_TYPE_LVDS_SINGALING |		\
+	 DEVICE_TYPE_TMDS_DVI_SIGNALING |	\
+	 DEVICE_TYPE_VIDEO_SIGNALING |		\
+	 DEVICE_TYPE_DISPLAYPORT_OUTPUT |	\
+	 DEVICE_TYPE_ANALOG_OUTPUT)
+
+#define DEVICE_TYPE_DP_DUAL_MODE_BITS \
+	(DEVICE_TYPE_INTERNAL_CONNECTOR |	\
+	 DEVICE_TYPE_MIPI_OUTPUT |		\
+	 DEVICE_TYPE_COMPOSITE_OUTPUT |		\
+	 DEVICE_TYPE_LVDS_SINGALING |		\
+	 DEVICE_TYPE_TMDS_DVI_SIGNALING |	\
+	 DEVICE_TYPE_VIDEO_SIGNALING |		\
+	 DEVICE_TYPE_DISPLAYPORT_OUTPUT |	\
+	 DEVICE_TYPE_DIGITAL_OUTPUT |		\
+	 DEVICE_TYPE_ANALOG_OUTPUT)
+
 #define DEVICE_CFG_NONE		0x00
 #define DEVICE_CFG_12BIT_DVOB	0x01
 #define DEVICE_CFG_12BIT_DVOC	0x02
@@ -272,7 +322,7 @@ struct bdb_general_features {
  */
 struct child_device_config {
 	u16 handle;
-	u16 device_type;
+	u16 device_type; /* See DEVICE_TYPE_* above */
 
 	union {
 		u8  device_id[10]; /* ascii string */
@@ -788,57 +838,6 @@ struct bdb_psr {
 #define   SWF14_APM_STANDBY	0x1
 #define   SWF14_APM_RESTORE	0x0
 
-/* Add the device class for LFP, TV, HDMI */
-#define	 DEVICE_TYPE_INT_LFP	0x1022
-#define	 DEVICE_TYPE_INT_TV	0x1009
-#define	 DEVICE_TYPE_HDMI	0x60D2
-#define	 DEVICE_TYPE_DP		0x68C6
-#define	 DEVICE_TYPE_DP_DUAL_MODE	0x60D6
-#define	 DEVICE_TYPE_eDP	0x78C6
-
-#define  DEVICE_TYPE_CLASS_EXTENSION	(1 << 15)
-#define  DEVICE_TYPE_POWER_MANAGEMENT	(1 << 14)
-#define  DEVICE_TYPE_HOTPLUG_SIGNALING	(1 << 13)
-#define  DEVICE_TYPE_INTERNAL_CONNECTOR	(1 << 12)
-#define  DEVICE_TYPE_NOT_HDMI_OUTPUT	(1 << 11)
-#define  DEVICE_TYPE_MIPI_OUTPUT	(1 << 10)
-#define  DEVICE_TYPE_COMPOSITE_OUTPUT	(1 << 9)
-#define  DEVICE_TYPE_DUAL_CHANNEL	(1 << 8)
-#define  DEVICE_TYPE_HIGH_SPEED_LINK	(1 << 6)
-#define  DEVICE_TYPE_LVDS_SINGALING	(1 << 5)
-#define  DEVICE_TYPE_TMDS_DVI_SIGNALING	(1 << 4)
-#define  DEVICE_TYPE_VIDEO_SIGNALING	(1 << 3)
-#define  DEVICE_TYPE_DISPLAYPORT_OUTPUT	(1 << 2)
-#define  DEVICE_TYPE_DIGITAL_OUTPUT	(1 << 1)
-#define  DEVICE_TYPE_ANALOG_OUTPUT	(1 << 0)
-
-/*
- * Bits we care about when checking for DEVICE_TYPE_eDP
- * Depending on the system, the other bits may or may not
- * be set for eDP outputs.
- */
-#define DEVICE_TYPE_eDP_BITS \
-	(DEVICE_TYPE_INTERNAL_CONNECTOR | \
-	 DEVICE_TYPE_MIPI_OUTPUT | \
-	 DEVICE_TYPE_COMPOSITE_OUTPUT | \
-	 DEVICE_TYPE_DUAL_CHANNEL | \
-	 DEVICE_TYPE_LVDS_SINGALING | \
-	 DEVICE_TYPE_TMDS_DVI_SIGNALING | \
-	 DEVICE_TYPE_VIDEO_SIGNALING | \
-	 DEVICE_TYPE_DISPLAYPORT_OUTPUT | \
-	 DEVICE_TYPE_ANALOG_OUTPUT)
-
-#define DEVICE_TYPE_DP_DUAL_MODE_BITS \
-	(DEVICE_TYPE_INTERNAL_CONNECTOR | \
-	 DEVICE_TYPE_MIPI_OUTPUT | \
-	 DEVICE_TYPE_COMPOSITE_OUTPUT | \
-	 DEVICE_TYPE_LVDS_SINGALING | \
-	 DEVICE_TYPE_TMDS_DVI_SIGNALING | \
-	 DEVICE_TYPE_VIDEO_SIGNALING | \
-	 DEVICE_TYPE_DISPLAYPORT_OUTPUT | \
-	 DEVICE_TYPE_DIGITAL_OUTPUT | \
-	 DEVICE_TYPE_ANALOG_OUTPUT)
-
 /* define the DVO port for HDMI output type */
 #define		DVO_B		1
 #define		DVO_C		2
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 09/10] drm/i915/bios: throw away unused DVO_* macros
  2017-08-24 18:53 [PATCH 00/10] drm/i915/bios: child device config refactoring Jani Nikula
                   ` (7 preceding siblings ...)
  2017-08-24 18:54 ` [PATCH 08/10] drm/i915/bios: group device type definitions together Jani Nikula
@ 2017-08-24 18:54 ` Jani Nikula
  2017-08-24 18:54 ` [PATCH 10/10] drm/i915/bios: drop the rest of the p_ prefixes from pointers Jani Nikula
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Jani Nikula @ 2017-08-24 18:54 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, Paulo Zanoni

Apparently meant to be additional DEVICE_PORT_* or DVO_PORT_* macros,
but left unused at some point. Remove. No functional changes.

Cc: Animesh Manna <animesh.manna@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_vbt_defs.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_vbt_defs.h b/drivers/gpu/drm/i915/intel_vbt_defs.h
index 15803a020a97..f6cb4825c57c 100644
--- a/drivers/gpu/drm/i915/intel_vbt_defs.h
+++ b/drivers/gpu/drm/i915/intel_vbt_defs.h
@@ -838,11 +838,6 @@ struct bdb_psr {
 #define   SWF14_APM_STANDBY	0x1
 #define   SWF14_APM_RESTORE	0x0
 
-/* define the DVO port for HDMI output type */
-#define		DVO_B		1
-#define		DVO_C		2
-#define		DVO_D		3
-
 /* Block 52 contains MIPI configuration block
  * 6 * bdb_mipi_config, followed by 6 pps data block
  * block below
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 10/10] drm/i915/bios: drop the rest of the p_ prefixes from pointers
  2017-08-24 18:53 [PATCH 00/10] drm/i915/bios: child device config refactoring Jani Nikula
                   ` (8 preceding siblings ...)
  2017-08-24 18:54 ` [PATCH 09/10] drm/i915/bios: throw away unused DVO_* macros Jani Nikula
@ 2017-08-24 18:54 ` Jani Nikula
  2017-08-24 19:18 ` ✓ Fi.CI.BAT: success for drm/i915/bios: child device config refactoring Patchwork
  2017-08-24 20:14 ` ✗ Fi.CI.IGT: warning " Patchwork
  11 siblings, 0 replies; 15+ messages in thread
From: Jani Nikula @ 2017-08-24 18:54 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, Paulo Zanoni

Not really kernel style, and sticks out like a sore thumb. No functional
changes.

Cc: Animesh Manna <animesh.manna@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_bios.c | 84 +++++++++++++++++++--------------------
 1 file changed, 41 insertions(+), 43 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index dd732a5f9361..991e2ab98749 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -453,23 +453,23 @@ parse_general_definitions(struct drm_i915_private *dev_priv,
 }
 
 static const struct child_device_config *
-child_device_ptr(const struct bdb_general_definitions *p_defs, int i)
+child_device_ptr(const struct bdb_general_definitions *defs, int i)
 {
-	return (const void *) &p_defs->devices[i * p_defs->child_dev_size];
+	return (const void *) &defs->devices[i * defs->child_dev_size];
 }
 
 static void
 parse_sdvo_device_mapping(struct drm_i915_private *dev_priv,
 			  const struct bdb_header *bdb)
 {
-	struct sdvo_device_mapping *p_mapping;
-	const struct bdb_general_definitions *p_defs;
+	struct sdvo_device_mapping *mapping;
+	const struct bdb_general_definitions *defs;
 	const struct child_device_config *child;
 	int i, child_device_num, count;
 	u16	block_size;
 
-	p_defs = find_section(bdb, BDB_GENERAL_DEFINITIONS);
-	if (!p_defs) {
+	defs = find_section(bdb, BDB_GENERAL_DEFINITIONS);
+	if (!defs) {
 		DRM_DEBUG_KMS("No general definition block is found, unable to construct sdvo mapping.\n");
 		return;
 	}
@@ -479,18 +479,17 @@ parse_sdvo_device_mapping(struct drm_i915_private *dev_priv,
 	 * device size matches that of the *legacy* child device config
 	 * struct. Thus, SDVO mapping will be skipped for newer VBT.
 	 */
-	if (p_defs->child_dev_size != LEGACY_CHILD_DEVICE_CONFIG_SIZE) {
+	if (defs->child_dev_size != LEGACY_CHILD_DEVICE_CONFIG_SIZE) {
 		DRM_DEBUG_KMS("Unsupported child device size for SDVO mapping.\n");
 		return;
 	}
 	/* get the block size of general definitions */
-	block_size = get_blocksize(p_defs);
+	block_size = get_blocksize(defs);
 	/* get the number of child device */
-	child_device_num = (block_size - sizeof(*p_defs)) /
-		p_defs->child_dev_size;
+	child_device_num = (block_size - sizeof(*defs)) / defs->child_dev_size;
 	count = 0;
 	for (i = 0; i < child_device_num; i++) {
-		child = child_device_ptr(p_defs, i);
+		child = child_device_ptr(defs, i);
 		if (!child->device_type) {
 			/* skip the device block if device type is invalid */
 			continue;
@@ -514,20 +513,20 @@ parse_sdvo_device_mapping(struct drm_i915_private *dev_priv,
 			      child->slave_addr,
 			      (child->dvo_port == DEVICE_PORT_DVOB) ?
 			      "SDVOB" : "SDVOC");
-		p_mapping = &dev_priv->vbt.sdvo_mappings[child->dvo_port - 1];
-		if (!p_mapping->initialized) {
-			p_mapping->dvo_port = child->dvo_port;
-			p_mapping->slave_addr = child->slave_addr;
-			p_mapping->dvo_wiring = child->dvo_wiring;
-			p_mapping->ddc_pin = child->ddc_pin;
-			p_mapping->i2c_pin = child->i2c_pin;
-			p_mapping->initialized = 1;
+		mapping = &dev_priv->vbt.sdvo_mappings[child->dvo_port - 1];
+		if (!mapping->initialized) {
+			mapping->dvo_port = child->dvo_port;
+			mapping->slave_addr = child->slave_addr;
+			mapping->dvo_wiring = child->dvo_wiring;
+			mapping->ddc_pin = child->ddc_pin;
+			mapping->i2c_pin = child->i2c_pin;
+			mapping->initialized = 1;
 			DRM_DEBUG_KMS("SDVO device: dvo=%x, addr=%x, wiring=%d, ddc_pin=%d, i2c_pin=%d\n",
-				      p_mapping->dvo_port,
-				      p_mapping->slave_addr,
-				      p_mapping->dvo_wiring,
-				      p_mapping->ddc_pin,
-				      p_mapping->i2c_pin);
+				      mapping->dvo_port,
+				      mapping->slave_addr,
+				      mapping->dvo_wiring,
+				      mapping->ddc_pin,
+				      mapping->i2c_pin);
 		} else {
 			DRM_DEBUG_KMS("Maybe one SDVO port is shared by "
 					 "two SDVO device.\n");
@@ -1250,15 +1249,15 @@ static void
 parse_device_mapping(struct drm_i915_private *dev_priv,
 		     const struct bdb_header *bdb)
 {
-	const struct bdb_general_definitions *p_defs;
-	const struct child_device_config *p_child;
+	const struct bdb_general_definitions *defs;
+	const struct child_device_config *child;
 	struct child_device_config *child_dev_ptr;
 	int i, child_device_num, count;
 	u8 expected_size;
 	u16 block_size;
 
-	p_defs = find_section(bdb, BDB_GENERAL_DEFINITIONS);
-	if (!p_defs) {
+	defs = find_section(bdb, BDB_GENERAL_DEFINITIONS);
+	if (!defs) {
 		DRM_DEBUG_KMS("No general definition block is found, no devices defined.\n");
 		return;
 	}
@@ -1274,33 +1273,32 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
 		expected_size = 38;
 	} else {
 		expected_size = 38;
-		BUILD_BUG_ON(sizeof(*p_child) < 38);
+		BUILD_BUG_ON(sizeof(*child) < 38);
 		DRM_DEBUG_DRIVER("Expected child device config size for VBT version %u not known; assuming %u\n",
 				 bdb->version, expected_size);
 	}
 
 	/* Flag an error for unexpected size, but continue anyway. */
-	if (p_defs->child_dev_size != expected_size)
+	if (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);
+			  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 < LEGACY_CHILD_DEVICE_CONFIG_SIZE) {
+	if (defs->child_dev_size < LEGACY_CHILD_DEVICE_CONFIG_SIZE) {
 		DRM_DEBUG_KMS("Child device config size %u is too small.\n",
-			      p_defs->child_dev_size);
+			      defs->child_dev_size);
 		return;
 	}
 
 	/* get the block size of general definitions */
-	block_size = get_blocksize(p_defs);
+	block_size = get_blocksize(defs);
 	/* get the number of child device */
-	child_device_num = (block_size - sizeof(*p_defs)) /
-				p_defs->child_dev_size;
+	child_device_num = (block_size - sizeof(*defs)) / defs->child_dev_size;
 	count = 0;
 	/* get the number of child device that is present */
 	for (i = 0; i < child_device_num; i++) {
-		p_child = child_device_ptr(p_defs, i);
-		if (!p_child->device_type) {
+		child = child_device_ptr(defs, i);
+		if (!child->device_type) {
 			/* skip the device block if device type is invalid */
 			continue;
 		}
@@ -1310,7 +1308,7 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
 		DRM_DEBUG_KMS("no child dev is parsed from VBT\n");
 		return;
 	}
-	dev_priv->vbt.child_dev = kcalloc(count, sizeof(*p_child), GFP_KERNEL);
+	dev_priv->vbt.child_dev = kcalloc(count, sizeof(*child), GFP_KERNEL);
 	if (!dev_priv->vbt.child_dev) {
 		DRM_DEBUG_KMS("No memory space for child device\n");
 		return;
@@ -1319,8 +1317,8 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
 	dev_priv->vbt.child_dev_num = count;
 	count = 0;
 	for (i = 0; i < child_device_num; i++) {
-		p_child = child_device_ptr(p_defs, i);
-		if (!p_child->device_type) {
+		child = child_device_ptr(defs, i);
+		if (!child->device_type) {
 			/* skip the device block if device type is invalid */
 			continue;
 		}
@@ -1333,8 +1331,8 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
 		 * (child_dev_size) of the child device. Accessing the data must
 		 * depend on VBT version.
 		 */
-		memcpy(child_dev_ptr, p_child,
-		       min_t(size_t, p_defs->child_dev_size, sizeof(*p_child)));
+		memcpy(child_dev_ptr, child,
+		       min_t(size_t, defs->child_dev_size, sizeof(*child)));
 
 		/*
 		 * copied full block, now init values when they are not
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915/bios: child device config refactoring
  2017-08-24 18:53 [PATCH 00/10] drm/i915/bios: child device config refactoring Jani Nikula
                   ` (9 preceding siblings ...)
  2017-08-24 18:54 ` [PATCH 10/10] drm/i915/bios: drop the rest of the p_ prefixes from pointers Jani Nikula
@ 2017-08-24 19:18 ` Patchwork
  2017-08-24 20:14 ` ✗ Fi.CI.IGT: warning " Patchwork
  11 siblings, 0 replies; 15+ messages in thread
From: Patchwork @ 2017-08-24 19:18 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/bios: child device config refactoring
URL   : https://patchwork.freedesktop.org/series/29307/
State : success

== Summary ==

Series 29307v1 drm/i915/bios: child device config refactoring
https://patchwork.freedesktop.org/api/1.0/series/29307/revisions/1/mbox/

Test kms_flip:
        Subgroup basic-flip-vs-dpms:
                dmesg-warn -> INCOMPLETE (fi-kbl-7560u) fdo#102392
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                pass       -> DMESG-WARN (fi-byt-n2820) fdo#101705

fdo#102392 https://bugs.freedesktop.org/show_bug.cgi?id=102392
fdo#101705 https://bugs.freedesktop.org/show_bug.cgi?id=101705

fi-bdw-5557u     total:279  pass:268  dwarn:0   dfail:0   fail:0   skip:11  time:455s
fi-bdw-gvtdvm    total:279  pass:265  dwarn:0   dfail:0   fail:0   skip:14  time:435s
fi-blb-e6850     total:279  pass:224  dwarn:1   dfail:0   fail:0   skip:54  time:362s
fi-bsw-n3050     total:279  pass:243  dwarn:0   dfail:0   fail:0   skip:36  time:557s
fi-bwr-2160      total:279  pass:184  dwarn:0   dfail:0   fail:0   skip:95  time:252s
fi-bxt-j4205     total:279  pass:260  dwarn:0   dfail:0   fail:0   skip:19  time:523s
fi-byt-j1900     total:279  pass:254  dwarn:1   dfail:0   fail:0   skip:24  time:527s
fi-byt-n2820     total:279  pass:250  dwarn:1   dfail:0   fail:0   skip:28  time:526s
fi-elk-e7500     total:279  pass:230  dwarn:0   dfail:0   fail:0   skip:49  time:436s
fi-glk-2a        total:279  pass:260  dwarn:0   dfail:0   fail:0   skip:19  time:618s
fi-hsw-4770      total:279  pass:263  dwarn:0   dfail:0   fail:0   skip:16  time:445s
fi-hsw-4770r     total:279  pass:263  dwarn:0   dfail:0   fail:0   skip:16  time:422s
fi-ilk-650       total:279  pass:229  dwarn:0   dfail:0   fail:0   skip:50  time:424s
fi-ivb-3520m     total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:508s
fi-ivb-3770      total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:475s
fi-kbl-7500u     total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:483s
fi-kbl-7560u     total:208  pass:204  dwarn:0   dfail:0   fail:0   skip:3  
fi-kbl-r         total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:598s
fi-pnv-d510      total:279  pass:223  dwarn:1   dfail:0   fail:0   skip:55  time:531s
fi-skl-6260u     total:279  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:473s
fi-skl-6700k     total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:483s
fi-skl-6770hq    total:279  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:489s
fi-skl-gvtdvm    total:279  pass:266  dwarn:0   dfail:0   fail:0   skip:13  time:436s
fi-snb-2520m     total:279  pass:251  dwarn:0   dfail:0   fail:0   skip:28  time:554s
fi-snb-2600      total:279  pass:250  dwarn:0   dfail:0   fail:0   skip:29  time:407s

650ffdaee44b186cd59cbaf893d4177bc0a78aa1 drm-tip: 2017y-08m-24d-14h-29m-45s UTC integration manifest
6d7c857c9570 drm/i915/bios: drop the rest of the p_ prefixes from pointers
af303732e2bf drm/i915/bios: throw away unused DVO_* macros
2c290e323c3d drm/i915/bios: group device type definitions together
b099e05e3862 drm/i915/bios: document child device config dvo_port values a bit better
d4f8172ef39f drm/i915/bios: throw away struct old_child_dev_config
e2265c9aba45 drm/i915/bios: throw away high level child device union
82d56a133e9d drm/i915/bios: add legacy contents to common child device config
d5a4dba79418 drm/i915/bios: remove the raw version of child device config
5dcab919ba5e drm/i915/bios: document BDB versions of child device config fields
61584d709b75 drm/i915/bios: amend child device config parameters

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5486/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 15+ messages in thread

* ✗ Fi.CI.IGT: warning for drm/i915/bios: child device config refactoring
  2017-08-24 18:53 [PATCH 00/10] drm/i915/bios: child device config refactoring Jani Nikula
                   ` (10 preceding siblings ...)
  2017-08-24 19:18 ` ✓ Fi.CI.BAT: success for drm/i915/bios: child device config refactoring Patchwork
@ 2017-08-24 20:14 ` Patchwork
  11 siblings, 0 replies; 15+ messages in thread
From: Patchwork @ 2017-08-24 20:14 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/bios: child device config refactoring
URL   : https://patchwork.freedesktop.org/series/29307/
State : warning

== Summary ==

Test kms_cursor_legacy:
        Subgroup nonblocking-modeset-vs-cursor-atomic:
                pass       -> SKIP       (shard-hsw)
Test kms_setmode:
        Subgroup basic:
                fail       -> PASS       (shard-hsw) fdo#99912
Test perf:
        Subgroup polling:
                pass       -> FAIL       (shard-hsw) fdo#102252 +1

fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252

shard-hsw        total:2230 pass:1229 dwarn:0   dfail:0   fail:18  skip:983 time:9555s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5486/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 01/10] drm/i915/bios: amend child device config parameters
  2017-08-24 18:53 ` [PATCH 01/10] drm/i915/bios: amend child device config parameters Jani Nikula
@ 2017-08-25 12:38   ` Ville Syrjälä
  2017-08-25 13:56     ` Jani Nikula
  0 siblings, 1 reply; 15+ messages in thread
From: Ville Syrjälä @ 2017-08-25 12:38 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx, Paulo Zanoni

On Thu, Aug 24, 2017 at 09:53:59PM +0300, Jani Nikula wrote:
> Add both some new and some old fields to child device config
> parameters. Prepare for switching to just one child device config. Use
> naming from struct old_child_dev_config for common fields.
> 
> No functional changes.
> 
> Cc: Animesh Manna <animesh.manna@intel.com>
> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_vbt_defs.h | 31 +++++++++++++++++++++++++++----
>  1 file changed, 27 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_vbt_defs.h b/drivers/gpu/drm/i915/intel_vbt_defs.h
> index a92e7762f596..9ad05b2c44e0 100644
> --- a/drivers/gpu/drm/i915/intel_vbt_defs.h
> +++ b/drivers/gpu/drm/i915/intel_vbt_defs.h
> @@ -260,13 +260,28 @@ struct old_child_dev_config {
>  /* This one contains field offsets that are known to be common for all BDB
>   * versions. Notice that the meaning of the contents contents may still change,
>   * but at least the offsets are consistent. */
> -
>  struct common_child_dev_config {
>  	u16 handle;
>  	u16 device_type;
> -	u8 not_common1[12];
> +	u8 i2c_speed;
> +	u8 dp_onboard_redriver;					/* 158 */
> +	u8 dp_ondock_redriver;					/* 158 */
> +	u8 hdmi_level_shifter_value:4;				/* 169 */
> +	u8 hdmi_max_data_rate:4;				/* 204 */
> +	u16 dtd_buf_ptr;					/* 161 */
> +	u8 edidless_efp:1;					/* 161 */
> +	u8 compression_enable:1;				/* 198 */
> +	u8 compression_method:1;				/* 198 */
> +	u8 ganged_edp:1;					/* 202 */
> +	u8 reserved0:4;
> +	u8 compression_structure_index:4;			/* 198 */
> +	u8 reserved1:4;
> +	u8 slave_port;						/* 202 */
> +	u8 reserved2;
> +	u16 addin_offset;
>  	u8 dvo_port;
> -	u8 not_common2[2];
> +	u8 i2c_pin;
> +	u8 slave_addr;
>  	u8 ddc_pin;
>  	u16 edid_ptr;
>  	u8 dvo_cfg; /* See DEVICE_CFG_* above */
> @@ -281,7 +296,15 @@ struct common_child_dev_config {
>  	u8 tmds_support:1;
>  	u8 support_reserved:5;
>  	u8 aux_channel;
> -	u8 not_common3[11];
> +	u8 dongle_detect;
> +	u8 capabilities;
> +	u8 dvo_wiring; /* See DEVICE_WIRE_* above */
> +	u8 mipi_bridge_type;					/* 171 */
> +	u16 extended_type;
> +	u8 dvo_function;
> +	u8 flags2;						/* 195 */
> +	u8 dp_gpio_index;					/* 195 */
> +	u16 dp_gpio_pin_num;					/* 195 */
>  	u8 iboost_level;

The iboost stuff could also use the version comments, and it could be
made to use a bitfield since that seems to be what we do for VBT stuff.

Series lgtm, or at least I wasn't able to spot any mistakes. So for the
series
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

>  } __packed;
>  
> -- 
> 2.11.0

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 01/10] drm/i915/bios: amend child device config parameters
  2017-08-25 12:38   ` Ville Syrjälä
@ 2017-08-25 13:56     ` Jani Nikula
  0 siblings, 0 replies; 15+ messages in thread
From: Jani Nikula @ 2017-08-25 13:56 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx, Paulo Zanoni

On Fri, 25 Aug 2017, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Thu, Aug 24, 2017 at 09:53:59PM +0300, Jani Nikula wrote:
>> Add both some new and some old fields to child device config
>> parameters. Prepare for switching to just one child device config. Use
>> naming from struct old_child_dev_config for common fields.
>> 
>> No functional changes.
>> 
>> Cc: Animesh Manna <animesh.manna@intel.com>
>> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
>> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>>  drivers/gpu/drm/i915/intel_vbt_defs.h | 31 +++++++++++++++++++++++++++----
>>  1 file changed, 27 insertions(+), 4 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/intel_vbt_defs.h b/drivers/gpu/drm/i915/intel_vbt_defs.h
>> index a92e7762f596..9ad05b2c44e0 100644
>> --- a/drivers/gpu/drm/i915/intel_vbt_defs.h
>> +++ b/drivers/gpu/drm/i915/intel_vbt_defs.h
>> @@ -260,13 +260,28 @@ struct old_child_dev_config {
>>  /* This one contains field offsets that are known to be common for all BDB
>>   * versions. Notice that the meaning of the contents contents may still change,
>>   * but at least the offsets are consistent. */
>> -
>>  struct common_child_dev_config {
>>  	u16 handle;
>>  	u16 device_type;
>> -	u8 not_common1[12];
>> +	u8 i2c_speed;
>> +	u8 dp_onboard_redriver;					/* 158 */
>> +	u8 dp_ondock_redriver;					/* 158 */
>> +	u8 hdmi_level_shifter_value:4;				/* 169 */
>> +	u8 hdmi_max_data_rate:4;				/* 204 */
>> +	u16 dtd_buf_ptr;					/* 161 */
>> +	u8 edidless_efp:1;					/* 161 */
>> +	u8 compression_enable:1;				/* 198 */
>> +	u8 compression_method:1;				/* 198 */
>> +	u8 ganged_edp:1;					/* 202 */
>> +	u8 reserved0:4;
>> +	u8 compression_structure_index:4;			/* 198 */
>> +	u8 reserved1:4;
>> +	u8 slave_port;						/* 202 */
>> +	u8 reserved2;
>> +	u16 addin_offset;
>>  	u8 dvo_port;
>> -	u8 not_common2[2];
>> +	u8 i2c_pin;
>> +	u8 slave_addr;
>>  	u8 ddc_pin;
>>  	u16 edid_ptr;
>>  	u8 dvo_cfg; /* See DEVICE_CFG_* above */
>> @@ -281,7 +296,15 @@ struct common_child_dev_config {
>>  	u8 tmds_support:1;
>>  	u8 support_reserved:5;
>>  	u8 aux_channel;
>> -	u8 not_common3[11];
>> +	u8 dongle_detect;
>> +	u8 capabilities;
>> +	u8 dvo_wiring; /* See DEVICE_WIRE_* above */
>> +	u8 mipi_bridge_type;					/* 171 */
>> +	u16 extended_type;
>> +	u8 dvo_function;
>> +	u8 flags2;						/* 195 */
>> +	u8 dp_gpio_index;					/* 195 */
>> +	u16 dp_gpio_pin_num;					/* 195 */
>>  	u8 iboost_level;
>
> The iboost stuff could also use the version comments, and it could be
> made to use a bitfield since that seems to be what we do for VBT stuff.

Patches follow.

> Series lgtm, or at least I wasn't able to spot any mistakes. So for the
> series
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Thank you very much, pushed the lot.

BR,
Jani.

>
>>  } __packed;
>>  
>> -- 
>> 2.11.0

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-08-25 13:57 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-24 18:53 [PATCH 00/10] drm/i915/bios: child device config refactoring Jani Nikula
2017-08-24 18:53 ` [PATCH 01/10] drm/i915/bios: amend child device config parameters Jani Nikula
2017-08-25 12:38   ` Ville Syrjälä
2017-08-25 13:56     ` Jani Nikula
2017-08-24 18:54 ` [PATCH 02/10] drm/i915/bios: document BDB versions of child device config fields Jani Nikula
2017-08-24 18:54 ` [PATCH 03/10] drm/i915/bios: remove the raw version of child device config Jani Nikula
2017-08-24 18:54 ` [PATCH 04/10] drm/i915/bios: add legacy contents to common " Jani Nikula
2017-08-24 18:54 ` [PATCH 05/10] drm/i915/bios: throw away high level child device union Jani Nikula
2017-08-24 18:54 ` [PATCH 06/10] drm/i915/bios: throw away struct old_child_dev_config Jani Nikula
2017-08-24 18:54 ` [PATCH 07/10] drm/i915/bios: document child device config dvo_port values a bit better Jani Nikula
2017-08-24 18:54 ` [PATCH 08/10] drm/i915/bios: group device type definitions together Jani Nikula
2017-08-24 18:54 ` [PATCH 09/10] drm/i915/bios: throw away unused DVO_* macros Jani Nikula
2017-08-24 18:54 ` [PATCH 10/10] drm/i915/bios: drop the rest of the p_ prefixes from pointers Jani Nikula
2017-08-24 19:18 ` ✓ Fi.CI.BAT: success for drm/i915/bios: child device config refactoring Patchwork
2017-08-24 20:14 ` ✗ Fi.CI.IGT: warning " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox