All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH 00/11] drm/i915/bios: Rework BDB block handling
@ 2022-03-17 17:19 Ville Syrjala
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 01/11] drm/i915/bios: Extract struct lvds_lfp_data_ptr_table Ville Syrjala
                   ` (21 more replies)
  0 siblings, 22 replies; 33+ messages in thread
From: Ville Syrjala @ 2022-03-17 17:19 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Several changes to our BDB block handling:

1)
The current way of trusting the version checks to avoid out of
bounds accesses to the BDB blocks is fragile. We might just get
the version check wrong, or the VBT may be corrupted/malicious.
So instead of doing blind accesses into the original data let's
make a copy of each block with a gauranteed minimum size.

2)
The LFP data table pointer stuff is a horrible mess currently.
Let's make that sensible by verifying the pointers ahead of
time, which allows us to trust them 100% when we acually
parse the actual data block.

3)
There's more stuff at the tail end of the LFP data block we
need to parse. The variable size of the fp_timing table makes
that a bit awkward, but with the pointer validation in place
it's not too horrible.

4)
Some modern machines (seen it on TGL here) no longer include
the LFP data table pointers block (41) in the VBT. In order to
keep the rest of the code working as is we must therefore
generate the pointers block from scratch.

Ville Syrjälä (11):
  drm/i915/bios: Extract struct lvds_lfp_data_ptr_table
  drm/i915/bios: Make copies of VBT data blocks
  drm/i915/bios: Use the copy of the LFP data table always
  drm/i915/bios: Validate LFP data table pointers
  drm/i915/bios: Trust the LFP data pointers
  drm/i915/bios: Validate the panel_name table
  drm/i915/bios: Reorder panel DTD parsing
  drm/i915/bios: Generate LFP data table pointers if the VBT lacks them
  drm/i915/bios: Get access to the tail end of the LFP data block
  drm/i915/bios: Parse the seamless DRRS min refresh rate
  drm/i915: Respect VBT seamless DRRS min refresh rate

 drivers/gpu/drm/i915/display/intel_bios.c     | 540 +++++++++++++++---
 drivers/gpu/drm/i915/display/intel_panel.c    |  10 +-
 drivers/gpu/drm/i915/display/intel_vbt_defs.h |  35 +-
 drivers/gpu/drm/i915/i915_drv.h               |   2 +
 4 files changed, 489 insertions(+), 98 deletions(-)

-- 
2.34.1


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

* [Intel-gfx] [PATCH 01/11] drm/i915/bios: Extract struct lvds_lfp_data_ptr_table
  2022-03-17 17:19 [Intel-gfx] [PATCH 00/11] drm/i915/bios: Rework BDB block handling Ville Syrjala
@ 2022-03-17 17:19 ` Ville Syrjala
  2022-03-17 18:33   ` Jani Nikula
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 02/11] drm/i915/bios: Make copies of VBT data blocks Ville Syrjala
                   ` (20 subsequent siblings)
  21 siblings, 1 reply; 33+ messages in thread
From: Ville Syrjala @ 2022-03-17 17:19 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

All the LFP data table pointers have uniform layout. Turn
that into a struct.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_bios.c     | 10 +++++-----
 drivers/gpu/drm/i915/display/intel_vbt_defs.h | 13 +++++++------
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index c7afe19dd44a..31fce7c92a28 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -180,11 +180,11 @@ get_lvds_dvo_timing(const struct bdb_lvds_lfp_data *lvds_lfp_data,
 	 */
 
 	int lfp_data_size =
-		lvds_lfp_data_ptrs->ptr[1].dvo_timing_offset -
-		lvds_lfp_data_ptrs->ptr[0].dvo_timing_offset;
+		lvds_lfp_data_ptrs->ptr[1].dvo_timing.offset -
+		lvds_lfp_data_ptrs->ptr[0].dvo_timing.offset;
 	int dvo_timing_offset =
-		lvds_lfp_data_ptrs->ptr[0].dvo_timing_offset -
-		lvds_lfp_data_ptrs->ptr[0].fp_timing_offset;
+		lvds_lfp_data_ptrs->ptr[0].dvo_timing.offset -
+		lvds_lfp_data_ptrs->ptr[0].fp_timing.offset;
 	char *entry = (char *)lvds_lfp_data->data + lfp_data_size * index;
 
 	return (struct lvds_dvo_timing *)(entry + dvo_timing_offset);
@@ -205,7 +205,7 @@ get_lvds_fp_timing(const struct bdb_header *bdb,
 
 	if (index >= ARRAY_SIZE(ptrs->ptr))
 		return NULL;
-	ofs = ptrs->ptr[index].fp_timing_offset;
+	ofs = ptrs->ptr[index].fp_timing.offset;
 	if (ofs < data_ofs ||
 	    ofs + sizeof(struct lvds_fp_timing) > data_ofs + data_size)
 		return NULL;
diff --git a/drivers/gpu/drm/i915/display/intel_vbt_defs.h b/drivers/gpu/drm/i915/display/intel_vbt_defs.h
index e0508990df48..d727fcd6cdab 100644
--- a/drivers/gpu/drm/i915/display/intel_vbt_defs.h
+++ b/drivers/gpu/drm/i915/display/intel_vbt_defs.h
@@ -722,15 +722,16 @@ struct bdb_lvds_options {
 /*
  * Block 41 - LFP Data Table Pointers
  */
+struct lvds_lfp_data_ptr_table {
+	u16 offset; /* offsets are from start of bdb */
+	u8 table_size;
+} __packed;
 
 /* LFP pointer table contains entries to the struct below */
 struct lvds_lfp_data_ptr {
-	u16 fp_timing_offset; /* offsets are from start of bdb */
-	u8 fp_table_size;
-	u16 dvo_timing_offset;
-	u8 dvo_table_size;
-	u16 panel_pnp_id_offset;
-	u8 pnp_table_size;
+	struct lvds_lfp_data_ptr_table fp_timing;
+	struct lvds_lfp_data_ptr_table dvo_timing;
+	struct lvds_lfp_data_ptr_table panel_pnp_id;
 } __packed;
 
 struct bdb_lvds_lfp_data_ptrs {
-- 
2.34.1


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

* [Intel-gfx] [PATCH 02/11] drm/i915/bios: Make copies of VBT data blocks
  2022-03-17 17:19 [Intel-gfx] [PATCH 00/11] drm/i915/bios: Rework BDB block handling Ville Syrjala
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 01/11] drm/i915/bios: Extract struct lvds_lfp_data_ptr_table Ville Syrjala
@ 2022-03-17 17:19 ` Ville Syrjala
  2022-03-17 19:02   ` Jani Nikula
  2022-03-17 20:21   ` [Intel-gfx] [PATCH v2 " Ville Syrjala
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 03/11] drm/i915/bios: Use the copy of the LFP data table always Ville Syrjala
                   ` (19 subsequent siblings)
  21 siblings, 2 replies; 33+ messages in thread
From: Ville Syrjala @ 2022-03-17 17:19 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Make a copy of each VB data block with a guaranteed minimum
size. The extra (if any) will just be left zeroed.

This means we don't have to worry about going out of bounds
when accessing any of the structure members. Otherwise that
could easliy happen if we simply get the version check wrong,
or if the VBT is broken/malicious.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_bios.c | 122 ++++++++++++++++++----
 drivers/gpu/drm/i915/i915_drv.h           |   1 +
 2 files changed, 104 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index 31fce7c92a28..ff04514eb3b7 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -87,8 +87,28 @@ static u32 get_blocksize(const void *block_data)
 	return _get_blocksize(block_data - 3);
 }
 
+struct bdb_block_entry {
+	struct list_head node;
+	size_t min_size;
+	enum bdb_block_id section_id;
+	u8 data[];
+};
+
+static struct bdb_block_entry *
+find_bdb_block(struct drm_i915_private *i915, enum bdb_block_id section_id)
+{
+	struct bdb_block_entry *entry;
+
+	list_for_each_entry(entry, &i915->vbt.bdb_blocks, node) {
+		if (entry->section_id == section_id)
+			return entry;
+	}
+
+	return NULL;
+}
+
 static const void *
-find_section(const void *_bdb, enum bdb_block_id section_id)
+find_raw_section(const void *_bdb, enum bdb_block_id section_id)
 {
 	const struct bdb_header *bdb = _bdb;
 	const u8 *base = _bdb;
@@ -118,6 +138,47 @@ find_section(const void *_bdb, enum bdb_block_id section_id)
 	return NULL;
 }
 
+static const void *
+find_section(struct drm_i915_private *i915,
+	     const void *bdb, enum bdb_block_id section_id,
+	     size_t min_size)
+{
+	struct bdb_block_entry *entry;
+	const void *block;
+	size_t block_size;
+
+	entry = find_bdb_block(i915, section_id);
+	if (entry) {
+		/* make sure all callers pass in a consistent min_size */
+		if (drm_WARN_ON(&i915->drm, entry->min_size != min_size))
+			return NULL;
+
+		return entry->data + 3;
+	}
+
+	block = find_raw_section(bdb, section_id);
+	if (!block)
+		return NULL;
+
+	block_size = get_blocksize(block);
+
+	entry = kzalloc(struct_size(entry, data, max(min_size, block_size) + 3),
+			GFP_KERNEL);
+	if (!entry)
+		return NULL;
+
+	entry->section_id = section_id;
+	entry->min_size = min_size;
+	memcpy(entry->data, block - 3, block_size + 3);
+
+	drm_dbg_kms(&i915->drm, "Found BDB block %d (size %zu, min size %zu)\n",
+		    section_id, block_size, min_size);
+
+	list_add(&entry->node, &i915->vbt.bdb_blocks);
+
+	return entry->data + 3;
+}
+
 static void
 fill_detail_timing_data(struct drm_display_mode *panel_fixed_mode,
 			const struct lvds_dvo_timing *dvo_timing)
@@ -222,7 +283,8 @@ parse_panel_options(struct drm_i915_private *i915,
 	int drrs_mode;
 	int ret;
 
-	lvds_options = find_section(bdb, BDB_LVDS_OPTIONS);
+	lvds_options = find_section(i915, bdb, BDB_LVDS_OPTIONS,
+				    sizeof(*lvds_options));
 	if (!lvds_options)
 		return;
 
@@ -285,11 +347,13 @@ parse_lfp_panel_dtd(struct drm_i915_private *i915,
 	struct drm_display_mode *panel_fixed_mode;
 	int panel_type = i915->vbt.panel_type;
 
-	lvds_lfp_data = find_section(bdb, BDB_LVDS_LFP_DATA);
+	lvds_lfp_data = find_section(i915, bdb, BDB_LVDS_LFP_DATA,
+				     sizeof(*lvds_lfp_data));
 	if (!lvds_lfp_data)
 		return;
 
-	lvds_lfp_data_ptrs = find_section(bdb, BDB_LVDS_LFP_DATA_PTRS);
+	lvds_lfp_data_ptrs = find_section(i915, bdb, BDB_LVDS_LFP_DATA_PTRS,
+					  sizeof(*lvds_lfp_data_ptrs));
 	if (!lvds_lfp_data_ptrs)
 		return;
 
@@ -333,7 +397,8 @@ parse_generic_dtd(struct drm_i915_private *i915,
 	struct drm_display_mode *panel_fixed_mode;
 	int num_dtd;
 
-	generic_dtd = find_section(bdb, BDB_GENERIC_DTD);
+	generic_dtd = find_section(i915, bdb, BDB_GENERIC_DTD,
+				   sizeof(*generic_dtd));
 	if (!generic_dtd)
 		return;
 
@@ -430,7 +495,8 @@ parse_lfp_backlight(struct drm_i915_private *i915,
 	int panel_type = i915->vbt.panel_type;
 	u16 level;
 
-	backlight_data = find_section(bdb, BDB_LVDS_BACKLIGHT);
+	backlight_data = find_section(i915, bdb, BDB_LVDS_BACKLIGHT,
+				      sizeof(*backlight_data));
 	if (!backlight_data)
 		return;
 
@@ -531,14 +597,16 @@ parse_sdvo_panel_data(struct drm_i915_private *i915,
 	if (index == -1) {
 		const struct bdb_sdvo_lvds_options *sdvo_lvds_options;
 
-		sdvo_lvds_options = find_section(bdb, BDB_SDVO_LVDS_OPTIONS);
+		sdvo_lvds_options = find_section(i915, bdb, BDB_SDVO_LVDS_OPTIONS,
+						 sizeof(*sdvo_lvds_options));
 		if (!sdvo_lvds_options)
 			return;
 
 		index = sdvo_lvds_options->panel_type;
 	}
 
-	dtds = find_section(bdb, BDB_SDVO_PANEL_DTDS);
+	dtds = find_section(i915, bdb, BDB_SDVO_PANEL_DTDS,
+			    sizeof(*dtds));
 	if (!dtds)
 		return;
 
@@ -575,7 +643,8 @@ parse_general_features(struct drm_i915_private *i915,
 {
 	const struct bdb_general_features *general;
 
-	general = find_section(bdb, BDB_GENERAL_FEATURES);
+	general = find_section(i915, bdb, BDB_GENERAL_FEATURES,
+			       sizeof(*general));
 	if (!general)
 		return;
 
@@ -700,7 +769,8 @@ parse_driver_features(struct drm_i915_private *i915,
 {
 	const struct bdb_driver_features *driver;
 
-	driver = find_section(bdb, BDB_DRIVER_FEATURES);
+	driver = find_section(i915, bdb, BDB_DRIVER_FEATURES,
+			      sizeof(*driver));
 	if (!driver)
 		return;
 
@@ -756,7 +826,8 @@ parse_power_conservation_features(struct drm_i915_private *i915,
 	if (bdb->version < 228)
 		return;
 
-	power = find_section(bdb, BDB_LFP_POWER);
+	power = find_section(i915, bdb, BDB_LFP_POWER,
+			     sizeof(*power));
 	if (!power)
 		return;
 
@@ -783,7 +854,8 @@ parse_edp(struct drm_i915_private *i915, const struct bdb_header *bdb)
 	const struct edp_fast_link_params *edp_link_params;
 	int panel_type = i915->vbt.panel_type;
 
-	edp = find_section(bdb, BDB_EDP);
+	edp = find_section(i915, bdb, BDB_EDP,
+			   sizeof(*edp));
 	if (!edp)
 		return;
 
@@ -900,7 +972,8 @@ parse_psr(struct drm_i915_private *i915, const struct bdb_header *bdb)
 	const struct psr_table *psr_table;
 	int panel_type = i915->vbt.panel_type;
 
-	psr = find_section(bdb, BDB_PSR);
+	psr = find_section(i915, bdb, BDB_PSR,
+			   sizeof(*psr));
 	if (!psr) {
 		drm_dbg_kms(&i915->drm, "No PSR BDB found.\n");
 		return;
@@ -1058,7 +1131,8 @@ parse_mipi_config(struct drm_i915_private *i915,
 	/* Parse #52 for panel index used from panel_type already
 	 * parsed
 	 */
-	start = find_section(bdb, BDB_MIPI_CONFIG);
+	start = find_section(i915, bdb, BDB_MIPI_CONFIG,
+			     sizeof(*start));
 	if (!start) {
 		drm_dbg_kms(&i915->drm, "No MIPI config BDB found");
 		return;
@@ -1368,7 +1442,8 @@ parse_mipi_sequence(struct drm_i915_private *i915,
 	if (i915->vbt.dsi.panel_id != MIPI_DSI_GENERIC_PANEL_ID)
 		return;
 
-	sequence = find_section(bdb, BDB_MIPI_SEQUENCE);
+	sequence = find_section(i915, bdb, BDB_MIPI_SEQUENCE,
+				sizeof(*sequence));
 	if (!sequence) {
 		drm_dbg_kms(&i915->drm,
 			    "No MIPI Sequence found, parsing complete\n");
@@ -1451,7 +1526,8 @@ parse_compression_parameters(struct drm_i915_private *i915,
 	if (bdb->version < 198)
 		return;
 
-	params = find_section(bdb, BDB_COMPRESSION_PARAMETERS);
+	params = find_section(i915, bdb, BDB_COMPRESSION_PARAMETERS,
+			      sizeof(*params));
 	if (params) {
 		/* Sanity checks */
 		if (params->entry_size != sizeof(params->data[0])) {
@@ -2097,7 +2173,8 @@ parse_general_definitions(struct drm_i915_private *i915,
 	u16 block_size;
 	int bus_pin;
 
-	defs = find_section(bdb, BDB_GENERAL_DEFINITIONS);
+	defs = find_section(i915, bdb, BDB_GENERAL_DEFINITIONS,
+			    sizeof(*defs));
 	if (!defs) {
 		drm_dbg_kms(&i915->drm,
 			    "No general definition block is found, no devices defined.\n");
@@ -2466,6 +2543,7 @@ void intel_bios_init(struct drm_i915_private *i915)
 	const struct bdb_header *bdb;
 
 	INIT_LIST_HEAD(&i915->vbt.display_devices);
+	INIT_LIST_HEAD(&i915->vbt.bdb_blocks);
 
 	if (!HAS_DISPLAY(i915)) {
 		drm_dbg_kms(&i915->drm,
@@ -2536,14 +2614,20 @@ void intel_bios_init(struct drm_i915_private *i915)
  */
 void intel_bios_driver_remove(struct drm_i915_private *i915)
 {
-	struct intel_bios_encoder_data *devdata, *n;
+	struct intel_bios_encoder_data *devdata, *nd;
+	struct bdb_block_entry *entry, *ne;
 
-	list_for_each_entry_safe(devdata, n, &i915->vbt.display_devices, node) {
+	list_for_each_entry_safe(devdata, nd, &i915->vbt.display_devices, node) {
 		list_del(&devdata->node);
 		kfree(devdata->dsc);
 		kfree(devdata);
 	}
 
+	list_for_each_entry_safe(entry, ne, &i915->vbt.bdb_blocks, node) {
+		list_del(&entry->node);
+		kfree(entry);
+	}
+
 	kfree(i915->vbt.sdvo_lvds_vbt_mode);
 	i915->vbt.sdvo_lvds_vbt_mode = NULL;
 	kfree(i915->vbt.lfp_lvds_vbt_mode);
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index a9aceb08fcd1..0f52ce62281e 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -382,6 +382,7 @@ struct intel_vbt_data {
 	int crt_ddc_pin;
 
 	struct list_head display_devices;
+	struct list_head bdb_blocks;
 
 	struct intel_bios_encoder_data *ports[I915_MAX_PORTS]; /* Non-NULL if port present. */
 	struct sdvo_device_mapping sdvo_mappings[2];
-- 
2.34.1


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

* [Intel-gfx] [PATCH 03/11] drm/i915/bios: Use the copy of the LFP data table always
  2022-03-17 17:19 [Intel-gfx] [PATCH 00/11] drm/i915/bios: Rework BDB block handling Ville Syrjala
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 01/11] drm/i915/bios: Extract struct lvds_lfp_data_ptr_table Ville Syrjala
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 02/11] drm/i915/bios: Make copies of VBT data blocks Ville Syrjala
@ 2022-03-17 17:19 ` Ville Syrjala
  2022-03-17 19:10   ` Jani Nikula
  2022-03-17 20:21   ` [Intel-gfx] [PATCH v2 " Ville Syrjala
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 04/11] drm/i915/bios: Validate LFP data table pointers Ville Syrjala
                   ` (18 subsequent siblings)
  21 siblings, 2 replies; 33+ messages in thread
From: Ville Syrjala @ 2022-03-17 17:19 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Currently get_lvds_fp_timing() still returns a pointer to the original
data block rather than our copy. Let's convert the data pointer offsets
to be relative to the data block rather than the whole BDB. With that
we can make get_lvds_fp_timing() return a pointer to the copy.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_bios.c | 56 ++++++++++++++++++++---
 1 file changed, 49 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index ff04514eb3b7..777339f5dd79 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -138,6 +138,44 @@ find_raw_section(const void *_bdb, enum bdb_block_id section_id)
 	return NULL;
 }
 
+/*
+ * Offset from the start of BDB to the start of the
+ * block data (just past the block header).
+ */
+static u32 block_offset(const void *bdb, enum bdb_block_id section_id)
+{
+	const void *block;
+
+	block = find_raw_section(bdb, section_id);
+	if (!block)
+		return 0;
+
+	return block - bdb;
+}
+
+/* make the data table offsets relative to the data block */
+static bool fixup_lfp_data_ptrs(const void *bdb, void *ptrs_block)
+{
+	struct bdb_lvds_lfp_data_ptrs *ptrs = ptrs_block;
+	u32 offset;
+	int i;
+
+	offset = block_offset(bdb, BDB_LVDS_LFP_DATA);
+
+	for (i = 0; i < 16; i++) {
+		if (ptrs->ptr[i].fp_timing.offset < offset ||
+		    ptrs->ptr[i].dvo_timing.offset < offset ||
+		    ptrs->ptr[i].panel_pnp_id.offset < offset)
+			return false;
+
+		ptrs->ptr[i].fp_timing.offset -= offset;
+		ptrs->ptr[i].dvo_timing.offset -= offset;
+		ptrs->ptr[i].panel_pnp_id.offset -= offset;
+	}
+
+	return true;
+}
+
 static const void *
 find_section(struct drm_i915_private *i915,
 	     const void *bdb, enum bdb_block_id section_id,
@@ -174,6 +212,13 @@ find_section(struct drm_i915_private *i915,
 	drm_dbg_kms(&i915->drm, "Found BDB block %d (size %zu, min size %zu)\n",
 		    section_id, block_size, min_size);
 
+	if (section_id == BDB_LVDS_LFP_DATA_PTRS &&
+	    !fixup_lfp_data_ptrs(bdb, entry->data + 3)) {
+		drm_err(&i915->drm, "VBT has malformed LFP data table pointers\n");
+		kfree(entry);
+		return NULL;
+	}
+
 	list_add(&entry->node, &i915->vbt.bdb_blocks);
 
 	return entry->data + 3;
@@ -255,22 +300,19 @@ get_lvds_dvo_timing(const struct bdb_lvds_lfp_data *lvds_lfp_data,
  * this function may return NULL if the corresponding entry is invalid
  */
 static const struct lvds_fp_timing *
-get_lvds_fp_timing(const struct bdb_header *bdb,
-		   const struct bdb_lvds_lfp_data *data,
+get_lvds_fp_timing(const struct bdb_lvds_lfp_data *data,
 		   const struct bdb_lvds_lfp_data_ptrs *ptrs,
 		   int index)
 {
-	size_t data_ofs = (const u8 *)data - (const u8 *)bdb;
 	u16 data_size = ((const u16 *)data)[-1]; /* stored in header */
 	size_t ofs;
 
 	if (index >= ARRAY_SIZE(ptrs->ptr))
 		return NULL;
 	ofs = ptrs->ptr[index].fp_timing.offset;
-	if (ofs < data_ofs ||
-	    ofs + sizeof(struct lvds_fp_timing) > data_ofs + data_size)
+	if (ofs + sizeof(struct lvds_fp_timing) > data_size)
 		return NULL;
-	return (const struct lvds_fp_timing *)((const u8 *)bdb + ofs);
+	return (const struct lvds_fp_timing *)((const u8 *)data + ofs);
 }
 
 /* Parse general panel options */
@@ -373,7 +415,7 @@ parse_lfp_panel_dtd(struct drm_i915_private *i915,
 		    "Found panel mode in BIOS VBT legacy lfp table:\n");
 	drm_mode_debug_printmodeline(panel_fixed_mode);
 
-	fp_timing = get_lvds_fp_timing(bdb, lvds_lfp_data,
+	fp_timing = get_lvds_fp_timing(lvds_lfp_data,
 				       lvds_lfp_data_ptrs,
 				       panel_type);
 	if (fp_timing) {
-- 
2.34.1


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

* [Intel-gfx] [PATCH 04/11] drm/i915/bios: Validate LFP data table pointers
  2022-03-17 17:19 [Intel-gfx] [PATCH 00/11] drm/i915/bios: Rework BDB block handling Ville Syrjala
                   ` (2 preceding siblings ...)
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 03/11] drm/i915/bios: Use the copy of the LFP data table always Ville Syrjala
@ 2022-03-17 17:19 ` Ville Syrjala
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 05/11] drm/i915/bios: Trust the LFP data pointers Ville Syrjala
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 33+ messages in thread
From: Ville Syrjala @ 2022-03-17 17:19 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Make sure the LFP data table pointers sane. Sensible looking
table entries, evetything points correctly into the data block,
etc.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_bios.c | 82 ++++++++++++++++++++++-
 1 file changed, 81 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index 777339f5dd79..29953996a474 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -153,6 +153,86 @@ static u32 block_offset(const void *bdb, enum bdb_block_id section_id)
 	return block - bdb;
 }
 
+/* size of the block excluding the header */
+static u32 block_size(const void *bdb, enum bdb_block_id section_id)
+{
+	const void *block;
+
+	block = find_raw_section(bdb, section_id);
+	if (!block)
+		return 0;
+
+	return get_blocksize(block);
+}
+
+static bool validate_lfp_data_ptrs(const void *bdb,
+				   const struct bdb_lvds_lfp_data_ptrs *ptrs)
+{
+	int fp_timing_size, dvo_timing_size, panel_pnp_id_size;
+	int data_block_size, lfp_data_size;
+	int i;
+
+	data_block_size = block_size(bdb, BDB_LVDS_LFP_DATA);
+	if (data_block_size == 0)
+		return false;
+
+	/* always 3 indicating the presence of fp_timing+dvo_timing+panel_pnp_id */
+	if (ptrs->lvds_entries != 3)
+		return false;
+
+	fp_timing_size = ptrs->ptr[0].fp_timing.table_size;
+	dvo_timing_size = ptrs->ptr[0].dvo_timing.table_size;
+	panel_pnp_id_size = ptrs->ptr[0].panel_pnp_id.table_size;
+
+	/* fp_timing has variable size */
+	if (fp_timing_size < 32 ||
+	    dvo_timing_size != sizeof(struct lvds_dvo_timing) ||
+	    panel_pnp_id_size != sizeof(struct lvds_pnp_id))
+		return false;
+
+	lfp_data_size = ptrs->ptr[1].fp_timing.offset - ptrs->ptr[0].fp_timing.offset;
+	if (16 * lfp_data_size > data_block_size)
+		return false;
+
+	/*
+	 * Except for vlv/chv machines all real VBTs seem to have 6
+	 * unaccounted bytes in the fp_timing table. And it doesn't
+	 * appear to be a really intentional hole as the fp_timing
+	 * 0xffff terminator is always within those 6 missing bytes.
+	 */
+	if (fp_timing_size + dvo_timing_size + panel_pnp_id_size != lfp_data_size &&
+	    fp_timing_size + 6 + dvo_timing_size + panel_pnp_id_size != lfp_data_size)
+		return false;
+
+	if (ptrs->ptr[0].fp_timing.offset + fp_timing_size > ptrs->ptr[0].dvo_timing.offset ||
+	    ptrs->ptr[0].dvo_timing.offset + dvo_timing_size != ptrs->ptr[0].panel_pnp_id.offset ||
+	    ptrs->ptr[0].panel_pnp_id.offset + panel_pnp_id_size != lfp_data_size)
+		return false;
+
+	/* make sure the table entries have uniform size */
+	for (i = 1; i < 16; i++) {
+		if (ptrs->ptr[i].fp_timing.table_size != fp_timing_size ||
+		    ptrs->ptr[i].dvo_timing.table_size != dvo_timing_size ||
+		    ptrs->ptr[i].panel_pnp_id.table_size != panel_pnp_id_size)
+			return false;
+
+		if (ptrs->ptr[i].fp_timing.offset - ptrs->ptr[i-1].fp_timing.offset != lfp_data_size ||
+		    ptrs->ptr[i].dvo_timing.offset - ptrs->ptr[i-1].dvo_timing.offset != lfp_data_size ||
+		    ptrs->ptr[i].panel_pnp_id.offset - ptrs->ptr[i-1].panel_pnp_id.offset != lfp_data_size)
+			return false;
+	}
+
+	/* make sure the tables fit inside the data block */
+	for (i = 0; i < 16; i++) {
+		if (ptrs->ptr[i].fp_timing.offset + fp_timing_size > data_block_size ||
+		    ptrs->ptr[i].dvo_timing.offset + dvo_timing_size > data_block_size ||
+		    ptrs->ptr[i].panel_pnp_id.offset + panel_pnp_id_size > data_block_size)
+			return false;
+	}
+
+	return true;
+}
+
 /* make the data table offsets relative to the data block */
 static bool fixup_lfp_data_ptrs(const void *bdb, void *ptrs_block)
 {
@@ -173,7 +253,7 @@ static bool fixup_lfp_data_ptrs(const void *bdb, void *ptrs_block)
 		ptrs->ptr[i].panel_pnp_id.offset -= offset;
 	}
 
-	return true;
+	return validate_lfp_data_ptrs(bdb, ptrs);
 }
 
 static const void *
-- 
2.34.1


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

* [Intel-gfx] [PATCH 05/11] drm/i915/bios: Trust the LFP data pointers
  2022-03-17 17:19 [Intel-gfx] [PATCH 00/11] drm/i915/bios: Rework BDB block handling Ville Syrjala
                   ` (3 preceding siblings ...)
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 04/11] drm/i915/bios: Validate LFP data table pointers Ville Syrjala
@ 2022-03-17 17:19 ` Ville Syrjala
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 06/11] drm/i915/bios: Validate the panel_name table Ville Syrjala
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 33+ messages in thread
From: Ville Syrjala @ 2022-03-17 17:19 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Now that we've sufficiently validated the LFP data pointers we
can trust them.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_bios.c | 50 ++++++-----------------
 1 file changed, 12 insertions(+), 38 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index 29953996a474..a2a3fb459a9d 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -355,44 +355,19 @@ fill_detail_timing_data(struct drm_display_mode *panel_fixed_mode,
 }
 
 static const struct lvds_dvo_timing *
-get_lvds_dvo_timing(const struct bdb_lvds_lfp_data *lvds_lfp_data,
-		    const struct bdb_lvds_lfp_data_ptrs *lvds_lfp_data_ptrs,
+get_lvds_dvo_timing(const struct bdb_lvds_lfp_data *data,
+		    const struct bdb_lvds_lfp_data_ptrs *ptrs,
 		    int index)
 {
-	/*
-	 * the size of fp_timing varies on the different platform.
-	 * So calculate the DVO timing relative offset in LVDS data
-	 * entry to get the DVO timing entry
-	 */
-
-	int lfp_data_size =
-		lvds_lfp_data_ptrs->ptr[1].dvo_timing.offset -
-		lvds_lfp_data_ptrs->ptr[0].dvo_timing.offset;
-	int dvo_timing_offset =
-		lvds_lfp_data_ptrs->ptr[0].dvo_timing.offset -
-		lvds_lfp_data_ptrs->ptr[0].fp_timing.offset;
-	char *entry = (char *)lvds_lfp_data->data + lfp_data_size * index;
-
-	return (struct lvds_dvo_timing *)(entry + dvo_timing_offset);
+	return (const void *)data + ptrs->ptr[index].dvo_timing.offset;
 }
 
-/* get lvds_fp_timing entry
- * this function may return NULL if the corresponding entry is invalid
- */
 static const struct lvds_fp_timing *
 get_lvds_fp_timing(const struct bdb_lvds_lfp_data *data,
 		   const struct bdb_lvds_lfp_data_ptrs *ptrs,
 		   int index)
 {
-	u16 data_size = ((const u16 *)data)[-1]; /* stored in header */
-	size_t ofs;
-
-	if (index >= ARRAY_SIZE(ptrs->ptr))
-		return NULL;
-	ofs = ptrs->ptr[index].fp_timing.offset;
-	if (ofs + sizeof(struct lvds_fp_timing) > data_size)
-		return NULL;
-	return (const struct lvds_fp_timing *)((const u8 *)data + ofs);
+	return (const void *)data + ptrs->ptr[index].fp_timing.offset;
 }
 
 /* Parse general panel options */
@@ -498,15 +473,14 @@ parse_lfp_panel_dtd(struct drm_i915_private *i915,
 	fp_timing = get_lvds_fp_timing(lvds_lfp_data,
 				       lvds_lfp_data_ptrs,
 				       panel_type);
-	if (fp_timing) {
-		/* check the resolution, just to be sure */
-		if (fp_timing->x_res == panel_fixed_mode->hdisplay &&
-		    fp_timing->y_res == panel_fixed_mode->vdisplay) {
-			i915->vbt.bios_lvds_val = fp_timing->lvds_reg_val;
-			drm_dbg_kms(&i915->drm,
-				    "VBT initial LVDS value %x\n",
-				    i915->vbt.bios_lvds_val);
-		}
+
+	/* check the resolution, just to be sure */
+	if (fp_timing->x_res == panel_fixed_mode->hdisplay &&
+	    fp_timing->y_res == panel_fixed_mode->vdisplay) {
+		i915->vbt.bios_lvds_val = fp_timing->lvds_reg_val;
+		drm_dbg_kms(&i915->drm,
+			    "VBT initial LVDS value %x\n",
+			    i915->vbt.bios_lvds_val);
 	}
 }
 
-- 
2.34.1


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

* [Intel-gfx] [PATCH 06/11] drm/i915/bios: Validate the panel_name table
  2022-03-17 17:19 [Intel-gfx] [PATCH 00/11] drm/i915/bios: Rework BDB block handling Ville Syrjala
                   ` (4 preceding siblings ...)
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 05/11] drm/i915/bios: Trust the LFP data pointers Ville Syrjala
@ 2022-03-17 17:19 ` Ville Syrjala
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 07/11] drm/i915/bios: Reorder panel DTD parsing Ville Syrjala
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 33+ messages in thread
From: Ville Syrjala @ 2022-03-17 17:19 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

In addition to the fp_timing,dvo_timing,panel_pnp_id tables
there also exists a panel_name table. Unlike the others this
is just one offset+table_size even though there are still 16
actual panel_names in the data block.

The panel_name table made its first appearance somewhere
around VBT version 156-163. The exact version is not known.
But we don't need to know that since we can just check whether
the pointers block has enough room for it or not.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_bios.c     | 18 +++++++++++++++++-
 drivers/gpu/drm/i915/display/intel_vbt_defs.h |  5 +++++
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index a2a3fb459a9d..59f16c460d7b 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -168,7 +168,7 @@ static u32 block_size(const void *bdb, enum bdb_block_id section_id)
 static bool validate_lfp_data_ptrs(const void *bdb,
 				   const struct bdb_lvds_lfp_data_ptrs *ptrs)
 {
-	int fp_timing_size, dvo_timing_size, panel_pnp_id_size;
+	int fp_timing_size, dvo_timing_size, panel_pnp_id_size, panel_name_size;
 	int data_block_size, lfp_data_size;
 	int i;
 
@@ -183,6 +183,7 @@ static bool validate_lfp_data_ptrs(const void *bdb,
 	fp_timing_size = ptrs->ptr[0].fp_timing.table_size;
 	dvo_timing_size = ptrs->ptr[0].dvo_timing.table_size;
 	panel_pnp_id_size = ptrs->ptr[0].panel_pnp_id.table_size;
+	panel_name_size = ptrs->panel_name.table_size;
 
 	/* fp_timing has variable size */
 	if (fp_timing_size < 32 ||
@@ -190,6 +191,11 @@ static bool validate_lfp_data_ptrs(const void *bdb,
 	    panel_pnp_id_size != sizeof(struct lvds_pnp_id))
 		return false;
 
+	/* panel_name is not present in old VBTs */
+	if (panel_name_size != 0 &&
+	    panel_name_size != sizeof(struct lvds_lfp_panel_name))
+		return false;
+
 	lfp_data_size = ptrs->ptr[1].fp_timing.offset - ptrs->ptr[0].fp_timing.offset;
 	if (16 * lfp_data_size > data_block_size)
 		return false;
@@ -230,6 +236,9 @@ static bool validate_lfp_data_ptrs(const void *bdb,
 			return false;
 	}
 
+	if (ptrs->panel_name.offset + 16 * panel_name_size > data_block_size)
+		return false;
+
 	return true;
 }
 
@@ -253,6 +262,13 @@ static bool fixup_lfp_data_ptrs(const void *bdb, void *ptrs_block)
 		ptrs->ptr[i].panel_pnp_id.offset -= offset;
 	}
 
+	if (ptrs->panel_name.table_size) {
+		if (ptrs->panel_name.offset < offset)
+			return false;
+
+		ptrs->panel_name.offset -= offset;
+	}
+
 	return validate_lfp_data_ptrs(bdb, ptrs);
 }
 
diff --git a/drivers/gpu/drm/i915/display/intel_vbt_defs.h b/drivers/gpu/drm/i915/display/intel_vbt_defs.h
index d727fcd6cdab..e4a11c3e3f3e 100644
--- a/drivers/gpu/drm/i915/display/intel_vbt_defs.h
+++ b/drivers/gpu/drm/i915/display/intel_vbt_defs.h
@@ -737,6 +737,7 @@ struct lvds_lfp_data_ptr {
 struct bdb_lvds_lfp_data_ptrs {
 	u8 lvds_entries; /* followed by one or more lvds_data_ptr structs */
 	struct lvds_lfp_data_ptr ptr[16];
+	struct lvds_lfp_data_ptr_table panel_name; /* 156-163? */
 } __packed;
 
 /*
@@ -778,6 +779,10 @@ struct bdb_lvds_lfp_data {
 	struct lvds_lfp_data_entry data[16];
 } __packed;
 
+struct lvds_lfp_panel_name {
+	u8 name[13];
+} __packed;
+
 /*
  * Block 43 - LFP Backlight Control Data Block
  */
-- 
2.34.1


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

* [Intel-gfx] [PATCH 07/11] drm/i915/bios: Reorder panel DTD parsing
  2022-03-17 17:19 [Intel-gfx] [PATCH 00/11] drm/i915/bios: Rework BDB block handling Ville Syrjala
                   ` (5 preceding siblings ...)
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 06/11] drm/i915/bios: Validate the panel_name table Ville Syrjala
@ 2022-03-17 17:19 ` Ville Syrjala
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 08/11] drm/i915/bios: Generate LFP data table pointers if the VBT lacks them Ville Syrjala
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 33+ messages in thread
From: Ville Syrjala @ 2022-03-17 17:19 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reorder things so that we can parse the entier LFP data block
in one go. For now we just stick to parsing the DTD from it.

Also fix the misleading comment about block 42 being deprecated.
Only the DTD part is deprecated, the rest is still very much needed.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_bios.c | 67 ++++++++++++-----------
 1 file changed, 34 insertions(+), 33 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index 59f16c460d7b..7633933a4920 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -448,28 +448,16 @@ parse_panel_options(struct drm_i915_private *i915,
 	}
 }
 
-/* Try to find integrated panel timing data */
 static void
 parse_lfp_panel_dtd(struct drm_i915_private *i915,
-		    const struct bdb_header *bdb)
+		    const struct bdb_lvds_lfp_data *lvds_lfp_data,
+		    const struct bdb_lvds_lfp_data_ptrs *lvds_lfp_data_ptrs)
 {
-	const struct bdb_lvds_lfp_data *lvds_lfp_data;
-	const struct bdb_lvds_lfp_data_ptrs *lvds_lfp_data_ptrs;
 	const struct lvds_dvo_timing *panel_dvo_timing;
 	const struct lvds_fp_timing *fp_timing;
 	struct drm_display_mode *panel_fixed_mode;
 	int panel_type = i915->vbt.panel_type;
 
-	lvds_lfp_data = find_section(i915, bdb, BDB_LVDS_LFP_DATA,
-				     sizeof(*lvds_lfp_data));
-	if (!lvds_lfp_data)
-		return;
-
-	lvds_lfp_data_ptrs = find_section(i915, bdb, BDB_LVDS_LFP_DATA_PTRS,
-					  sizeof(*lvds_lfp_data_ptrs));
-	if (!lvds_lfp_data_ptrs)
-		return;
-
 	panel_dvo_timing = get_lvds_dvo_timing(lvds_lfp_data,
 					       lvds_lfp_data_ptrs,
 					       panel_type);
@@ -500,6 +488,27 @@ parse_lfp_panel_dtd(struct drm_i915_private *i915,
 	}
 }
 
+static void
+parse_lfp_data(struct drm_i915_private *i915,
+	       const struct bdb_header *bdb)
+{
+	const struct bdb_lvds_lfp_data *data;
+	const struct bdb_lvds_lfp_data_ptrs *ptrs;
+
+	ptrs = find_section(i915, bdb, BDB_LVDS_LFP_DATA_PTRS,
+			    sizeof(*ptrs));
+	if (!ptrs)
+		return;
+
+	data = find_section(i915, bdb, BDB_LVDS_LFP_DATA,
+			    sizeof(*data));
+	if (!data)
+		return;
+
+	if (!i915->vbt.lfp_lvds_vbt_mode)
+		parse_lfp_panel_dtd(i915, data, ptrs);
+}
+
 static void
 parse_generic_dtd(struct drm_i915_private *i915,
 		  const struct bdb_header *bdb)
@@ -580,24 +589,6 @@ parse_generic_dtd(struct drm_i915_private *i915,
 	i915->vbt.lfp_lvds_vbt_mode = panel_fixed_mode;
 }
 
-static void
-parse_panel_dtd(struct drm_i915_private *i915,
-		const struct bdb_header *bdb)
-{
-	/*
-	 * Older VBTs provided provided DTD information for internal displays
-	 * through the "LFP panel DTD" block (42).  As of VBT revision 229,
-	 * that block is now deprecated and DTD information should be provided
-	 * via a newer "generic DTD" block (58).  Just to be safe, we'll
-	 * try the new generic DTD block first on VBT >= 229, but still fall
-	 * back to trying the old LFP block if that fails.
-	 */
-	if (bdb->version >= 229)
-		parse_generic_dtd(i915, bdb);
-	if (!i915->vbt.lfp_lvds_vbt_mode)
-		parse_lfp_panel_dtd(i915, bdb);
-}
-
 static void
 parse_lfp_backlight(struct drm_i915_private *i915,
 		    const struct bdb_header *bdb)
@@ -2693,7 +2684,17 @@ void intel_bios_init(struct drm_i915_private *i915)
 	parse_general_features(i915, bdb);
 	parse_general_definitions(i915, bdb);
 	parse_panel_options(i915, bdb);
-	parse_panel_dtd(i915, bdb);
+	/*
+	 * Older VBTs provided DTD information for internal displays through
+	 * the "LFP panel tables" block (42).  As of VBT revision 229 the
+	 * DTD information should be provided via a newer "generic DTD"
+	 * block (58).  Just to be safe, we'll try the new generic DTD block
+	 * first on VBT >= 229, but still fall back to trying the old LFP
+	 * block if that fails.
+	 */
+	if (bdb->version >= 229)
+		parse_generic_dtd(i915, bdb);
+	parse_lfp_data(i915, bdb);
 	parse_lfp_backlight(i915, bdb);
 	parse_sdvo_panel_data(i915, bdb);
 	parse_driver_features(i915, bdb);
-- 
2.34.1


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

* [Intel-gfx] [PATCH 08/11] drm/i915/bios: Generate LFP data table pointers if the VBT lacks them
  2022-03-17 17:19 [Intel-gfx] [PATCH 00/11] drm/i915/bios: Rework BDB block handling Ville Syrjala
                   ` (6 preceding siblings ...)
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 07/11] drm/i915/bios: Reorder panel DTD parsing Ville Syrjala
@ 2022-03-17 17:19 ` Ville Syrjala
  2022-03-17 23:41   ` [Intel-gfx] [PATCH v2 " Ville Syrjala
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 09/11] drm/i915/bios: Get access to the tail end of the LFP data block Ville Syrjala
                   ` (13 subsequent siblings)
  21 siblings, 1 reply; 33+ messages in thread
From: Ville Syrjala @ 2022-03-17 17:19 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Modern VBTs (seem at least on TGL with VBT version 240) no
longer contain the LFP data table pointers block (42). We
are expecting to have one in order to be able to parse the
LFP data block (41), so let's make one up.

Since the fp_timing table has variable size we must somehow
determine its size. Rather than just hardcode it we look for
the terminator bytes (0xffff) to figure out where each table
entry starts. dvo_timing, panel_pnp_id, and panel_name are
expected to have fixed size.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_bios.c | 133 +++++++++++++++++++++-
 1 file changed, 132 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index 7633933a4920..b34f8a77712a 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -272,12 +272,132 @@ static bool fixup_lfp_data_ptrs(const void *bdb, void *ptrs_block)
 	return validate_lfp_data_ptrs(bdb, ptrs);
 }
 
+static const void *find_fp_timing_terminator(const u8 *data, int size)
+{
+	int i;
+
+	if (!data)
+		return NULL;
+
+	for (i = 0; i < size - 1; i++) {
+		if (data[i] == 0xff && data[i+1] == 0xff)
+			return &data[i];
+	}
+
+	return NULL;
+}
+
+static int make_lfp_data_ptr(struct lvds_lfp_data_ptr_table *table,
+			     int table_size, int total_size)
+{
+	if (total_size < table_size)
+		return total_size;
+
+	table->table_size = table_size;
+	table->offset = total_size - table_size;
+
+	return total_size - table_size;
+}
+
+static void next_lfp_data_ptr(struct lvds_lfp_data_ptr_table *next,
+			      const struct lvds_lfp_data_ptr_table *prev,
+			      int size)
+{
+	next->table_size = prev->table_size;
+	next->offset = prev->offset + size;
+}
+
+static void *generate_lfp_data_ptrs(const void *bdb)
+{
+	int i, size, table_size, block_size, offset;
+	const void *t0, *t1, *block;
+	struct bdb_lvds_lfp_data_ptrs *ptrs;
+	void *ptrs_block;
+
+	block = find_raw_section(bdb, BDB_LVDS_LFP_DATA);
+	if (!block)
+		return NULL;
+
+	block_size = get_blocksize(block);
+
+	size = block_size;
+	t0 = find_fp_timing_terminator(block, size);
+
+	size -= t0 - block - 2;
+	t1 = find_fp_timing_terminator(t0 + 2, size);
+
+	if (!t0 || !t1)
+		return NULL;
+
+	size = t1 - t0;
+	if (size * 16 > block_size)
+		return NULL;
+
+	ptrs_block = kzalloc(sizeof(*ptrs) + 3, GFP_KERNEL);
+	if (!ptrs_block)
+		return NULL;
+
+	*(u8 *)(ptrs_block + 0) = BDB_LVDS_LFP_DATA_PTRS;
+	*(u16 *)(ptrs_block + 1) = sizeof(*ptrs);
+	ptrs = ptrs_block + 3;
+
+	table_size = sizeof(struct lvds_pnp_id);
+	size = make_lfp_data_ptr(&ptrs->ptr[0].panel_pnp_id, table_size, size);
+
+	table_size = sizeof(struct lvds_dvo_timing);
+	size = make_lfp_data_ptr(&ptrs->ptr[0].dvo_timing, table_size, size);
+
+	table_size = t0 - block + 2;
+	size = make_lfp_data_ptr(&ptrs->ptr[0].fp_timing, table_size, size);
+
+	if (ptrs->ptr[0].fp_timing.table_size)
+		ptrs->lvds_entries++;
+	if (ptrs->ptr[0].dvo_timing.table_size)
+		ptrs->lvds_entries++;
+	if (ptrs->ptr[0].panel_pnp_id.table_size)
+		ptrs->lvds_entries++;
+
+	if (size != 0 || ptrs->lvds_entries != 3) {
+		kfree(ptrs);
+		return NULL;
+	}
+
+	size = t1 - t0;
+	for (i = 1; i < 16; i++) {
+		next_lfp_data_ptr(&ptrs->ptr[i].fp_timing, &ptrs->ptr[i-1].fp_timing, size);
+		next_lfp_data_ptr(&ptrs->ptr[i].dvo_timing, &ptrs->ptr[i-1].dvo_timing, size);
+		next_lfp_data_ptr(&ptrs->ptr[i].panel_pnp_id, &ptrs->ptr[i-1].panel_pnp_id, size);
+	}
+
+	size = t1 - t0;
+	table_size = sizeof(struct lvds_lfp_panel_name);
+
+	if (16 * (size + table_size) <= block_size) {
+		ptrs->panel_name.table_size = table_size;
+		ptrs->panel_name.offset = size * 16;
+	}
+
+	offset = block - bdb;
+
+	for (i = 0; i < 16; i++) {
+		ptrs->ptr[i].fp_timing.offset += offset;
+		ptrs->ptr[i].dvo_timing.offset += offset;
+		ptrs->ptr[i].panel_pnp_id.offset += offset;
+	}
+
+	if (ptrs->panel_name.table_size)
+		ptrs->panel_name.offset += offset;
+
+	return ptrs;
+}
+
 static const void *
 find_section(struct drm_i915_private *i915,
 	     const void *bdb, enum bdb_block_id section_id,
 	     size_t min_size)
 {
 	struct bdb_block_entry *entry;
+	void *temp_block = NULL;
 	const void *block;
 	size_t block_size;
 
@@ -291,6 +411,13 @@ find_section(struct drm_i915_private *i915,
 	}
 
 	block = find_raw_section(bdb, section_id);
+
+	/* Modern VBTs (~TGL+) lack the LFP data table pointers block, make one up */
+	if (!block && section_id == BDB_LVDS_LFP_DATA_PTRS) {
+		drm_dbg_kms(&i915->drm, "Generating LFP data table pointers\n");
+		temp_block = generate_lfp_data_ptrs(bdb);
+		block = temp_block;
+	}
 	if (!block)
 		return NULL;
 
@@ -298,13 +425,17 @@ find_section(struct drm_i915_private *i915,
 
 	entry = kzalloc(struct_size(entry, data, max(min_size, block_size) + 3),
 			GFP_KERNEL);
-	if (!entry)
+	if (!entry) {
+		kfree(temp_block);
 		return NULL;
+	}
 
 	entry->section_id = section_id;
 	entry->min_size = min_size;
 	memcpy(entry->data, block - 3, block_size + 3);
 
+	kfree(temp_block);
+
 	drm_dbg_kms(&i915->drm, "Found BDB block %d (size %zu, min size %zu)\n",
 		    section_id, block_size, min_size);
 
-- 
2.34.1


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

* [Intel-gfx] [PATCH 09/11] drm/i915/bios: Get access to the tail end of the LFP data block
  2022-03-17 17:19 [Intel-gfx] [PATCH 00/11] drm/i915/bios: Rework BDB block handling Ville Syrjala
                   ` (7 preceding siblings ...)
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 08/11] drm/i915/bios: Generate LFP data table pointers if the VBT lacks them Ville Syrjala
@ 2022-03-17 17:19 ` Ville Syrjala
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 10/11] drm/i915/bios: Parse the seamless DRRS min refresh rate Ville Syrjala
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 33+ messages in thread
From: Ville Syrjala @ 2022-03-17 17:19 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

We need to start parsing stuff from the tail end of the LFP data block.
This is made awkward by the fact that the fp_timing table has variable
size. So we must use a bit more finesse to get the tail end, and to
make sure we allocate enough memory for it to make sure our struct
representation fits.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_bios.c     | 31 ++++++++++++++++++-
 drivers/gpu/drm/i915/display/intel_vbt_defs.h | 17 ++++++++++
 2 files changed, 47 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index b34f8a77712a..3d56fd440c0b 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -517,6 +517,28 @@ get_lvds_fp_timing(const struct bdb_lvds_lfp_data *data,
 	return (const void *)data + ptrs->ptr[index].fp_timing.offset;
 }
 
+static const struct bdb_lvds_lfp_data_tail *
+get_lfp_data_tail(const struct bdb_lvds_lfp_data *data,
+		  const struct bdb_lvds_lfp_data_ptrs *ptrs)
+{
+	if (ptrs->panel_name.table_size)
+		return (const void *)data + ptrs->panel_name.offset;
+	else
+		return NULL;
+}
+
+static size_t lfp_data_min_size(const struct bdb_lvds_lfp_data_ptrs *ptrs)
+{
+	size_t size;
+
+	size = sizeof(struct bdb_lvds_lfp_data);
+	if (ptrs->panel_name.table_size)
+		size = max(size, ptrs->panel_name.offset +
+			   sizeof(struct bdb_lvds_lfp_data_tail));
+
+	return size;
+}
+
 /* Parse general panel options */
 static void
 parse_panel_options(struct drm_i915_private *i915,
@@ -624,6 +646,7 @@ parse_lfp_data(struct drm_i915_private *i915,
 	       const struct bdb_header *bdb)
 {
 	const struct bdb_lvds_lfp_data *data;
+	const struct bdb_lvds_lfp_data_tail *tail;
 	const struct bdb_lvds_lfp_data_ptrs *ptrs;
 
 	ptrs = find_section(i915, bdb, BDB_LVDS_LFP_DATA_PTRS,
@@ -632,12 +655,18 @@ parse_lfp_data(struct drm_i915_private *i915,
 		return;
 
 	data = find_section(i915, bdb, BDB_LVDS_LFP_DATA,
-			    sizeof(*data));
+			    lfp_data_min_size(ptrs));
 	if (!data)
 		return;
 
 	if (!i915->vbt.lfp_lvds_vbt_mode)
 		parse_lfp_panel_dtd(i915, data, ptrs);
+
+	tail = get_lfp_data_tail(data, ptrs);
+	if (!tail)
+		return;
+
+	(void)tail;
 }
 
 static void
diff --git a/drivers/gpu/drm/i915/display/intel_vbt_defs.h b/drivers/gpu/drm/i915/display/intel_vbt_defs.h
index e4a11c3e3f3e..64551d206aeb 100644
--- a/drivers/gpu/drm/i915/display/intel_vbt_defs.h
+++ b/drivers/gpu/drm/i915/display/intel_vbt_defs.h
@@ -783,6 +783,23 @@ struct lvds_lfp_panel_name {
 	u8 name[13];
 } __packed;
 
+struct lvds_lfp_black_border {
+	u8 top; /*  227 */
+	u8 bottom; /*  227 */
+	u8 left; /* 238 */
+	u8 right; /* 238 */
+} __packed;
+
+struct bdb_lvds_lfp_data_tail {
+	struct lvds_lfp_panel_name panel_name[16]; /* 156-163? */
+	u16 scaling_enable; /* 187 */
+	u8 seamless_drrs_min_refresh_rate[16]; /* 188 */
+	u8 pixel_overlap_count[16]; /* 208 */
+	struct lvds_lfp_black_border black_border[16]; /* 227 */
+	u16 dual_lfp_port_sync_enable; /* 231 */
+	u16 gpu_dithering_for_banding_artifacts; /* 245 */
+} __packed;
+
 /*
  * Block 43 - LFP Backlight Control Data Block
  */
-- 
2.34.1


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

* [Intel-gfx] [PATCH 10/11] drm/i915/bios: Parse the seamless DRRS min refresh rate
  2022-03-17 17:19 [Intel-gfx] [PATCH 00/11] drm/i915/bios: Rework BDB block handling Ville Syrjala
                   ` (8 preceding siblings ...)
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 09/11] drm/i915/bios: Get access to the tail end of the LFP data block Ville Syrjala
@ 2022-03-17 17:19 ` Ville Syrjala
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 11/11] drm/i915: Respect VBT " Ville Syrjala
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 33+ messages in thread
From: Ville Syrjala @ 2022-03-17 17:19 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Extract the seamless DRRS min refresh rate from the VBT.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_bios.c | 7 ++++++-
 drivers/gpu/drm/i915/i915_drv.h           | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index 3d56fd440c0b..542ad289cc49 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -648,6 +648,7 @@ parse_lfp_data(struct drm_i915_private *i915,
 	const struct bdb_lvds_lfp_data *data;
 	const struct bdb_lvds_lfp_data_tail *tail;
 	const struct bdb_lvds_lfp_data_ptrs *ptrs;
+	int panel_type = i915->vbt.panel_type;
 
 	ptrs = find_section(i915, bdb, BDB_LVDS_LFP_DATA_PTRS,
 			    sizeof(*ptrs));
@@ -666,7 +667,11 @@ parse_lfp_data(struct drm_i915_private *i915,
 	if (!tail)
 		return;
 
-	(void)tail;
+	i915->vbt.seamless_drrs_min_refresh_rate =
+		tail->seamless_drrs_min_refresh_rate[panel_type];
+	drm_dbg_kms(&i915->drm,
+		    "Seamless DRRS min refresh rate: %d Hz\n",
+		    i915->vbt.seamless_drrs_min_refresh_rate);
 }
 
 static void
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 0f52ce62281e..0d51028ec553 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -329,6 +329,7 @@ struct intel_vbt_data {
 	bool override_afc_startup;
 	u8 override_afc_startup_val;
 
+	u8 seamless_drrs_min_refresh_rate;
 	enum drrs_type drrs_type;
 
 	struct {
-- 
2.34.1


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

* [Intel-gfx] [PATCH 11/11] drm/i915: Respect VBT seamless DRRS min refresh rate
  2022-03-17 17:19 [Intel-gfx] [PATCH 00/11] drm/i915/bios: Rework BDB block handling Ville Syrjala
                   ` (9 preceding siblings ...)
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 10/11] drm/i915/bios: Parse the seamless DRRS min refresh rate Ville Syrjala
@ 2022-03-17 17:19 ` Ville Syrjala
  2022-03-17 17:45 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/bios: Rework BDB block handling Patchwork
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 33+ messages in thread
From: Ville Syrjala @ 2022-03-17 17:19 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Make sure our choice of downclock mode respects the VBT
seameless DRRS min refresh rate limit.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_panel.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c
index f428d0457c17..31527fad3028 100644
--- a/drivers/gpu/drm/i915/display/intel_panel.c
+++ b/drivers/gpu/drm/i915/display/intel_panel.c
@@ -74,13 +74,17 @@ const struct drm_display_mode *
 intel_panel_downclock_mode(struct intel_connector *connector,
 			   const struct drm_display_mode *adjusted_mode)
 {
+	struct drm_i915_private *i915 = to_i915(connector->base.dev);
 	const struct drm_display_mode *fixed_mode, *best_mode = NULL;
-	int vrefresh = drm_mode_vrefresh(adjusted_mode);
+	int min_vrefresh = i915->vbt.seamless_drrs_min_refresh_rate;
+	int max_vrefresh = drm_mode_vrefresh(adjusted_mode);
 
 	/* pick the fixed_mode with the lowest refresh rate */
 	list_for_each_entry(fixed_mode, &connector->panel.fixed_modes, head) {
-		if (drm_mode_vrefresh(fixed_mode) < vrefresh) {
-			vrefresh = drm_mode_vrefresh(fixed_mode);
+		int vrefesh = drm_mode_vrefresh(fixed_mode);
+
+		if (vrefesh >= min_vrefresh && vrefesh < max_vrefresh) {
+			max_vrefresh = vrefesh;
 			best_mode = fixed_mode;
 		}
 	}
-- 
2.34.1


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

* [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/bios: Rework BDB block handling
  2022-03-17 17:19 [Intel-gfx] [PATCH 00/11] drm/i915/bios: Rework BDB block handling Ville Syrjala
                   ` (10 preceding siblings ...)
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 11/11] drm/i915: Respect VBT " Ville Syrjala
@ 2022-03-17 17:45 ` Patchwork
  2022-03-17 17:46 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 33+ messages in thread
From: Patchwork @ 2022-03-17 17:45 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/bios: Rework BDB block handling
URL   : https://patchwork.freedesktop.org/series/101496/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
42f50441c85c drm/i915/bios: Extract struct lvds_lfp_data_ptr_table
19e4a34e174c drm/i915/bios: Make copies of VBT data blocks
00d36301bbec drm/i915/bios: Use the copy of the LFP data table always
5304b3a06c2b drm/i915/bios: Validate LFP data table pointers
-:86: WARNING:LONG_LINE: line length of 103 exceeds 100 columns
#86: FILE: drivers/gpu/drm/i915/display/intel_bios.c:219:
+		if (ptrs->ptr[i].fp_timing.offset - ptrs->ptr[i-1].fp_timing.offset != lfp_data_size ||

-:86: CHECK:SPACING: spaces preferred around that '-' (ctx:VxV)
#86: FILE: drivers/gpu/drm/i915/display/intel_bios.c:219:
+		if (ptrs->ptr[i].fp_timing.offset - ptrs->ptr[i-1].fp_timing.offset != lfp_data_size ||
 		                                               ^

-:87: WARNING:LONG_LINE: line length of 105 exceeds 100 columns
#87: FILE: drivers/gpu/drm/i915/display/intel_bios.c:220:
+		    ptrs->ptr[i].dvo_timing.offset - ptrs->ptr[i-1].dvo_timing.offset != lfp_data_size ||

-:87: CHECK:SPACING: spaces preferred around that '-' (ctx:VxV)
#87: FILE: drivers/gpu/drm/i915/display/intel_bios.c:220:
+		    ptrs->ptr[i].dvo_timing.offset - ptrs->ptr[i-1].dvo_timing.offset != lfp_data_size ||
 		                                                ^

-:88: WARNING:LONG_LINE: line length of 107 exceeds 100 columns
#88: FILE: drivers/gpu/drm/i915/display/intel_bios.c:221:
+		    ptrs->ptr[i].panel_pnp_id.offset - ptrs->ptr[i-1].panel_pnp_id.offset != lfp_data_size)

-:88: CHECK:SPACING: spaces preferred around that '-' (ctx:VxV)
#88: FILE: drivers/gpu/drm/i915/display/intel_bios.c:221:
+		    ptrs->ptr[i].panel_pnp_id.offset - ptrs->ptr[i-1].panel_pnp_id.offset != lfp_data_size)
 		                                                  ^

total: 0 errors, 3 warnings, 3 checks, 94 lines checked
170d50d9a43d drm/i915/bios: Trust the LFP data pointers
c0263a7d1f46 drm/i915/bios: Validate the panel_name table
969bfc05996e drm/i915/bios: Reorder panel DTD parsing
b24d92ec8819 drm/i915/bios: Generate LFP data table pointers if the VBT lacks them
-:39: CHECK:SPACING: spaces preferred around that '+' (ctx:VxV)
#39: FILE: drivers/gpu/drm/i915/display/intel_bios.c:283:
+		if (data[i] == 0xff && data[i+1] == 0xff)
 		                             ^

-:123: CHECK:SPACING: spaces preferred around that '-' (ctx:VxV)
#123: FILE: drivers/gpu/drm/i915/display/intel_bios.c:367:
+		next_lfp_data_ptr(&ptrs->ptr[i].fp_timing, &ptrs->ptr[i-1].fp_timing, size);
 		                                                       ^

-:124: CHECK:SPACING: spaces preferred around that '-' (ctx:VxV)
#124: FILE: drivers/gpu/drm/i915/display/intel_bios.c:368:
+		next_lfp_data_ptr(&ptrs->ptr[i].dvo_timing, &ptrs->ptr[i-1].dvo_timing, size);
 		                                                        ^

-:125: CHECK:SPACING: spaces preferred around that '-' (ctx:VxV)
#125: FILE: drivers/gpu/drm/i915/display/intel_bios.c:369:
+		next_lfp_data_ptr(&ptrs->ptr[i].panel_pnp_id, &ptrs->ptr[i-1].panel_pnp_id, size);
 		                                                          ^

total: 0 errors, 0 warnings, 4 checks, 163 lines checked
e5d803c7802f drm/i915/bios: Get access to the tail end of the LFP data block
719b2fe6f28c drm/i915/bios: Parse the seamless DRRS min refresh rate
3cb52c1d9024 drm/i915: Respect VBT seamless DRRS min refresh rate



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

* [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915/bios: Rework BDB block handling
  2022-03-17 17:19 [Intel-gfx] [PATCH 00/11] drm/i915/bios: Rework BDB block handling Ville Syrjala
                   ` (11 preceding siblings ...)
  2022-03-17 17:45 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/bios: Rework BDB block handling Patchwork
@ 2022-03-17 17:46 ` Patchwork
  2022-03-17 18:17 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 33+ messages in thread
From: Patchwork @ 2022-03-17 17:46 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/bios: Rework BDB block handling
URL   : https://patchwork.freedesktop.org/series/101496/
State : warning

== Summary ==

$ dim sparse --fast origin/drm-tip
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.



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

* [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/bios: Rework BDB block handling
  2022-03-17 17:19 [Intel-gfx] [PATCH 00/11] drm/i915/bios: Rework BDB block handling Ville Syrjala
                   ` (12 preceding siblings ...)
  2022-03-17 17:46 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
@ 2022-03-17 18:17 ` Patchwork
  2022-03-17 20:20 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 33+ messages in thread
From: Patchwork @ 2022-03-17 18:17 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx

[-- Attachment #1: Type: text/plain, Size: 6270 bytes --]

== Series Details ==

Series: drm/i915/bios: Rework BDB block handling
URL   : https://patchwork.freedesktop.org/series/101496/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_11376 -> Patchwork_22595
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/index.html

Participating hosts (49 -> 45)
------------------------------

  Additional (1): bat-adlm-1 
  Missing    (5): shard-tglu fi-bsw-cyan fi-pnv-d510 shard-rkl fi-bdw-samus 

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in Patchwork_22595:

### IGT changes ###

#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@runner@aborted:
    - {bat-adlm-1}:       NOTRUN -> [FAIL][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/bat-adlm-1/igt@runner@aborted.html
    - {fi-rkl-11600}:     NOTRUN -> [FAIL][2]
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/fi-rkl-11600/igt@runner@aborted.html
    - {fi-jsl-1}:         NOTRUN -> [FAIL][3]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/fi-jsl-1/igt@runner@aborted.html
    - {fi-ehl-2}:         NOTRUN -> [FAIL][4]
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/fi-ehl-2/igt@runner@aborted.html

  
Known issues
------------

  Here are the changes found in Patchwork_22595 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@amdgpu/amd_basic@semaphore:
    - fi-hsw-4770:        NOTRUN -> [SKIP][5] ([fdo#109271] / [fdo#109315]) +17 similar issues
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/fi-hsw-4770/igt@amdgpu/amd_basic@semaphore.html

  * igt@runner@aborted:
    - fi-tgl-1115g4:      NOTRUN -> [FAIL][6] ([i915#3690])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/fi-tgl-1115g4/igt@runner@aborted.html
    - bat-dg1-6:          NOTRUN -> [FAIL][7] ([i915#2426])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/bat-dg1-6/igt@runner@aborted.html
    - bat-dg1-5:          NOTRUN -> [FAIL][8] ([i915#2426])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/bat-dg1-5/igt@runner@aborted.html
    - fi-rkl-guc:         NOTRUN -> [FAIL][9] ([i915#2426])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/fi-rkl-guc/igt@runner@aborted.html

  
#### Possible fixes ####

  * igt@i915_selftest@live@hangcheck:
    - fi-hsw-4770:        [INCOMPLETE][10] ([i915#3303]) -> [PASS][11]
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/fi-hsw-4770/igt@i915_selftest@live@hangcheck.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/fi-hsw-4770/igt@i915_selftest@live@hangcheck.html

  * igt@kms_frontbuffer_tracking@basic:
    - fi-cfl-8109u:       [DMESG-FAIL][12] ([i915#295]) -> [PASS][13]
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/fi-cfl-8109u/igt@kms_frontbuffer_tracking@basic.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/fi-cfl-8109u/igt@kms_frontbuffer_tracking@basic.html

  * igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-c:
    - fi-cfl-8109u:       [DMESG-WARN][14] ([i915#295] / [i915#5341]) -> [PASS][15]
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/fi-cfl-8109u/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-c.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/fi-cfl-8109u/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-c.html

  * igt@kms_pipe_crc_basic@read-crc-pipe-b:
    - fi-cfl-8109u:       [DMESG-WARN][16] ([i915#295]) -> [PASS][17] +9 similar issues
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/fi-cfl-8109u/igt@kms_pipe_crc_basic@read-crc-pipe-b.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/fi-cfl-8109u/igt@kms_pipe_crc_basic@read-crc-pipe-b.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
  [i915#2426]: https://gitlab.freedesktop.org/drm/intel/issues/2426
  [i915#295]: https://gitlab.freedesktop.org/drm/intel/issues/295
  [i915#3303]: https://gitlab.freedesktop.org/drm/intel/issues/3303
  [i915#3690]: https://gitlab.freedesktop.org/drm/intel/issues/3690
  [i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
  [i915#4897]: https://gitlab.freedesktop.org/drm/intel/issues/4897
  [i915#5137]: https://gitlab.freedesktop.org/drm/intel/issues/5137
  [i915#5169]: https://gitlab.freedesktop.org/drm/intel/issues/5169
  [i915#5269]: https://gitlab.freedesktop.org/drm/intel/issues/5269
  [i915#5341]: https://gitlab.freedesktop.org/drm/intel/issues/5341


Build changes
-------------

  * Linux: CI_DRM_11376 -> Patchwork_22595

  CI-20190529: 20190529
  CI_DRM_11376: 4dfe61816f94ec49a76ba03cddfe12f05b69c5d5 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_6385: f3df40281d93d5a63ee98fa30e90852d780673c9 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  Patchwork_22595: 3cb52c1d9024f3e7f2891244c74231fbdeb3338e @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

3cb52c1d9024 drm/i915: Respect VBT seamless DRRS min refresh rate
719b2fe6f28c drm/i915/bios: Parse the seamless DRRS min refresh rate
e5d803c7802f drm/i915/bios: Get access to the tail end of the LFP data block
b24d92ec8819 drm/i915/bios: Generate LFP data table pointers if the VBT lacks them
969bfc05996e drm/i915/bios: Reorder panel DTD parsing
c0263a7d1f46 drm/i915/bios: Validate the panel_name table
170d50d9a43d drm/i915/bios: Trust the LFP data pointers
5304b3a06c2b drm/i915/bios: Validate LFP data table pointers
00d36301bbec drm/i915/bios: Use the copy of the LFP data table always
19e4a34e174c drm/i915/bios: Make copies of VBT data blocks
42f50441c85c drm/i915/bios: Extract struct lvds_lfp_data_ptr_table

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/index.html

[-- Attachment #2: Type: text/html, Size: 7149 bytes --]

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

* Re: [Intel-gfx] [PATCH 01/11] drm/i915/bios: Extract struct lvds_lfp_data_ptr_table
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 01/11] drm/i915/bios: Extract struct lvds_lfp_data_ptr_table Ville Syrjala
@ 2022-03-17 18:33   ` Jani Nikula
  0 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2022-03-17 18:33 UTC (permalink / raw)
  To: Ville Syrjala, intel-gfx

On Thu, 17 Mar 2022, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> All the LFP data table pointers have uniform layout. Turn
> that into a struct.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_bios.c     | 10 +++++-----
>  drivers/gpu/drm/i915/display/intel_vbt_defs.h | 13 +++++++------
>  2 files changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
> index c7afe19dd44a..31fce7c92a28 100644
> --- a/drivers/gpu/drm/i915/display/intel_bios.c
> +++ b/drivers/gpu/drm/i915/display/intel_bios.c
> @@ -180,11 +180,11 @@ get_lvds_dvo_timing(const struct bdb_lvds_lfp_data *lvds_lfp_data,
>  	 */
>  
>  	int lfp_data_size =
> -		lvds_lfp_data_ptrs->ptr[1].dvo_timing_offset -
> -		lvds_lfp_data_ptrs->ptr[0].dvo_timing_offset;
> +		lvds_lfp_data_ptrs->ptr[1].dvo_timing.offset -
> +		lvds_lfp_data_ptrs->ptr[0].dvo_timing.offset;
>  	int dvo_timing_offset =
> -		lvds_lfp_data_ptrs->ptr[0].dvo_timing_offset -
> -		lvds_lfp_data_ptrs->ptr[0].fp_timing_offset;
> +		lvds_lfp_data_ptrs->ptr[0].dvo_timing.offset -
> +		lvds_lfp_data_ptrs->ptr[0].fp_timing.offset;
>  	char *entry = (char *)lvds_lfp_data->data + lfp_data_size * index;
>  
>  	return (struct lvds_dvo_timing *)(entry + dvo_timing_offset);
> @@ -205,7 +205,7 @@ get_lvds_fp_timing(const struct bdb_header *bdb,
>  
>  	if (index >= ARRAY_SIZE(ptrs->ptr))
>  		return NULL;
> -	ofs = ptrs->ptr[index].fp_timing_offset;
> +	ofs = ptrs->ptr[index].fp_timing.offset;
>  	if (ofs < data_ofs ||
>  	    ofs + sizeof(struct lvds_fp_timing) > data_ofs + data_size)
>  		return NULL;
> diff --git a/drivers/gpu/drm/i915/display/intel_vbt_defs.h b/drivers/gpu/drm/i915/display/intel_vbt_defs.h
> index e0508990df48..d727fcd6cdab 100644
> --- a/drivers/gpu/drm/i915/display/intel_vbt_defs.h
> +++ b/drivers/gpu/drm/i915/display/intel_vbt_defs.h
> @@ -722,15 +722,16 @@ struct bdb_lvds_options {
>  /*
>   * Block 41 - LFP Data Table Pointers
>   */
> +struct lvds_lfp_data_ptr_table {
> +	u16 offset; /* offsets are from start of bdb */
> +	u8 table_size;
> +} __packed;
>  
>  /* LFP pointer table contains entries to the struct below */
>  struct lvds_lfp_data_ptr {
> -	u16 fp_timing_offset; /* offsets are from start of bdb */
> -	u8 fp_table_size;
> -	u16 dvo_timing_offset;
> -	u8 dvo_table_size;
> -	u16 panel_pnp_id_offset;
> -	u8 pnp_table_size;
> +	struct lvds_lfp_data_ptr_table fp_timing;
> +	struct lvds_lfp_data_ptr_table dvo_timing;
> +	struct lvds_lfp_data_ptr_table panel_pnp_id;
>  } __packed;
>  
>  struct bdb_lvds_lfp_data_ptrs {

-- 
Jani Nikula, Intel Open Source Graphics Center

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

* Re: [Intel-gfx] [PATCH 02/11] drm/i915/bios: Make copies of VBT data blocks
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 02/11] drm/i915/bios: Make copies of VBT data blocks Ville Syrjala
@ 2022-03-17 19:02   ` Jani Nikula
  2022-03-17 22:18     ` Ville Syrjälä
  2022-03-17 20:21   ` [Intel-gfx] [PATCH v2 " Ville Syrjala
  1 sibling, 1 reply; 33+ messages in thread
From: Jani Nikula @ 2022-03-17 19:02 UTC (permalink / raw)
  To: Ville Syrjala, intel-gfx

On Thu, 17 Mar 2022, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Make a copy of each VB data block with a guaranteed minimum
> size. The extra (if any) will just be left zeroed.

*VBT

>
> This means we don't have to worry about going out of bounds
> when accessing any of the structure members. Otherwise that
> could easliy happen if we simply get the version check wrong,
> or if the VBT is broken/malicious.

*easily

>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

The high level question is if we really want to save the copies until
driver remove instead of just during parsing. The lifetime should be
mentioned in the commit message, with rationale if you have some.

I was wondering about making the copies up front instead of as needed,
but that means setting up a list for the min sizes. It would clean up
the usage (avoids passing around any pointers to original data to the
parsers). Then you could use just find_section(i915, BDB_XXX). Dunno.

As to details, seems to do what it says on the box,

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_bios.c | 122 ++++++++++++++++++----
>  drivers/gpu/drm/i915/i915_drv.h           |   1 +
>  2 files changed, 104 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
> index 31fce7c92a28..ff04514eb3b7 100644
> --- a/drivers/gpu/drm/i915/display/intel_bios.c
> +++ b/drivers/gpu/drm/i915/display/intel_bios.c
> @@ -87,8 +87,28 @@ static u32 get_blocksize(const void *block_data)
>  	return _get_blocksize(block_data - 3);
>  }
>  
> +struct bdb_block_entry {
> +	struct list_head node;
> +	size_t min_size;
> +	enum bdb_block_id section_id;
> +	u8 data[];
> +};
> +
> +static struct bdb_block_entry *
> +find_bdb_block(struct drm_i915_private *i915, enum bdb_block_id section_id)
> +{
> +	struct bdb_block_entry *entry;
> +
> +	list_for_each_entry(entry, &i915->vbt.bdb_blocks, node) {
> +		if (entry->section_id == section_id)
> +			return entry;
> +	}
> +
> +	return NULL;
> +}
> +
>  static const void *
> -find_section(const void *_bdb, enum bdb_block_id section_id)
> +find_raw_section(const void *_bdb, enum bdb_block_id section_id)
>  {
>  	const struct bdb_header *bdb = _bdb;
>  	const u8 *base = _bdb;
> @@ -118,6 +138,47 @@ find_section(const void *_bdb, enum bdb_block_id section_id)
>  	return NULL;
>  }
>  
> +static const void *
> +find_section(struct drm_i915_private *i915,
> +	     const void *bdb, enum bdb_block_id section_id,
> +	     size_t min_size)
> +{
> +	struct bdb_block_entry *entry;
> +	const void *block;
> +	size_t block_size;
> +
> +	entry = find_bdb_block(i915, section_id);
> +	if (entry) {
> +		/* make sure all callers pass in a consistent min_size */
> +		if (drm_WARN_ON(&i915->drm, entry->min_size != min_size))
> +			return NULL;
> +
> +		return entry->data + 3;
> +	}
> +
> +	block = find_raw_section(bdb, section_id);
> +	if (!block)
> +		return NULL;
> +
> +	block_size = get_blocksize(block);
> +
> +	entry = kzalloc(struct_size(entry, data, max(min_size, block_size) + 3),
> +			GFP_KERNEL);
> +	if (!entry)
> +		return NULL;
> +
> +	entry->section_id = section_id;
> +	entry->min_size = min_size;
> +	memcpy(entry->data, block - 3, block_size + 3);
> +
> +	drm_dbg_kms(&i915->drm, "Found BDB block %d (size %zu, min size %zu)\n",
> +		    section_id, block_size, min_size);
> +
> +	list_add(&entry->node, &i915->vbt.bdb_blocks);
> +
> +	return entry->data + 3;
> +}
> +
>  static void
>  fill_detail_timing_data(struct drm_display_mode *panel_fixed_mode,
>  			const struct lvds_dvo_timing *dvo_timing)
> @@ -222,7 +283,8 @@ parse_panel_options(struct drm_i915_private *i915,
>  	int drrs_mode;
>  	int ret;
>  
> -	lvds_options = find_section(bdb, BDB_LVDS_OPTIONS);
> +	lvds_options = find_section(i915, bdb, BDB_LVDS_OPTIONS,
> +				    sizeof(*lvds_options));
>  	if (!lvds_options)
>  		return;
>  
> @@ -285,11 +347,13 @@ parse_lfp_panel_dtd(struct drm_i915_private *i915,
>  	struct drm_display_mode *panel_fixed_mode;
>  	int panel_type = i915->vbt.panel_type;
>  
> -	lvds_lfp_data = find_section(bdb, BDB_LVDS_LFP_DATA);
> +	lvds_lfp_data = find_section(i915, bdb, BDB_LVDS_LFP_DATA,
> +				     sizeof(*lvds_lfp_data));
>  	if (!lvds_lfp_data)
>  		return;
>  
> -	lvds_lfp_data_ptrs = find_section(bdb, BDB_LVDS_LFP_DATA_PTRS);
> +	lvds_lfp_data_ptrs = find_section(i915, bdb, BDB_LVDS_LFP_DATA_PTRS,
> +					  sizeof(*lvds_lfp_data_ptrs));
>  	if (!lvds_lfp_data_ptrs)
>  		return;
>  
> @@ -333,7 +397,8 @@ parse_generic_dtd(struct drm_i915_private *i915,
>  	struct drm_display_mode *panel_fixed_mode;
>  	int num_dtd;
>  
> -	generic_dtd = find_section(bdb, BDB_GENERIC_DTD);
> +	generic_dtd = find_section(i915, bdb, BDB_GENERIC_DTD,
> +				   sizeof(*generic_dtd));
>  	if (!generic_dtd)
>  		return;
>  
> @@ -430,7 +495,8 @@ parse_lfp_backlight(struct drm_i915_private *i915,
>  	int panel_type = i915->vbt.panel_type;
>  	u16 level;
>  
> -	backlight_data = find_section(bdb, BDB_LVDS_BACKLIGHT);
> +	backlight_data = find_section(i915, bdb, BDB_LVDS_BACKLIGHT,
> +				      sizeof(*backlight_data));
>  	if (!backlight_data)
>  		return;
>  
> @@ -531,14 +597,16 @@ parse_sdvo_panel_data(struct drm_i915_private *i915,
>  	if (index == -1) {
>  		const struct bdb_sdvo_lvds_options *sdvo_lvds_options;
>  
> -		sdvo_lvds_options = find_section(bdb, BDB_SDVO_LVDS_OPTIONS);
> +		sdvo_lvds_options = find_section(i915, bdb, BDB_SDVO_LVDS_OPTIONS,
> +						 sizeof(*sdvo_lvds_options));
>  		if (!sdvo_lvds_options)
>  			return;
>  
>  		index = sdvo_lvds_options->panel_type;
>  	}
>  
> -	dtds = find_section(bdb, BDB_SDVO_PANEL_DTDS);
> +	dtds = find_section(i915, bdb, BDB_SDVO_PANEL_DTDS,
> +			    sizeof(*dtds));
>  	if (!dtds)
>  		return;
>  
> @@ -575,7 +643,8 @@ parse_general_features(struct drm_i915_private *i915,
>  {
>  	const struct bdb_general_features *general;
>  
> -	general = find_section(bdb, BDB_GENERAL_FEATURES);
> +	general = find_section(i915, bdb, BDB_GENERAL_FEATURES,
> +			       sizeof(*general));
>  	if (!general)
>  		return;
>  
> @@ -700,7 +769,8 @@ parse_driver_features(struct drm_i915_private *i915,
>  {
>  	const struct bdb_driver_features *driver;
>  
> -	driver = find_section(bdb, BDB_DRIVER_FEATURES);
> +	driver = find_section(i915, bdb, BDB_DRIVER_FEATURES,
> +			      sizeof(*driver));
>  	if (!driver)
>  		return;
>  
> @@ -756,7 +826,8 @@ parse_power_conservation_features(struct drm_i915_private *i915,
>  	if (bdb->version < 228)
>  		return;
>  
> -	power = find_section(bdb, BDB_LFP_POWER);
> +	power = find_section(i915, bdb, BDB_LFP_POWER,
> +			     sizeof(*power));
>  	if (!power)
>  		return;
>  
> @@ -783,7 +854,8 @@ parse_edp(struct drm_i915_private *i915, const struct bdb_header *bdb)
>  	const struct edp_fast_link_params *edp_link_params;
>  	int panel_type = i915->vbt.panel_type;
>  
> -	edp = find_section(bdb, BDB_EDP);
> +	edp = find_section(i915, bdb, BDB_EDP,
> +			   sizeof(*edp));
>  	if (!edp)
>  		return;
>  
> @@ -900,7 +972,8 @@ parse_psr(struct drm_i915_private *i915, const struct bdb_header *bdb)
>  	const struct psr_table *psr_table;
>  	int panel_type = i915->vbt.panel_type;
>  
> -	psr = find_section(bdb, BDB_PSR);
> +	psr = find_section(i915, bdb, BDB_PSR,
> +			   sizeof(*psr));
>  	if (!psr) {
>  		drm_dbg_kms(&i915->drm, "No PSR BDB found.\n");
>  		return;
> @@ -1058,7 +1131,8 @@ parse_mipi_config(struct drm_i915_private *i915,
>  	/* Parse #52 for panel index used from panel_type already
>  	 * parsed
>  	 */
> -	start = find_section(bdb, BDB_MIPI_CONFIG);
> +	start = find_section(i915, bdb, BDB_MIPI_CONFIG,
> +			     sizeof(*start));
>  	if (!start) {
>  		drm_dbg_kms(&i915->drm, "No MIPI config BDB found");
>  		return;
> @@ -1368,7 +1442,8 @@ parse_mipi_sequence(struct drm_i915_private *i915,
>  	if (i915->vbt.dsi.panel_id != MIPI_DSI_GENERIC_PANEL_ID)
>  		return;
>  
> -	sequence = find_section(bdb, BDB_MIPI_SEQUENCE);
> +	sequence = find_section(i915, bdb, BDB_MIPI_SEQUENCE,
> +				sizeof(*sequence));
>  	if (!sequence) {
>  		drm_dbg_kms(&i915->drm,
>  			    "No MIPI Sequence found, parsing complete\n");
> @@ -1451,7 +1526,8 @@ parse_compression_parameters(struct drm_i915_private *i915,
>  	if (bdb->version < 198)
>  		return;
>  
> -	params = find_section(bdb, BDB_COMPRESSION_PARAMETERS);
> +	params = find_section(i915, bdb, BDB_COMPRESSION_PARAMETERS,
> +			      sizeof(*params));
>  	if (params) {
>  		/* Sanity checks */
>  		if (params->entry_size != sizeof(params->data[0])) {
> @@ -2097,7 +2173,8 @@ parse_general_definitions(struct drm_i915_private *i915,
>  	u16 block_size;
>  	int bus_pin;
>  
> -	defs = find_section(bdb, BDB_GENERAL_DEFINITIONS);
> +	defs = find_section(i915, bdb, BDB_GENERAL_DEFINITIONS,
> +			    sizeof(*defs));
>  	if (!defs) {
>  		drm_dbg_kms(&i915->drm,
>  			    "No general definition block is found, no devices defined.\n");
> @@ -2466,6 +2543,7 @@ void intel_bios_init(struct drm_i915_private *i915)
>  	const struct bdb_header *bdb;
>  
>  	INIT_LIST_HEAD(&i915->vbt.display_devices);
> +	INIT_LIST_HEAD(&i915->vbt.bdb_blocks);
>  
>  	if (!HAS_DISPLAY(i915)) {
>  		drm_dbg_kms(&i915->drm,
> @@ -2536,14 +2614,20 @@ void intel_bios_init(struct drm_i915_private *i915)
>   */
>  void intel_bios_driver_remove(struct drm_i915_private *i915)
>  {
> -	struct intel_bios_encoder_data *devdata, *n;
> +	struct intel_bios_encoder_data *devdata, *nd;
> +	struct bdb_block_entry *entry, *ne;
>  
> -	list_for_each_entry_safe(devdata, n, &i915->vbt.display_devices, node) {
> +	list_for_each_entry_safe(devdata, nd, &i915->vbt.display_devices, node) {
>  		list_del(&devdata->node);
>  		kfree(devdata->dsc);
>  		kfree(devdata);
>  	}
>  
> +	list_for_each_entry_safe(entry, ne, &i915->vbt.bdb_blocks, node) {
> +		list_del(&entry->node);
> +		kfree(entry);
> +	}
> +
>  	kfree(i915->vbt.sdvo_lvds_vbt_mode);
>  	i915->vbt.sdvo_lvds_vbt_mode = NULL;
>  	kfree(i915->vbt.lfp_lvds_vbt_mode);
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index a9aceb08fcd1..0f52ce62281e 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -382,6 +382,7 @@ struct intel_vbt_data {
>  	int crt_ddc_pin;
>  
>  	struct list_head display_devices;
> +	struct list_head bdb_blocks;
>  
>  	struct intel_bios_encoder_data *ports[I915_MAX_PORTS]; /* Non-NULL if port present. */
>  	struct sdvo_device_mapping sdvo_mappings[2];

-- 
Jani Nikula, Intel Open Source Graphics Center

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

* Re: [Intel-gfx] [PATCH 03/11] drm/i915/bios: Use the copy of the LFP data table always
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 03/11] drm/i915/bios: Use the copy of the LFP data table always Ville Syrjala
@ 2022-03-17 19:10   ` Jani Nikula
  2022-03-17 20:04     ` Ville Syrjälä
  2022-03-17 20:21   ` [Intel-gfx] [PATCH v2 " Ville Syrjala
  1 sibling, 1 reply; 33+ messages in thread
From: Jani Nikula @ 2022-03-17 19:10 UTC (permalink / raw)
  To: Ville Syrjala, intel-gfx

On Thu, 17 Mar 2022, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Currently get_lvds_fp_timing() still returns a pointer to the original
> data block rather than our copy. Let's convert the data pointer offsets
> to be relative to the data block rather than the whole BDB. With that
> we can make get_lvds_fp_timing() return a pointer to the copy.

Ugh, so just as I R-b'd the previous patch... I realize it's all broken
without this, right? It does pointer arithmetics between bdb header and
the allocated bdb for ptrs?

Do we want a broken step?

BR,
Jani.

>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_bios.c | 56 ++++++++++++++++++++---
>  1 file changed, 49 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
> index ff04514eb3b7..777339f5dd79 100644
> --- a/drivers/gpu/drm/i915/display/intel_bios.c
> +++ b/drivers/gpu/drm/i915/display/intel_bios.c
> @@ -138,6 +138,44 @@ find_raw_section(const void *_bdb, enum bdb_block_id section_id)
>  	return NULL;
>  }
>  
> +/*
> + * Offset from the start of BDB to the start of the
> + * block data (just past the block header).
> + */
> +static u32 block_offset(const void *bdb, enum bdb_block_id section_id)
> +{
> +	const void *block;
> +
> +	block = find_raw_section(bdb, section_id);
> +	if (!block)
> +		return 0;
> +
> +	return block - bdb;
> +}
> +
> +/* make the data table offsets relative to the data block */
> +static bool fixup_lfp_data_ptrs(const void *bdb, void *ptrs_block)
> +{
> +	struct bdb_lvds_lfp_data_ptrs *ptrs = ptrs_block;
> +	u32 offset;
> +	int i;
> +
> +	offset = block_offset(bdb, BDB_LVDS_LFP_DATA);
> +
> +	for (i = 0; i < 16; i++) {
> +		if (ptrs->ptr[i].fp_timing.offset < offset ||
> +		    ptrs->ptr[i].dvo_timing.offset < offset ||
> +		    ptrs->ptr[i].panel_pnp_id.offset < offset)
> +			return false;
> +
> +		ptrs->ptr[i].fp_timing.offset -= offset;
> +		ptrs->ptr[i].dvo_timing.offset -= offset;
> +		ptrs->ptr[i].panel_pnp_id.offset -= offset;
> +	}
> +
> +	return true;
> +}
> +
>  static const void *
>  find_section(struct drm_i915_private *i915,
>  	     const void *bdb, enum bdb_block_id section_id,
> @@ -174,6 +212,13 @@ find_section(struct drm_i915_private *i915,
>  	drm_dbg_kms(&i915->drm, "Found BDB block %d (size %zu, min size %zu)\n",
>  		    section_id, block_size, min_size);
>  
> +	if (section_id == BDB_LVDS_LFP_DATA_PTRS &&
> +	    !fixup_lfp_data_ptrs(bdb, entry->data + 3)) {
> +		drm_err(&i915->drm, "VBT has malformed LFP data table pointers\n");
> +		kfree(entry);
> +		return NULL;
> +	}
> +
>  	list_add(&entry->node, &i915->vbt.bdb_blocks);
>  
>  	return entry->data + 3;
> @@ -255,22 +300,19 @@ get_lvds_dvo_timing(const struct bdb_lvds_lfp_data *lvds_lfp_data,
>   * this function may return NULL if the corresponding entry is invalid
>   */
>  static const struct lvds_fp_timing *
> -get_lvds_fp_timing(const struct bdb_header *bdb,
> -		   const struct bdb_lvds_lfp_data *data,
> +get_lvds_fp_timing(const struct bdb_lvds_lfp_data *data,
>  		   const struct bdb_lvds_lfp_data_ptrs *ptrs,
>  		   int index)
>  {
> -	size_t data_ofs = (const u8 *)data - (const u8 *)bdb;
>  	u16 data_size = ((const u16 *)data)[-1]; /* stored in header */
>  	size_t ofs;
>  
>  	if (index >= ARRAY_SIZE(ptrs->ptr))
>  		return NULL;
>  	ofs = ptrs->ptr[index].fp_timing.offset;
> -	if (ofs < data_ofs ||
> -	    ofs + sizeof(struct lvds_fp_timing) > data_ofs + data_size)
> +	if (ofs + sizeof(struct lvds_fp_timing) > data_size)
>  		return NULL;
> -	return (const struct lvds_fp_timing *)((const u8 *)bdb + ofs);
> +	return (const struct lvds_fp_timing *)((const u8 *)data + ofs);
>  }
>  
>  /* Parse general panel options */
> @@ -373,7 +415,7 @@ parse_lfp_panel_dtd(struct drm_i915_private *i915,
>  		    "Found panel mode in BIOS VBT legacy lfp table:\n");
>  	drm_mode_debug_printmodeline(panel_fixed_mode);
>  
> -	fp_timing = get_lvds_fp_timing(bdb, lvds_lfp_data,
> +	fp_timing = get_lvds_fp_timing(lvds_lfp_data,
>  				       lvds_lfp_data_ptrs,
>  				       panel_type);
>  	if (fp_timing) {

-- 
Jani Nikula, Intel Open Source Graphics Center

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

* Re: [Intel-gfx] [PATCH 03/11] drm/i915/bios: Use the copy of the LFP data table always
  2022-03-17 19:10   ` Jani Nikula
@ 2022-03-17 20:04     ` Ville Syrjälä
  2022-03-17 20:08       ` Ville Syrjälä
  0 siblings, 1 reply; 33+ messages in thread
From: Ville Syrjälä @ 2022-03-17 20:04 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

On Thu, Mar 17, 2022 at 09:10:37PM +0200, Jani Nikula wrote:
> On Thu, 17 Mar 2022, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Currently get_lvds_fp_timing() still returns a pointer to the original
> > data block rather than our copy. Let's convert the data pointer offsets
> > to be relative to the data block rather than the whole BDB. With that
> > we can make get_lvds_fp_timing() return a pointer to the copy.
> 
> Ugh, so just as I R-b'd the previous patch... I realize it's all broken
> without this, right? It does pointer arithmetics between bdb header and
> the allocated bdb for ptrs?
> 
> Do we want a broken step?

Probably not. Somehow I convinced myself that the artihmetic was being
done between the original block and bdb header. So now I need to figure
out how to get out of this mess, I guess ideally without having to just
squash the two patches together...

-- 
Ville Syrjälä
Intel

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

* Re: [Intel-gfx] [PATCH 03/11] drm/i915/bios: Use the copy of the LFP data table always
  2022-03-17 20:04     ` Ville Syrjälä
@ 2022-03-17 20:08       ` Ville Syrjälä
  0 siblings, 0 replies; 33+ messages in thread
From: Ville Syrjälä @ 2022-03-17 20:08 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

On Thu, Mar 17, 2022 at 10:04:13PM +0200, Ville Syrjälä wrote:
> On Thu, Mar 17, 2022 at 09:10:37PM +0200, Jani Nikula wrote:
> > On Thu, 17 Mar 2022, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > >
> > > Currently get_lvds_fp_timing() still returns a pointer to the original
> > > data block rather than our copy. Let's convert the data pointer offsets
> > > to be relative to the data block rather than the whole BDB. With that
> > > we can make get_lvds_fp_timing() return a pointer to the copy.
> > 
> > Ugh, so just as I R-b'd the previous patch... I realize it's all broken
> > without this, right? It does pointer arithmetics between bdb header and
> > the allocated bdb for ptrs?
> > 
> > Do we want a broken step?
> 
> Probably not. Somehow I convinced myself that the artihmetic was being
> done between the original block and bdb header. So now I need to figure
> out how to get out of this mess, I guess ideally without having to just
> squash the two patches together...

I guess I could suck block_offset() from this patch into the previous
patch and call it temporarily straight from get_lvds_fp_timing().

-- 
Ville Syrjälä
Intel

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

* [Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915/bios: Rework BDB block handling
  2022-03-17 17:19 [Intel-gfx] [PATCH 00/11] drm/i915/bios: Rework BDB block handling Ville Syrjala
                   ` (13 preceding siblings ...)
  2022-03-17 18:17 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
@ 2022-03-17 20:20 ` Patchwork
  2022-03-17 22:16 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/bios: Rework BDB block handling (rev3) Patchwork
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 33+ messages in thread
From: Patchwork @ 2022-03-17 20:20 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx

[-- Attachment #1: Type: text/plain, Size: 30264 bytes --]

== Series Details ==

Series: drm/i915/bios: Rework BDB block handling
URL   : https://patchwork.freedesktop.org/series/101496/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_11376_full -> Patchwork_22595_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  

Participating hosts (11 -> 12)
------------------------------

  Additional (1): shard-rkl 

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in Patchwork_22595_full:

### IGT changes ###

#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@runner@aborted:
    - {shard-rkl}:        NOTRUN -> ([FAIL][1], [FAIL][2], [FAIL][3], [FAIL][4], [FAIL][5], [FAIL][6], [FAIL][7], [FAIL][8], [FAIL][9], [FAIL][10], [FAIL][11], [FAIL][12], [FAIL][13], [FAIL][14], [FAIL][15], [FAIL][16], [FAIL][17], [FAIL][18], [FAIL][19], [FAIL][20], [FAIL][21])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-rkl-1/igt@runner@aborted.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-rkl-1/igt@runner@aborted.html
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-rkl-5/igt@runner@aborted.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-rkl-5/igt@runner@aborted.html
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-rkl-5/igt@runner@aborted.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-rkl-1/igt@runner@aborted.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-rkl-5/igt@runner@aborted.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-rkl-6/igt@runner@aborted.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-rkl-2/igt@runner@aborted.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-rkl-1/igt@runner@aborted.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-rkl-6/igt@runner@aborted.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-rkl-6/igt@runner@aborted.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-rkl-4/igt@runner@aborted.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-rkl-2/igt@runner@aborted.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-rkl-6/igt@runner@aborted.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-rkl-5/igt@runner@aborted.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-rkl-2/igt@runner@aborted.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-rkl-2/igt@runner@aborted.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-rkl-2/igt@runner@aborted.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-rkl-2/igt@runner@aborted.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-rkl-1/igt@runner@aborted.html

  
Known issues
------------

  Here are the changes found in Patchwork_22595_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_create@create-massive:
    - shard-kbl:          NOTRUN -> [DMESG-WARN][22] ([i915#4991])
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-kbl1/igt@gem_create@create-massive.html

  * igt@gem_exec_balancer@parallel-contexts:
    - shard-kbl:          NOTRUN -> [DMESG-WARN][23] ([i915#5076])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-kbl4/igt@gem_exec_balancer@parallel-contexts.html

  * igt@gem_exec_balancer@parallel-ordering:
    - shard-kbl:          NOTRUN -> [DMESG-FAIL][24] ([i915#5076])
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-kbl1/igt@gem_exec_balancer@parallel-ordering.html

  * igt@gem_exec_fair@basic-none@vcs0:
    - shard-kbl:          [PASS][25] -> [FAIL][26] ([i915#2842]) +1 similar issue
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-kbl1/igt@gem_exec_fair@basic-none@vcs0.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-kbl6/igt@gem_exec_fair@basic-none@vcs0.html

  * igt@gem_exec_fair@basic-none@vecs0:
    - shard-apl:          [PASS][27] -> [FAIL][28] ([i915#2842])
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-apl4/igt@gem_exec_fair@basic-none@vecs0.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-apl6/igt@gem_exec_fair@basic-none@vecs0.html

  * igt@gem_pwrite@basic-exhaustion:
    - shard-apl:          NOTRUN -> [WARN][29] ([i915#2658])
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-apl2/igt@gem_pwrite@basic-exhaustion.html

  * igt@gem_pxp@reject-modify-context-protection-off-2:
    - shard-iclb:         NOTRUN -> [SKIP][30] ([i915#4270])
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-iclb3/igt@gem_pxp@reject-modify-context-protection-off-2.html

  * igt@gen7_exec_parse@basic-offset:
    - shard-skl:          NOTRUN -> [SKIP][31] ([fdo#109271]) +65 similar issues
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-skl1/igt@gen7_exec_parse@basic-offset.html

  * igt@gen9_exec_parse@allowed-all:
    - shard-glk:          [PASS][32] -> [DMESG-WARN][33] ([i915#1436] / [i915#716])
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-glk2/igt@gen9_exec_parse@allowed-all.html
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-glk9/igt@gen9_exec_parse@allowed-all.html

  * igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-dp:
    - shard-apl:          NOTRUN -> [SKIP][34] ([fdo#109271] / [i915#1937])
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-apl2/igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-dp.html

  * igt@i915_suspend@forcewake:
    - shard-kbl:          [PASS][35] -> [DMESG-WARN][36] ([i915#180])
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-kbl1/igt@i915_suspend@forcewake.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-kbl7/igt@i915_suspend@forcewake.html

  * igt@kms_async_flips@alternate-sync-async-flip:
    - shard-skl:          NOTRUN -> [FAIL][37] ([i915#2521])
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-skl1/igt@kms_async_flips@alternate-sync-async-flip.html

  * igt@kms_big_fb@4-tiled-32bpp-rotate-270:
    - shard-iclb:         NOTRUN -> [SKIP][38] ([i915#5286])
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-iclb2/igt@kms_big_fb@4-tiled-32bpp-rotate-270.html

  * igt@kms_big_fb@x-tiled-max-hw-stride-32bpp-rotate-180-hflip-async-flip:
    - shard-apl:          NOTRUN -> [SKIP][39] ([fdo#109271] / [i915#3777]) +1 similar issue
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-apl6/igt@kms_big_fb@x-tiled-max-hw-stride-32bpp-rotate-180-hflip-async-flip.html

  * igt@kms_big_fb@y-tiled-max-hw-stride-64bpp-rotate-180-hflip:
    - shard-skl:          NOTRUN -> [SKIP][40] ([fdo#109271] / [i915#3777])
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-skl1/igt@kms_big_fb@y-tiled-max-hw-stride-64bpp-rotate-180-hflip.html

  * igt@kms_big_fb@yf-tiled-max-hw-stride-32bpp-rotate-180-async-flip:
    - shard-skl:          NOTRUN -> [FAIL][41] ([i915#3743])
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-skl1/igt@kms_big_fb@yf-tiled-max-hw-stride-32bpp-rotate-180-async-flip.html

  * igt@kms_big_fb@yf-tiled-max-hw-stride-32bpp-rotate-180-hflip-async-flip:
    - shard-kbl:          NOTRUN -> [SKIP][42] ([fdo#109271] / [i915#3777]) +1 similar issue
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-kbl1/igt@kms_big_fb@yf-tiled-max-hw-stride-32bpp-rotate-180-hflip-async-flip.html

  * igt@kms_ccs@pipe-a-bad-aux-stride-y_tiled_gen12_rc_ccs_cc:
    - shard-kbl:          NOTRUN -> [SKIP][43] ([fdo#109271] / [i915#3886])
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-kbl4/igt@kms_ccs@pipe-a-bad-aux-stride-y_tiled_gen12_rc_ccs_cc.html

  * igt@kms_ccs@pipe-b-crc-primary-basic-y_tiled_gen12_rc_ccs_cc:
    - shard-skl:          NOTRUN -> [SKIP][44] ([fdo#109271] / [i915#3886]) +2 similar issues
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-skl1/igt@kms_ccs@pipe-b-crc-primary-basic-y_tiled_gen12_rc_ccs_cc.html

  * igt@kms_ccs@pipe-c-ccs-on-another-bo-y_tiled_gen12_rc_ccs_cc:
    - shard-apl:          NOTRUN -> [SKIP][45] ([fdo#109271] / [i915#3886]) +7 similar issues
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-apl3/igt@kms_ccs@pipe-c-ccs-on-another-bo-y_tiled_gen12_rc_ccs_cc.html

  * igt@kms_cdclk@mode-transition:
    - shard-apl:          NOTRUN -> [SKIP][46] ([fdo#109271]) +133 similar issues
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-apl2/igt@kms_cdclk@mode-transition.html

  * igt@kms_chamelium@hdmi-hpd-enable-disable-mode:
    - shard-iclb:         NOTRUN -> [SKIP][47] ([fdo#109284] / [fdo#111827])
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-iclb3/igt@kms_chamelium@hdmi-hpd-enable-disable-mode.html

  * igt@kms_chamelium@hdmi-hpd-storm-disable:
    - shard-skl:          NOTRUN -> [SKIP][48] ([fdo#109271] / [fdo#111827]) +4 similar issues
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-skl1/igt@kms_chamelium@hdmi-hpd-storm-disable.html

  * igt@kms_chamelium@vga-edid-read:
    - shard-apl:          NOTRUN -> [SKIP][49] ([fdo#109271] / [fdo#111827]) +8 similar issues
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-apl3/igt@kms_chamelium@vga-edid-read.html

  * igt@kms_color_chamelium@pipe-b-ctm-0-75:
    - shard-kbl:          NOTRUN -> [SKIP][50] ([fdo#109271] / [fdo#111827]) +4 similar issues
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-kbl4/igt@kms_color_chamelium@pipe-b-ctm-0-75.html

  * igt@kms_content_protection@uevent:
    - shard-apl:          NOTRUN -> [FAIL][51] ([i915#2105])
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-apl3/igt@kms_content_protection@uevent.html

  * igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions:
    - shard-skl:          [PASS][52] -> [FAIL][53] ([i915#2346])
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-skl9/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-skl9/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html

  * igt@kms_cursor_legacy@pipe-d-single-bo:
    - shard-kbl:          NOTRUN -> [SKIP][54] ([fdo#109271] / [i915#533]) +1 similar issue
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-kbl4/igt@kms_cursor_legacy@pipe-d-single-bo.html

  * igt@kms_flip@flip-vs-expired-vblank-interruptible@c-hdmi-a1:
    - shard-glk:          [PASS][55] -> [FAIL][56] ([i915#79])
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-glk2/igt@kms_flip@flip-vs-expired-vblank-interruptible@c-hdmi-a1.html
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-glk4/igt@kms_flip@flip-vs-expired-vblank-interruptible@c-hdmi-a1.html

  * igt@kms_flip@flip-vs-suspend@a-dp1:
    - shard-apl:          [PASS][57] -> [DMESG-WARN][58] ([i915#180]) +2 similar issues
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-apl8/igt@kms_flip@flip-vs-suspend@a-dp1.html
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-apl8/igt@kms_flip@flip-vs-suspend@a-dp1.html

  * igt@kms_flip@plain-flip-ts-check@b-edp1:
    - shard-skl:          [PASS][59] -> [FAIL][60] ([i915#2122])
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-skl6/igt@kms_flip@plain-flip-ts-check@b-edp1.html
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-skl2/igt@kms_flip@plain-flip-ts-check@b-edp1.html

  * igt@kms_frontbuffer_tracking@fbc-2p-primscrn-indfb-plflip-blt:
    - shard-iclb:         NOTRUN -> [SKIP][61] ([fdo#109280]) +1 similar issue
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-iclb3/igt@kms_frontbuffer_tracking@fbc-2p-primscrn-indfb-plflip-blt.html

  * igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-cur-indfb-draw-blt:
    - shard-kbl:          NOTRUN -> [SKIP][62] ([fdo#109271]) +66 similar issues
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-kbl4/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-cur-indfb-draw-blt.html

  * igt@kms_hdr@bpc-switch-dpms@bpc-switch-dpms-edp-1-pipe-a:
    - shard-skl:          NOTRUN -> [FAIL][63] ([i915#1188])
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-skl1/igt@kms_hdr@bpc-switch-dpms@bpc-switch-dpms-edp-1-pipe-a.html

  * igt@kms_pipe_crc_basic@read-crc-pipe-d:
    - shard-iclb:         NOTRUN -> [SKIP][64] ([fdo#109278])
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-iclb5/igt@kms_pipe_crc_basic@read-crc-pipe-d.html

  * igt@kms_plane_alpha_blend@pipe-a-coverage-7efc:
    - shard-skl:          [PASS][65] -> [FAIL][66] ([fdo#108145] / [i915#265])
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-skl10/igt@kms_plane_alpha_blend@pipe-a-coverage-7efc.html
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-skl1/igt@kms_plane_alpha_blend@pipe-a-coverage-7efc.html

  * igt@kms_plane_alpha_blend@pipe-b-alpha-opaque-fb:
    - shard-skl:          NOTRUN -> [FAIL][67] ([fdo#108145] / [i915#265]) +1 similar issue
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-skl1/igt@kms_plane_alpha_blend@pipe-b-alpha-opaque-fb.html

  * igt@kms_plane_alpha_blend@pipe-c-alpha-basic:
    - shard-apl:          NOTRUN -> [FAIL][68] ([fdo#108145] / [i915#265]) +1 similar issue
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-apl3/igt@kms_plane_alpha_blend@pipe-c-alpha-basic.html

  * igt@kms_plane_alpha_blend@pipe-c-constant-alpha-max:
    - shard-kbl:          NOTRUN -> [FAIL][69] ([fdo#108145] / [i915#265])
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-kbl7/igt@kms_plane_alpha_blend@pipe-c-constant-alpha-max.html

  * igt@kms_prime@basic-crc@first-to-second:
    - shard-iclb:         NOTRUN -> [SKIP][70] ([i915#1836])
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-iclb3/igt@kms_prime@basic-crc@first-to-second.html

  * igt@kms_psr2_sf@cursor-plane-update-sf:
    - shard-skl:          NOTRUN -> [SKIP][71] ([fdo#109271] / [i915#658]) +1 similar issue
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-skl7/igt@kms_psr2_sf@cursor-plane-update-sf.html

  * igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area:
    - shard-kbl:          NOTRUN -> [SKIP][72] ([fdo#109271] / [i915#658]) +1 similar issue
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-kbl4/igt@kms_psr2_sf@overlay-plane-update-sf-dmg-area.html

  * igt@kms_psr@psr2_primary_page_flip:
    - shard-iclb:         [PASS][73] -> [SKIP][74] ([fdo#109441]) +2 similar issues
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-iclb2/igt@kms_psr@psr2_primary_page_flip.html
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-iclb7/igt@kms_psr@psr2_primary_page_flip.html

  * igt@sysfs_clients@pidname:
    - shard-apl:          NOTRUN -> [SKIP][75] ([fdo#109271] / [i915#2994]) +1 similar issue
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-apl6/igt@sysfs_clients@pidname.html

  * igt@sysfs_clients@sema-10:
    - shard-skl:          NOTRUN -> [SKIP][76] ([fdo#109271] / [i915#2994])
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-skl1/igt@sysfs_clients@sema-10.html

  
#### Possible fixes ####

  * igt@gem_exec_capture@pi@vcs0:
    - shard-skl:          [INCOMPLETE][77] ([i915#4547]) -> [PASS][78]
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-skl9/igt@gem_exec_capture@pi@vcs0.html
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-skl9/igt@gem_exec_capture@pi@vcs0.html

  * igt@gem_exec_fair@basic-none-vip@rcs0:
    - shard-kbl:          [FAIL][79] ([i915#2842]) -> [PASS][80] +2 similar issues
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-kbl1/igt@gem_exec_fair@basic-none-vip@rcs0.html
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-kbl3/igt@gem_exec_fair@basic-none-vip@rcs0.html

  * igt@gem_exec_fair@basic-none@vcs0:
    - shard-apl:          [FAIL][81] ([i915#2842]) -> [PASS][82]
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-apl4/igt@gem_exec_fair@basic-none@vcs0.html
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-apl6/igt@gem_exec_fair@basic-none@vcs0.html

  * igt@gem_exec_fair@basic-throttle@rcs0:
    - shard-iclb:         [FAIL][83] ([i915#2849]) -> [PASS][84]
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-iclb1/igt@gem_exec_fair@basic-throttle@rcs0.html
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-iclb1/igt@gem_exec_fair@basic-throttle@rcs0.html

  * igt@gem_workarounds@suspend-resume-context:
    - shard-apl:          [DMESG-WARN][85] ([i915#180]) -> [PASS][86] +2 similar issues
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-apl7/igt@gem_workarounds@suspend-resume-context.html
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-apl2/igt@gem_workarounds@suspend-resume-context.html

  * igt@i915_pm_dc@dc6-dpms:
    - shard-iclb:         [FAIL][87] ([i915#454]) -> [PASS][88]
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-iclb1/igt@i915_pm_dc@dc6-dpms.html
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-iclb1/igt@i915_pm_dc@dc6-dpms.html

  * igt@kms_flip@flip-vs-suspend@c-dp1:
    - shard-kbl:          [DMESG-WARN][89] ([i915#180]) -> [PASS][90] +6 similar issues
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-kbl4/igt@kms_flip@flip-vs-suspend@c-dp1.html
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-kbl1/igt@kms_flip@flip-vs-suspend@c-dp1.html

  * igt@kms_hdr@bpc-switch@bpc-switch-edp-1-pipe-a:
    - shard-skl:          [FAIL][91] ([i915#1188]) -> [PASS][92]
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-skl2/igt@kms_hdr@bpc-switch@bpc-switch-edp-1-pipe-a.html
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-skl3/igt@kms_hdr@bpc-switch@bpc-switch-edp-1-pipe-a.html

  * igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
    - shard-skl:          [FAIL][93] ([fdo#108145] / [i915#265]) -> [PASS][94]
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-skl6/igt@kms_plane_alpha_blend@pipe-c-coverage-7efc.html
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-skl7/igt@kms_plane_alpha_blend@pipe-c-coverage-7efc.html

  * igt@kms_plane_cursor@pipe-b-overlay-size-128:
    - shard-iclb:         [FAIL][95] ([i915#1888]) -> [PASS][96]
   [95]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-iclb7/igt@kms_plane_cursor@pipe-b-overlay-size-128.html
   [96]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-iclb6/igt@kms_plane_cursor@pipe-b-overlay-size-128.html

  * igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-b-edp-1-scaler-with-clipping-clamping:
    - shard-iclb:         [SKIP][97] ([i915#5176]) -> [PASS][98] +1 similar issue
   [97]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-iclb3/igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-b-edp-1-scaler-with-clipping-clamping.html
   [98]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-iclb8/igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-b-edp-1-scaler-with-clipping-clamping.html

  * igt@kms_psr@psr2_primary_mmap_gtt:
    - shard-iclb:         [SKIP][99] ([fdo#109441]) -> [PASS][100]
   [99]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-iclb4/igt@kms_psr@psr2_primary_mmap_gtt.html
   [100]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-iclb2/igt@kms_psr@psr2_primary_mmap_gtt.html

  
#### Warnings ####

  * igt@gem_exec_balancer@parallel-contexts:
    - shard-iclb:         [SKIP][101] ([i915#4525]) -> [DMESG-WARN][102] ([i915#5076]) +1 similar issue
   [101]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-iclb3/igt@gem_exec_balancer@parallel-contexts.html
   [102]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-iclb4/igt@gem_exec_balancer@parallel-contexts.html

  * igt@gem_exec_balancer@parallel-ordering:
    - shard-iclb:         [DMESG-FAIL][103] ([i915#5076]) -> [SKIP][104] ([i915#4525])
   [103]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-iclb1/igt@gem_exec_balancer@parallel-ordering.html
   [104]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-iclb3/igt@gem_exec_balancer@parallel-ordering.html

  * igt@i915_pm_rc6_residency@rc6-idle:
    - shard-iclb:         [WARN][105] ([i915#2684]) -> [WARN][106] ([i915#1804] / [i915#2684])
   [105]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-iclb5/igt@i915_pm_rc6_residency@rc6-idle.html
   [106]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-iclb7/igt@i915_pm_rc6_residency@rc6-idle.html

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-indfb-msflip-blt:
    - shard-skl:          [INCOMPLETE][107] -> [SKIP][108] ([fdo#109271])
   [107]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-skl2/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-indfb-msflip-blt.html
   [108]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-skl3/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-indfb-msflip-blt.html

  * igt@kms_psr2_sf@overlay-plane-update-continuous-sf:
    - shard-iclb:         [SKIP][109] ([fdo#111068] / [i915#658]) -> [SKIP][110] ([i915#2920])
   [109]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-iclb8/igt@kms_psr2_sf@overlay-plane-update-continuous-sf.html
   [110]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-iclb2/igt@kms_psr2_sf@overlay-plane-update-continuous-sf.html

  * igt@runner@aborted:
    - shard-apl:          ([FAIL][111], [FAIL][112], [FAIL][113], [FAIL][114], [FAIL][115], [FAIL][116], [FAIL][117]) ([fdo#109271] / [i915#180] / [i915#1814] / [i915#3002] / [i915#4312] / [i915#5257]) -> ([FAIL][118], [FAIL][119], [FAIL][120], [FAIL][121], [FAIL][122], [FAIL][123]) ([i915#180] / [i915#3002] / [i915#4312] / [i915#5257])
   [111]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-apl6/igt@runner@aborted.html
   [112]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-apl4/igt@runner@aborted.html
   [113]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-apl7/igt@runner@aborted.html
   [114]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-apl4/igt@runner@aborted.html
   [115]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-apl8/igt@runner@aborted.html
   [116]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-apl7/igt@runner@aborted.html
   [117]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-apl7/igt@runner@aborted.html
   [118]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-apl4/igt@runner@aborted.html
   [119]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-apl3/igt@runner@aborted.html
   [120]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-apl3/igt@runner@aborted.html
   [121]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-apl3/igt@runner@aborted.html
   [122]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-apl8/igt@runner@aborted.html
   [123]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-apl6/igt@runner@aborted.html
    - shard-tglb:         ([FAIL][124], [FAIL][125], [FAIL][126], [FAIL][127], [FAIL][128], [FAIL][129], [FAIL][130], [FAIL][131], [FAIL][132]) ([i915#3002] / [i915#4312] / [i915#5257]) -> ([FAIL][133], [FAIL][134], [FAIL][135], [FAIL][136], [FAIL][137], [FAIL][138], [FAIL][139], [FAIL][140], [FAIL][141], [FAIL][142], [FAIL][143], [FAIL][144], [FAIL][145], [FAIL][146], [FAIL][147], [FAIL][148], [FAIL][149], [FAIL][150], [FAIL][151], [FAIL][152], [FAIL][153], [FAIL][154], [FAIL][155], [FAIL][156], [FAIL][157]) ([i915#2426] / [i915#3690])
   [124]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-tglb8/igt@runner@aborted.html
   [125]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-tglb7/igt@runner@aborted.html
   [126]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-tglb2/igt@runner@aborted.html
   [127]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-tglb3/igt@runner@aborted.html
   [128]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-tglb1/igt@runner@aborted.html
   [129]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-tglb6/igt@runner@aborted.html
   [130]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-tglb6/igt@runner@aborted.html
   [131]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-tglb1/igt@runner@aborted.html
   [132]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-tglb2/igt@runner@aborted.html
   [133]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-tglb2/igt@runner@aborted.html
   [134]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-tglb2/igt@runner@aborted.html
   [135]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-tglb2/igt@runner@aborted.html
   [136]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-tglb5/igt@runner@aborted.html
   [137]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-tglb3/igt@runner@aborted.html
   [138]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-tglb3/igt@runner@aborted.html
   [139]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-tglb2/igt@runner@aborted.html
   [140]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-tglb5/igt@runner@aborted.html
   [141]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-tglb1/igt@runner@aborted.html
   [142]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-tglb1/igt@runner@aborted.html
   [143]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-tglb2/igt@runner@aborted.html
   [144]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-tglb3/igt@runner@aborted.html
   [145]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-tglb3/igt@runner@aborted.html
   [146]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-tglb5/igt@runner@aborted.html
   [147]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-tglb1/igt@runner@aborted.html
   [148]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-tglb3/igt@runner@aborted.html
   [149]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-tglb6/igt@runner@aborted.html
   [150]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-tglb8/igt@runner@aborted.html
   [151]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-tglb5/igt@runner@aborted.html
   [152]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-tglb6/igt@runner@aborted.html
   [153]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-tglb6/igt@runner@aborted.html
   [154]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-tglb8/igt@runner@aborted.html
   [155]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-tglb6/igt@runner@aborted.html
   [156]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-tglb7/igt@runner@aborted.html
   [157]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-tglb8/igt@runner@aborted.html
    - shard-skl:          ([FAIL][158], [FAIL][159], [FAIL][160], [FAIL][161], [FAIL][162]) ([i915#1814] / [i915#2029] / [i915#3002] / [i915#4312] / [i915#5257]) -> ([FAIL][163], [FAIL][164]) ([i915#3002] / [i915#4312] / [i915#5257])
   [158]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-skl10/igt@runner@aborted.html
   [159]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-skl3/igt@runner@aborted.html
   [160]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-skl3/igt@runner@aborted.html
   [161]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-skl4/igt@runner@aborted.html
   [162]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11376/shard-skl9/igt@runner@aborted.html
   [163]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-skl6/igt@runner@aborted.html
   [164]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/shard-skl4/igt@runner@aborted.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
  [fdo#109284]: https://bugs.freedesktop.org/show_bug.cgi?id=109284
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [i915#1188]: https://gitlab.freedesktop.org/drm/intel/issues/1188
  [i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
  [i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
  [i915#1804]: https://gitlab.freedesktop.org/drm/intel/issues/1804
  [i915#1814]: https://gitlab.freedesktop.org/drm/intel/issues/1814
  [i915#1836]: https://gitlab.freedesktop.org/drm/

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22595/index.html

[-- Attachment #2: Type: text/html, Size: 35064 bytes --]

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

* [Intel-gfx] [PATCH v2 02/11] drm/i915/bios: Make copies of VBT data blocks
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 02/11] drm/i915/bios: Make copies of VBT data blocks Ville Syrjala
  2022-03-17 19:02   ` Jani Nikula
@ 2022-03-17 20:21   ` Ville Syrjala
  1 sibling, 0 replies; 33+ messages in thread
From: Ville Syrjala @ 2022-03-17 20:21 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Make a copy of each VB data block with a guaranteed minimum
size. The extra (if any) will just be left zeroed.

This means we don't have to worry about going out of bounds
when accessing any of the structure members. Otherwise that
could easliy happen if we simply get the version check wrong,
or if the VBT is broken/malicious.

v2: Don't do arithmetic between bdb header and copy
    of the LFP data block (Jani)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_bios.c | 139 ++++++++++++++++++----
 drivers/gpu/drm/i915/i915_drv.h           |   1 +
 2 files changed, 120 insertions(+), 20 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index 31fce7c92a28..ffeaf7f6405f 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -87,8 +87,28 @@ static u32 get_blocksize(const void *block_data)
 	return _get_blocksize(block_data - 3);
 }
 
+struct bdb_block_entry {
+	struct list_head node;
+	size_t min_size;
+	enum bdb_block_id section_id;
+	u8 data[];
+};
+
+static struct bdb_block_entry *
+find_bdb_block(struct drm_i915_private *i915, enum bdb_block_id section_id)
+{
+	struct bdb_block_entry *entry;
+
+	list_for_each_entry(entry, &i915->vbt.bdb_blocks, node) {
+		if (entry->section_id == section_id)
+			return entry;
+	}
+
+	return NULL;
+}
+
 static const void *
-find_section(const void *_bdb, enum bdb_block_id section_id)
+find_raw_section(const void *_bdb, enum bdb_block_id section_id)
 {
 	const struct bdb_header *bdb = _bdb;
 	const u8 *base = _bdb;
@@ -118,6 +138,62 @@ find_section(const void *_bdb, enum bdb_block_id section_id)
 	return NULL;
 }
 
+/*
+ * Offset from the start of BDB to the start of the
+ * block data (just past the block header).
+ */
+static u32 block_offset(const void *bdb, enum bdb_block_id section_id)
+{
+	const void *block;
+
+	block = find_raw_section(bdb, section_id);
+	if (!block)
+		return 0;
+
+	return block - bdb;
+}
+
+static const void *
+find_section(struct drm_i915_private *i915,
+	     const void *bdb, enum bdb_block_id section_id,
+	     size_t min_size)
+{
+	struct bdb_block_entry *entry;
+	const void *block;
+	size_t block_size;
+
+	entry = find_bdb_block(i915, section_id);
+	if (entry) {
+		/* make sure all callers pass in a consistent min_size */
+		if (drm_WARN_ON(&i915->drm, entry->min_size != min_size))
+			return NULL;
+
+		return entry->data + 3;
+	}
+
+	block = find_raw_section(bdb, section_id);
+	if (!block)
+		return NULL;
+
+	block_size = get_blocksize(block);
+
+	entry = kzalloc(struct_size(entry, data, max(min_size, block_size) + 3),
+			GFP_KERNEL);
+	if (!entry)
+		return NULL;
+
+	entry->section_id = section_id;
+	entry->min_size = min_size;
+	memcpy(entry->data, block - 3, block_size + 3);
+
+	drm_dbg_kms(&i915->drm, "Found BDB block %d (size %zu, min size %zu)\n",
+		    section_id, block_size, min_size);
+
+	list_add(&entry->node, &i915->vbt.bdb_blocks);
+
+	return entry->data + 3;
+}
+
 static void
 fill_detail_timing_data(struct drm_display_mode *panel_fixed_mode,
 			const struct lvds_dvo_timing *dvo_timing)
@@ -199,7 +275,7 @@ get_lvds_fp_timing(const struct bdb_header *bdb,
 		   const struct bdb_lvds_lfp_data_ptrs *ptrs,
 		   int index)
 {
-	size_t data_ofs = (const u8 *)data - (const u8 *)bdb;
+	size_t data_ofs = block_offset(bdb, BDB_LVDS_LFP_DATA);
 	u16 data_size = ((const u16 *)data)[-1]; /* stored in header */
 	size_t ofs;
 
@@ -222,7 +298,8 @@ parse_panel_options(struct drm_i915_private *i915,
 	int drrs_mode;
 	int ret;
 
-	lvds_options = find_section(bdb, BDB_LVDS_OPTIONS);
+	lvds_options = find_section(i915, bdb, BDB_LVDS_OPTIONS,
+				    sizeof(*lvds_options));
 	if (!lvds_options)
 		return;
 
@@ -285,11 +362,13 @@ parse_lfp_panel_dtd(struct drm_i915_private *i915,
 	struct drm_display_mode *panel_fixed_mode;
 	int panel_type = i915->vbt.panel_type;
 
-	lvds_lfp_data = find_section(bdb, BDB_LVDS_LFP_DATA);
+	lvds_lfp_data = find_section(i915, bdb, BDB_LVDS_LFP_DATA,
+				     sizeof(*lvds_lfp_data));
 	if (!lvds_lfp_data)
 		return;
 
-	lvds_lfp_data_ptrs = find_section(bdb, BDB_LVDS_LFP_DATA_PTRS);
+	lvds_lfp_data_ptrs = find_section(i915, bdb, BDB_LVDS_LFP_DATA_PTRS,
+					  sizeof(*lvds_lfp_data_ptrs));
 	if (!lvds_lfp_data_ptrs)
 		return;
 
@@ -333,7 +412,8 @@ parse_generic_dtd(struct drm_i915_private *i915,
 	struct drm_display_mode *panel_fixed_mode;
 	int num_dtd;
 
-	generic_dtd = find_section(bdb, BDB_GENERIC_DTD);
+	generic_dtd = find_section(i915, bdb, BDB_GENERIC_DTD,
+				   sizeof(*generic_dtd));
 	if (!generic_dtd)
 		return;
 
@@ -430,7 +510,8 @@ parse_lfp_backlight(struct drm_i915_private *i915,
 	int panel_type = i915->vbt.panel_type;
 	u16 level;
 
-	backlight_data = find_section(bdb, BDB_LVDS_BACKLIGHT);
+	backlight_data = find_section(i915, bdb, BDB_LVDS_BACKLIGHT,
+				      sizeof(*backlight_data));
 	if (!backlight_data)
 		return;
 
@@ -531,14 +612,16 @@ parse_sdvo_panel_data(struct drm_i915_private *i915,
 	if (index == -1) {
 		const struct bdb_sdvo_lvds_options *sdvo_lvds_options;
 
-		sdvo_lvds_options = find_section(bdb, BDB_SDVO_LVDS_OPTIONS);
+		sdvo_lvds_options = find_section(i915, bdb, BDB_SDVO_LVDS_OPTIONS,
+						 sizeof(*sdvo_lvds_options));
 		if (!sdvo_lvds_options)
 			return;
 
 		index = sdvo_lvds_options->panel_type;
 	}
 
-	dtds = find_section(bdb, BDB_SDVO_PANEL_DTDS);
+	dtds = find_section(i915, bdb, BDB_SDVO_PANEL_DTDS,
+			    sizeof(*dtds));
 	if (!dtds)
 		return;
 
@@ -575,7 +658,8 @@ parse_general_features(struct drm_i915_private *i915,
 {
 	const struct bdb_general_features *general;
 
-	general = find_section(bdb, BDB_GENERAL_FEATURES);
+	general = find_section(i915, bdb, BDB_GENERAL_FEATURES,
+			       sizeof(*general));
 	if (!general)
 		return;
 
@@ -700,7 +784,8 @@ parse_driver_features(struct drm_i915_private *i915,
 {
 	const struct bdb_driver_features *driver;
 
-	driver = find_section(bdb, BDB_DRIVER_FEATURES);
+	driver = find_section(i915, bdb, BDB_DRIVER_FEATURES,
+			      sizeof(*driver));
 	if (!driver)
 		return;
 
@@ -756,7 +841,8 @@ parse_power_conservation_features(struct drm_i915_private *i915,
 	if (bdb->version < 228)
 		return;
 
-	power = find_section(bdb, BDB_LFP_POWER);
+	power = find_section(i915, bdb, BDB_LFP_POWER,
+			     sizeof(*power));
 	if (!power)
 		return;
 
@@ -783,7 +869,8 @@ parse_edp(struct drm_i915_private *i915, const struct bdb_header *bdb)
 	const struct edp_fast_link_params *edp_link_params;
 	int panel_type = i915->vbt.panel_type;
 
-	edp = find_section(bdb, BDB_EDP);
+	edp = find_section(i915, bdb, BDB_EDP,
+			   sizeof(*edp));
 	if (!edp)
 		return;
 
@@ -900,7 +987,8 @@ parse_psr(struct drm_i915_private *i915, const struct bdb_header *bdb)
 	const struct psr_table *psr_table;
 	int panel_type = i915->vbt.panel_type;
 
-	psr = find_section(bdb, BDB_PSR);
+	psr = find_section(i915, bdb, BDB_PSR,
+			   sizeof(*psr));
 	if (!psr) {
 		drm_dbg_kms(&i915->drm, "No PSR BDB found.\n");
 		return;
@@ -1058,7 +1146,8 @@ parse_mipi_config(struct drm_i915_private *i915,
 	/* Parse #52 for panel index used from panel_type already
 	 * parsed
 	 */
-	start = find_section(bdb, BDB_MIPI_CONFIG);
+	start = find_section(i915, bdb, BDB_MIPI_CONFIG,
+			     sizeof(*start));
 	if (!start) {
 		drm_dbg_kms(&i915->drm, "No MIPI config BDB found");
 		return;
@@ -1368,7 +1457,8 @@ parse_mipi_sequence(struct drm_i915_private *i915,
 	if (i915->vbt.dsi.panel_id != MIPI_DSI_GENERIC_PANEL_ID)
 		return;
 
-	sequence = find_section(bdb, BDB_MIPI_SEQUENCE);
+	sequence = find_section(i915, bdb, BDB_MIPI_SEQUENCE,
+				sizeof(*sequence));
 	if (!sequence) {
 		drm_dbg_kms(&i915->drm,
 			    "No MIPI Sequence found, parsing complete\n");
@@ -1451,7 +1541,8 @@ parse_compression_parameters(struct drm_i915_private *i915,
 	if (bdb->version < 198)
 		return;
 
-	params = find_section(bdb, BDB_COMPRESSION_PARAMETERS);
+	params = find_section(i915, bdb, BDB_COMPRESSION_PARAMETERS,
+			      sizeof(*params));
 	if (params) {
 		/* Sanity checks */
 		if (params->entry_size != sizeof(params->data[0])) {
@@ -2097,7 +2188,8 @@ parse_general_definitions(struct drm_i915_private *i915,
 	u16 block_size;
 	int bus_pin;
 
-	defs = find_section(bdb, BDB_GENERAL_DEFINITIONS);
+	defs = find_section(i915, bdb, BDB_GENERAL_DEFINITIONS,
+			    sizeof(*defs));
 	if (!defs) {
 		drm_dbg_kms(&i915->drm,
 			    "No general definition block is found, no devices defined.\n");
@@ -2466,6 +2558,7 @@ void intel_bios_init(struct drm_i915_private *i915)
 	const struct bdb_header *bdb;
 
 	INIT_LIST_HEAD(&i915->vbt.display_devices);
+	INIT_LIST_HEAD(&i915->vbt.bdb_blocks);
 
 	if (!HAS_DISPLAY(i915)) {
 		drm_dbg_kms(&i915->drm,
@@ -2536,14 +2629,20 @@ void intel_bios_init(struct drm_i915_private *i915)
  */
 void intel_bios_driver_remove(struct drm_i915_private *i915)
 {
-	struct intel_bios_encoder_data *devdata, *n;
+	struct intel_bios_encoder_data *devdata, *nd;
+	struct bdb_block_entry *entry, *ne;
 
-	list_for_each_entry_safe(devdata, n, &i915->vbt.display_devices, node) {
+	list_for_each_entry_safe(devdata, nd, &i915->vbt.display_devices, node) {
 		list_del(&devdata->node);
 		kfree(devdata->dsc);
 		kfree(devdata);
 	}
 
+	list_for_each_entry_safe(entry, ne, &i915->vbt.bdb_blocks, node) {
+		list_del(&entry->node);
+		kfree(entry);
+	}
+
 	kfree(i915->vbt.sdvo_lvds_vbt_mode);
 	i915->vbt.sdvo_lvds_vbt_mode = NULL;
 	kfree(i915->vbt.lfp_lvds_vbt_mode);
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index a9aceb08fcd1..0f52ce62281e 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -382,6 +382,7 @@ struct intel_vbt_data {
 	int crt_ddc_pin;
 
 	struct list_head display_devices;
+	struct list_head bdb_blocks;
 
 	struct intel_bios_encoder_data *ports[I915_MAX_PORTS]; /* Non-NULL if port present. */
 	struct sdvo_device_mapping sdvo_mappings[2];
-- 
2.34.1


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

* [Intel-gfx] [PATCH v2 03/11] drm/i915/bios: Use the copy of the LFP data table always
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 03/11] drm/i915/bios: Use the copy of the LFP data table always Ville Syrjala
  2022-03-17 19:10   ` Jani Nikula
@ 2022-03-17 20:21   ` Ville Syrjala
  1 sibling, 0 replies; 33+ messages in thread
From: Ville Syrjala @ 2022-03-17 20:21 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Currently get_lvds_fp_timing() still returns a pointer to the original
data block rather than our copy. Let's convert the data pointer offsets
to be relative to the data block rather than the whole BDB. With that
we can make get_lvds_fp_timing() return a pointer to the copy.

v2: Rebase

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_bios.c | 41 +++++++++++++++++++----
 1 file changed, 34 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index ffeaf7f6405f..777339f5dd79 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -153,6 +153,29 @@ static u32 block_offset(const void *bdb, enum bdb_block_id section_id)
 	return block - bdb;
 }
 
+/* make the data table offsets relative to the data block */
+static bool fixup_lfp_data_ptrs(const void *bdb, void *ptrs_block)
+{
+	struct bdb_lvds_lfp_data_ptrs *ptrs = ptrs_block;
+	u32 offset;
+	int i;
+
+	offset = block_offset(bdb, BDB_LVDS_LFP_DATA);
+
+	for (i = 0; i < 16; i++) {
+		if (ptrs->ptr[i].fp_timing.offset < offset ||
+		    ptrs->ptr[i].dvo_timing.offset < offset ||
+		    ptrs->ptr[i].panel_pnp_id.offset < offset)
+			return false;
+
+		ptrs->ptr[i].fp_timing.offset -= offset;
+		ptrs->ptr[i].dvo_timing.offset -= offset;
+		ptrs->ptr[i].panel_pnp_id.offset -= offset;
+	}
+
+	return true;
+}
+
 static const void *
 find_section(struct drm_i915_private *i915,
 	     const void *bdb, enum bdb_block_id section_id,
@@ -189,6 +212,13 @@ find_section(struct drm_i915_private *i915,
 	drm_dbg_kms(&i915->drm, "Found BDB block %d (size %zu, min size %zu)\n",
 		    section_id, block_size, min_size);
 
+	if (section_id == BDB_LVDS_LFP_DATA_PTRS &&
+	    !fixup_lfp_data_ptrs(bdb, entry->data + 3)) {
+		drm_err(&i915->drm, "VBT has malformed LFP data table pointers\n");
+		kfree(entry);
+		return NULL;
+	}
+
 	list_add(&entry->node, &i915->vbt.bdb_blocks);
 
 	return entry->data + 3;
@@ -270,22 +300,19 @@ get_lvds_dvo_timing(const struct bdb_lvds_lfp_data *lvds_lfp_data,
  * this function may return NULL if the corresponding entry is invalid
  */
 static const struct lvds_fp_timing *
-get_lvds_fp_timing(const struct bdb_header *bdb,
-		   const struct bdb_lvds_lfp_data *data,
+get_lvds_fp_timing(const struct bdb_lvds_lfp_data *data,
 		   const struct bdb_lvds_lfp_data_ptrs *ptrs,
 		   int index)
 {
-	size_t data_ofs = block_offset(bdb, BDB_LVDS_LFP_DATA);
 	u16 data_size = ((const u16 *)data)[-1]; /* stored in header */
 	size_t ofs;
 
 	if (index >= ARRAY_SIZE(ptrs->ptr))
 		return NULL;
 	ofs = ptrs->ptr[index].fp_timing.offset;
-	if (ofs < data_ofs ||
-	    ofs + sizeof(struct lvds_fp_timing) > data_ofs + data_size)
+	if (ofs + sizeof(struct lvds_fp_timing) > data_size)
 		return NULL;
-	return (const struct lvds_fp_timing *)((const u8 *)bdb + ofs);
+	return (const struct lvds_fp_timing *)((const u8 *)data + ofs);
 }
 
 /* Parse general panel options */
@@ -388,7 +415,7 @@ parse_lfp_panel_dtd(struct drm_i915_private *i915,
 		    "Found panel mode in BIOS VBT legacy lfp table:\n");
 	drm_mode_debug_printmodeline(panel_fixed_mode);
 
-	fp_timing = get_lvds_fp_timing(bdb, lvds_lfp_data,
+	fp_timing = get_lvds_fp_timing(lvds_lfp_data,
 				       lvds_lfp_data_ptrs,
 				       panel_type);
 	if (fp_timing) {
-- 
2.34.1


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

* [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/bios: Rework BDB block handling (rev3)
  2022-03-17 17:19 [Intel-gfx] [PATCH 00/11] drm/i915/bios: Rework BDB block handling Ville Syrjala
                   ` (14 preceding siblings ...)
  2022-03-17 20:20 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
@ 2022-03-17 22:16 ` Patchwork
  2022-03-17 22:18 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 33+ messages in thread
From: Patchwork @ 2022-03-17 22:16 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/bios: Rework BDB block handling (rev3)
URL   : https://patchwork.freedesktop.org/series/101496/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
f78f0208e580 drm/i915/bios: Extract struct lvds_lfp_data_ptr_table
b9aaa74b14b4 drm/i915/bios: Make copies of VBT data blocks
2b5fbda9a559 drm/i915/bios: Use the copy of the LFP data table always
4d30945afa1f drm/i915/bios: Validate LFP data table pointers
-:86: WARNING:LONG_LINE: line length of 103 exceeds 100 columns
#86: FILE: drivers/gpu/drm/i915/display/intel_bios.c:219:
+		if (ptrs->ptr[i].fp_timing.offset - ptrs->ptr[i-1].fp_timing.offset != lfp_data_size ||

-:86: CHECK:SPACING: spaces preferred around that '-' (ctx:VxV)
#86: FILE: drivers/gpu/drm/i915/display/intel_bios.c:219:
+		if (ptrs->ptr[i].fp_timing.offset - ptrs->ptr[i-1].fp_timing.offset != lfp_data_size ||
 		                                               ^

-:87: WARNING:LONG_LINE: line length of 105 exceeds 100 columns
#87: FILE: drivers/gpu/drm/i915/display/intel_bios.c:220:
+		    ptrs->ptr[i].dvo_timing.offset - ptrs->ptr[i-1].dvo_timing.offset != lfp_data_size ||

-:87: CHECK:SPACING: spaces preferred around that '-' (ctx:VxV)
#87: FILE: drivers/gpu/drm/i915/display/intel_bios.c:220:
+		    ptrs->ptr[i].dvo_timing.offset - ptrs->ptr[i-1].dvo_timing.offset != lfp_data_size ||
 		                                                ^

-:88: WARNING:LONG_LINE: line length of 107 exceeds 100 columns
#88: FILE: drivers/gpu/drm/i915/display/intel_bios.c:221:
+		    ptrs->ptr[i].panel_pnp_id.offset - ptrs->ptr[i-1].panel_pnp_id.offset != lfp_data_size)

-:88: CHECK:SPACING: spaces preferred around that '-' (ctx:VxV)
#88: FILE: drivers/gpu/drm/i915/display/intel_bios.c:221:
+		    ptrs->ptr[i].panel_pnp_id.offset - ptrs->ptr[i-1].panel_pnp_id.offset != lfp_data_size)
 		                                                  ^

total: 0 errors, 3 warnings, 3 checks, 94 lines checked
3163d2ce4d8e drm/i915/bios: Trust the LFP data pointers
b88f44efc47e drm/i915/bios: Validate the panel_name table
79016ff6119f drm/i915/bios: Reorder panel DTD parsing
954a9b37adaa drm/i915/bios: Generate LFP data table pointers if the VBT lacks them
-:39: CHECK:SPACING: spaces preferred around that '+' (ctx:VxV)
#39: FILE: drivers/gpu/drm/i915/display/intel_bios.c:283:
+		if (data[i] == 0xff && data[i+1] == 0xff)
 		                             ^

-:123: CHECK:SPACING: spaces preferred around that '-' (ctx:VxV)
#123: FILE: drivers/gpu/drm/i915/display/intel_bios.c:367:
+		next_lfp_data_ptr(&ptrs->ptr[i].fp_timing, &ptrs->ptr[i-1].fp_timing, size);
 		                                                       ^

-:124: CHECK:SPACING: spaces preferred around that '-' (ctx:VxV)
#124: FILE: drivers/gpu/drm/i915/display/intel_bios.c:368:
+		next_lfp_data_ptr(&ptrs->ptr[i].dvo_timing, &ptrs->ptr[i-1].dvo_timing, size);
 		                                                        ^

-:125: CHECK:SPACING: spaces preferred around that '-' (ctx:VxV)
#125: FILE: drivers/gpu/drm/i915/display/intel_bios.c:369:
+		next_lfp_data_ptr(&ptrs->ptr[i].panel_pnp_id, &ptrs->ptr[i-1].panel_pnp_id, size);
 		                                                          ^

total: 0 errors, 0 warnings, 4 checks, 163 lines checked
008090abbd52 drm/i915/bios: Get access to the tail end of the LFP data block
c04a3e89df19 drm/i915/bios: Parse the seamless DRRS min refresh rate
028a04f58900 drm/i915: Respect VBT seamless DRRS min refresh rate



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

* [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915/bios: Rework BDB block handling (rev3)
  2022-03-17 17:19 [Intel-gfx] [PATCH 00/11] drm/i915/bios: Rework BDB block handling Ville Syrjala
                   ` (15 preceding siblings ...)
  2022-03-17 22:16 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/bios: Rework BDB block handling (rev3) Patchwork
@ 2022-03-17 22:18 ` Patchwork
  2022-03-17 22:48 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 33+ messages in thread
From: Patchwork @ 2022-03-17 22:18 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/bios: Rework BDB block handling (rev3)
URL   : https://patchwork.freedesktop.org/series/101496/
State : warning

== Summary ==

$ dim sparse --fast origin/drm-tip
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.



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

* Re: [Intel-gfx] [PATCH 02/11] drm/i915/bios: Make copies of VBT data blocks
  2022-03-17 19:02   ` Jani Nikula
@ 2022-03-17 22:18     ` Ville Syrjälä
  2022-03-18  9:44       ` Jani Nikula
  0 siblings, 1 reply; 33+ messages in thread
From: Ville Syrjälä @ 2022-03-17 22:18 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

On Thu, Mar 17, 2022 at 09:02:46PM +0200, Jani Nikula wrote:
> On Thu, 17 Mar 2022, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Make a copy of each VB data block with a guaranteed minimum
> > size. The extra (if any) will just be left zeroed.
> 
> *VBT
> 
> >
> > This means we don't have to worry about going out of bounds
> > when accessing any of the structure members. Otherwise that
> > could easliy happen if we simply get the version check wrong,
> > or if the VBT is broken/malicious.
> 
> *easily
> 
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> The high level question is if we really want to save the copies until
> driver remove instead of just during parsing. The lifetime should be
> mentioned in the commit message, with rationale if you have some.

Sure, I'll amend the commit msg a bit.

I think we at least must move away from the "parse VBT once at
driver init" idea because that won't ever let us deal with the
panel_type=0xff->check PnP ID thing. I think I even have a few
real world VBTs in my stash which have panel_type=0xff, so it's
not just some theoretical thing.

So we must hang onto the blocks at least until we've finished the
output setup. But I'm thinking we can just keep them permanently
and even start thinking about moving away from the "parse once,
stash results somewhere" mentality. Ie. we could just parse on
demand instead.

> I was wondering about making the copies up front instead of as needed,
> but that means setting up a list for the min sizes. It would clean up
> the usage (avoids passing around any pointers to original data to the
> parsers). Then you could use just find_section(i915, BDB_XXX). Dunno.

At least if we go for the parse on demand apporach then we definitely
want to do that. Avoids having to deal with kmalloc() fails/etc. while
parsing.

-- 
Ville Syrjälä
Intel

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

* [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/bios: Rework BDB block handling (rev3)
  2022-03-17 17:19 [Intel-gfx] [PATCH 00/11] drm/i915/bios: Rework BDB block handling Ville Syrjala
                   ` (16 preceding siblings ...)
  2022-03-17 22:18 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
@ 2022-03-17 22:48 ` Patchwork
  2022-03-18  0:04 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/bios: Rework BDB block handling (rev4) Patchwork
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 33+ messages in thread
From: Patchwork @ 2022-03-17 22:48 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx

[-- Attachment #1: Type: text/plain, Size: 5435 bytes --]

== Series Details ==

Series: drm/i915/bios: Rework BDB block handling (rev3)
URL   : https://patchwork.freedesktop.org/series/101496/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_11378 -> Patchwork_22599
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22599/index.html

Participating hosts (48 -> 44)
------------------------------

  Additional (1): bat-adlm-1 
  Missing    (5): shard-tglu fi-bsw-cyan fi-kbl-8809g shard-rkl fi-bdw-samus 

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in Patchwork_22599:

### IGT changes ###

#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@runner@aborted:
    - {bat-adlm-1}:       NOTRUN -> [FAIL][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22599/bat-adlm-1/igt@runner@aborted.html
    - {fi-rkl-11600}:     NOTRUN -> [FAIL][2]
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22599/fi-rkl-11600/igt@runner@aborted.html
    - {fi-jsl-1}:         NOTRUN -> [FAIL][3]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22599/fi-jsl-1/igt@runner@aborted.html
    - {fi-ehl-2}:         NOTRUN -> [FAIL][4]
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22599/fi-ehl-2/igt@runner@aborted.html

  
Known issues
------------

  Here are the changes found in Patchwork_22599 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@i915_selftest@live@execlists:
    - fi-bsw-nick:        [PASS][5] -> [INCOMPLETE][6] ([i915#2940])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/fi-bsw-nick/igt@i915_selftest@live@execlists.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22599/fi-bsw-nick/igt@i915_selftest@live@execlists.html

  * igt@runner@aborted:
    - fi-tgl-1115g4:      NOTRUN -> [FAIL][7] ([i915#3690])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22599/fi-tgl-1115g4/igt@runner@aborted.html
    - bat-dg1-6:          NOTRUN -> [FAIL][8] ([i915#2426])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22599/bat-dg1-6/igt@runner@aborted.html
    - bat-dg1-5:          NOTRUN -> [FAIL][9] ([i915#2426])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22599/bat-dg1-5/igt@runner@aborted.html
    - fi-bsw-nick:        NOTRUN -> [FAIL][10] ([fdo#109271] / [i915#1436] / [i915#3428] / [i915#4312])
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22599/fi-bsw-nick/igt@runner@aborted.html
    - fi-rkl-guc:         NOTRUN -> [FAIL][11] ([i915#2426])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22599/fi-rkl-guc/igt@runner@aborted.html

  
#### Possible fixes ####

  * igt@core_hotunplug@unbind-rebind:
    - fi-blb-e6850:       [FAIL][12] ([i915#3194]) -> [PASS][13]
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/fi-blb-e6850/igt@core_hotunplug@unbind-rebind.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22599/fi-blb-e6850/igt@core_hotunplug@unbind-rebind.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
  [i915#2426]: https://gitlab.freedesktop.org/drm/intel/issues/2426
  [i915#2940]: https://gitlab.freedesktop.org/drm/intel/issues/2940
  [i915#3194]: https://gitlab.freedesktop.org/drm/intel/issues/3194
  [i915#3428]: https://gitlab.freedesktop.org/drm/intel/issues/3428
  [i915#3690]: https://gitlab.freedesktop.org/drm/intel/issues/3690
  [i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
  [i915#4897]: https://gitlab.freedesktop.org/drm/intel/issues/4897
  [i915#5137]: https://gitlab.freedesktop.org/drm/intel/issues/5137
  [i915#5169]: https://gitlab.freedesktop.org/drm/intel/issues/5169
  [i915#5269]: https://gitlab.freedesktop.org/drm/intel/issues/5269


Build changes
-------------

  * Linux: CI_DRM_11378 -> Patchwork_22599

  CI-20190529: 20190529
  CI_DRM_11378: 3ec612f871c18232b04e5530e485992c76bf13a6 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_6385: f3df40281d93d5a63ee98fa30e90852d780673c9 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  Patchwork_22599: 028a04f589005c443412aec0d430941655764430 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

028a04f58900 drm/i915: Respect VBT seamless DRRS min refresh rate
c04a3e89df19 drm/i915/bios: Parse the seamless DRRS min refresh rate
008090abbd52 drm/i915/bios: Get access to the tail end of the LFP data block
954a9b37adaa drm/i915/bios: Generate LFP data table pointers if the VBT lacks them
79016ff6119f drm/i915/bios: Reorder panel DTD parsing
b88f44efc47e drm/i915/bios: Validate the panel_name table
3163d2ce4d8e drm/i915/bios: Trust the LFP data pointers
4d30945afa1f drm/i915/bios: Validate LFP data table pointers
2b5fbda9a559 drm/i915/bios: Use the copy of the LFP data table always
b9aaa74b14b4 drm/i915/bios: Make copies of VBT data blocks
f78f0208e580 drm/i915/bios: Extract struct lvds_lfp_data_ptr_table

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22599/index.html

[-- Attachment #2: Type: text/html, Size: 6171 bytes --]

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

* [Intel-gfx] [PATCH v2 08/11] drm/i915/bios: Generate LFP data table pointers if the VBT lacks them
  2022-03-17 17:19 ` [Intel-gfx] [PATCH 08/11] drm/i915/bios: Generate LFP data table pointers if the VBT lacks them Ville Syrjala
@ 2022-03-17 23:41   ` Ville Syrjala
  0 siblings, 0 replies; 33+ messages in thread
From: Ville Syrjala @ 2022-03-17 23:41 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Modern VBTs (seem at least on TGL with VBT version 240) no
longer contain the LFP data table pointers block (42). We
are expecting to have one in order to be able to parse the
LFP data block (41), so let's make one up.

Since the fp_timing table has variable size we must somehow
determine its size. Rather than just hardcode it we look for
the terminator bytes (0xffff) to figure out where each table
entry starts. dvo_timing, panel_pnp_id, and panel_name are
expected to have fixed size.

v2: kfree the thing we allocated, not the thing+3 bytes

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_bios.c | 134 +++++++++++++++++++++-
 1 file changed, 133 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index 7633933a4920..48660c0894b5 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -272,12 +272,132 @@ static bool fixup_lfp_data_ptrs(const void *bdb, void *ptrs_block)
 	return validate_lfp_data_ptrs(bdb, ptrs);
 }
 
+static const void *find_fp_timing_terminator(const u8 *data, int size)
+{
+	int i;
+
+	if (!data)
+		return NULL;
+
+	for (i = 0; i < size - 1; i++) {
+		if (data[i] == 0xff && data[i+1] == 0xff)
+			return &data[i];
+	}
+
+	return NULL;
+}
+
+static int make_lfp_data_ptr(struct lvds_lfp_data_ptr_table *table,
+			     int table_size, int total_size)
+{
+	if (total_size < table_size)
+		return total_size;
+
+	table->table_size = table_size;
+	table->offset = total_size - table_size;
+
+	return total_size - table_size;
+}
+
+static void next_lfp_data_ptr(struct lvds_lfp_data_ptr_table *next,
+			      const struct lvds_lfp_data_ptr_table *prev,
+			      int size)
+{
+	next->table_size = prev->table_size;
+	next->offset = prev->offset + size;
+}
+
+static void *generate_lfp_data_ptrs(const void *bdb)
+{
+	int i, size, table_size, block_size, offset;
+	const void *t0, *t1, *block;
+	struct bdb_lvds_lfp_data_ptrs *ptrs;
+	void *ptrs_block;
+
+	block = find_raw_section(bdb, BDB_LVDS_LFP_DATA);
+	if (!block)
+		return NULL;
+
+	block_size = get_blocksize(block);
+
+	size = block_size;
+	t0 = find_fp_timing_terminator(block, size);
+
+	size -= t0 - block - 2;
+	t1 = find_fp_timing_terminator(t0 + 2, size);
+
+	if (!t0 || !t1)
+		return NULL;
+
+	size = t1 - t0;
+	if (size * 16 > block_size)
+		return NULL;
+
+	ptrs_block = kzalloc(sizeof(*ptrs) + 3, GFP_KERNEL);
+	if (!ptrs_block)
+		return NULL;
+
+	*(u8 *)(ptrs_block + 0) = BDB_LVDS_LFP_DATA_PTRS;
+	*(u16 *)(ptrs_block + 1) = sizeof(*ptrs);
+	ptrs = ptrs_block + 3;
+
+	table_size = sizeof(struct lvds_pnp_id);
+	size = make_lfp_data_ptr(&ptrs->ptr[0].panel_pnp_id, table_size, size);
+
+	table_size = sizeof(struct lvds_dvo_timing);
+	size = make_lfp_data_ptr(&ptrs->ptr[0].dvo_timing, table_size, size);
+
+	table_size = t0 - block + 2;
+	size = make_lfp_data_ptr(&ptrs->ptr[0].fp_timing, table_size, size);
+
+	if (ptrs->ptr[0].fp_timing.table_size)
+		ptrs->lvds_entries++;
+	if (ptrs->ptr[0].dvo_timing.table_size)
+		ptrs->lvds_entries++;
+	if (ptrs->ptr[0].panel_pnp_id.table_size)
+		ptrs->lvds_entries++;
+
+	if (size != 0 || ptrs->lvds_entries != 3) {
+		kfree(ptrs);
+		return NULL;
+	}
+
+	size = t1 - t0;
+	for (i = 1; i < 16; i++) {
+		next_lfp_data_ptr(&ptrs->ptr[i].fp_timing, &ptrs->ptr[i-1].fp_timing, size);
+		next_lfp_data_ptr(&ptrs->ptr[i].dvo_timing, &ptrs->ptr[i-1].dvo_timing, size);
+		next_lfp_data_ptr(&ptrs->ptr[i].panel_pnp_id, &ptrs->ptr[i-1].panel_pnp_id, size);
+	}
+
+	size = t1 - t0;
+	table_size = sizeof(struct lvds_lfp_panel_name);
+
+	if (16 * (size + table_size) <= block_size) {
+		ptrs->panel_name.table_size = table_size;
+		ptrs->panel_name.offset = size * 16;
+	}
+
+	offset = block - bdb;
+
+	for (i = 0; i < 16; i++) {
+		ptrs->ptr[i].fp_timing.offset += offset;
+		ptrs->ptr[i].dvo_timing.offset += offset;
+		ptrs->ptr[i].panel_pnp_id.offset += offset;
+	}
+
+	if (ptrs->panel_name.table_size)
+		ptrs->panel_name.offset += offset;
+
+	return ptrs_block;
+}
+
 static const void *
 find_section(struct drm_i915_private *i915,
 	     const void *bdb, enum bdb_block_id section_id,
 	     size_t min_size)
 {
 	struct bdb_block_entry *entry;
+	void *temp_block = NULL;
 	const void *block;
 	size_t block_size;
 
@@ -291,6 +411,14 @@ find_section(struct drm_i915_private *i915,
 	}
 
 	block = find_raw_section(bdb, section_id);
+
+	/* Modern VBTs (~TGL+) lack the LFP data table pointers block, make one up */
+	if (!block && section_id == BDB_LVDS_LFP_DATA_PTRS) {
+		drm_dbg_kms(&i915->drm, "Generating LFP data table pointers\n");
+		temp_block = generate_lfp_data_ptrs(bdb);
+		if (temp_block)
+			block = temp_block + 3;
+	}
 	if (!block)
 		return NULL;
 
@@ -298,13 +426,17 @@ find_section(struct drm_i915_private *i915,
 
 	entry = kzalloc(struct_size(entry, data, max(min_size, block_size) + 3),
 			GFP_KERNEL);
-	if (!entry)
+	if (!entry) {
+		kfree(temp_block);
 		return NULL;
+	}
 
 	entry->section_id = section_id;
 	entry->min_size = min_size;
 	memcpy(entry->data, block - 3, block_size + 3);
 
+	kfree(temp_block);
+
 	drm_dbg_kms(&i915->drm, "Found BDB block %d (size %zu, min size %zu)\n",
 		    section_id, block_size, min_size);
 
-- 
2.34.1


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

* [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/bios: Rework BDB block handling (rev4)
  2022-03-17 17:19 [Intel-gfx] [PATCH 00/11] drm/i915/bios: Rework BDB block handling Ville Syrjala
                   ` (17 preceding siblings ...)
  2022-03-17 22:48 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
@ 2022-03-18  0:04 ` Patchwork
  2022-03-18  0:05 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 33+ messages in thread
From: Patchwork @ 2022-03-18  0:04 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/bios: Rework BDB block handling (rev4)
URL   : https://patchwork.freedesktop.org/series/101496/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
72f9ed8364ec drm/i915/bios: Extract struct lvds_lfp_data_ptr_table
8d0061ecd718 drm/i915/bios: Make copies of VBT data blocks
b8d6ec3771a2 drm/i915/bios: Use the copy of the LFP data table always
e8e666f84297 drm/i915/bios: Validate LFP data table pointers
-:86: WARNING:LONG_LINE: line length of 103 exceeds 100 columns
#86: FILE: drivers/gpu/drm/i915/display/intel_bios.c:219:
+		if (ptrs->ptr[i].fp_timing.offset - ptrs->ptr[i-1].fp_timing.offset != lfp_data_size ||

-:86: CHECK:SPACING: spaces preferred around that '-' (ctx:VxV)
#86: FILE: drivers/gpu/drm/i915/display/intel_bios.c:219:
+		if (ptrs->ptr[i].fp_timing.offset - ptrs->ptr[i-1].fp_timing.offset != lfp_data_size ||
 		                                               ^

-:87: WARNING:LONG_LINE: line length of 105 exceeds 100 columns
#87: FILE: drivers/gpu/drm/i915/display/intel_bios.c:220:
+		    ptrs->ptr[i].dvo_timing.offset - ptrs->ptr[i-1].dvo_timing.offset != lfp_data_size ||

-:87: CHECK:SPACING: spaces preferred around that '-' (ctx:VxV)
#87: FILE: drivers/gpu/drm/i915/display/intel_bios.c:220:
+		    ptrs->ptr[i].dvo_timing.offset - ptrs->ptr[i-1].dvo_timing.offset != lfp_data_size ||
 		                                                ^

-:88: WARNING:LONG_LINE: line length of 107 exceeds 100 columns
#88: FILE: drivers/gpu/drm/i915/display/intel_bios.c:221:
+		    ptrs->ptr[i].panel_pnp_id.offset - ptrs->ptr[i-1].panel_pnp_id.offset != lfp_data_size)

-:88: CHECK:SPACING: spaces preferred around that '-' (ctx:VxV)
#88: FILE: drivers/gpu/drm/i915/display/intel_bios.c:221:
+		    ptrs->ptr[i].panel_pnp_id.offset - ptrs->ptr[i-1].panel_pnp_id.offset != lfp_data_size)
 		                                                  ^

total: 0 errors, 3 warnings, 3 checks, 94 lines checked
7e453e0333ef drm/i915/bios: Trust the LFP data pointers
e69891bf7813 drm/i915/bios: Validate the panel_name table
0afce24e16a7 drm/i915/bios: Reorder panel DTD parsing
9c678f984f2a drm/i915/bios: Generate LFP data table pointers if the VBT lacks them
-:41: CHECK:SPACING: spaces preferred around that '+' (ctx:VxV)
#41: FILE: drivers/gpu/drm/i915/display/intel_bios.c:283:
+		if (data[i] == 0xff && data[i+1] == 0xff)
 		                             ^

-:125: CHECK:SPACING: spaces preferred around that '-' (ctx:VxV)
#125: FILE: drivers/gpu/drm/i915/display/intel_bios.c:367:
+		next_lfp_data_ptr(&ptrs->ptr[i].fp_timing, &ptrs->ptr[i-1].fp_timing, size);
 		                                                       ^

-:126: CHECK:SPACING: spaces preferred around that '-' (ctx:VxV)
#126: FILE: drivers/gpu/drm/i915/display/intel_bios.c:368:
+		next_lfp_data_ptr(&ptrs->ptr[i].dvo_timing, &ptrs->ptr[i-1].dvo_timing, size);
 		                                                        ^

-:127: CHECK:SPACING: spaces preferred around that '-' (ctx:VxV)
#127: FILE: drivers/gpu/drm/i915/display/intel_bios.c:369:
+		next_lfp_data_ptr(&ptrs->ptr[i].panel_pnp_id, &ptrs->ptr[i-1].panel_pnp_id, size);
 		                                                          ^

total: 0 errors, 0 warnings, 4 checks, 164 lines checked
dfe51a29a54b drm/i915/bios: Get access to the tail end of the LFP data block
a81fc19622d7 drm/i915/bios: Parse the seamless DRRS min refresh rate
d457d9e6d218 drm/i915: Respect VBT seamless DRRS min refresh rate



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

* [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915/bios: Rework BDB block handling (rev4)
  2022-03-17 17:19 [Intel-gfx] [PATCH 00/11] drm/i915/bios: Rework BDB block handling Ville Syrjala
                   ` (18 preceding siblings ...)
  2022-03-18  0:04 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/bios: Rework BDB block handling (rev4) Patchwork
@ 2022-03-18  0:05 ` Patchwork
  2022-03-18  0:41 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
  2022-03-18  2:54 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
  21 siblings, 0 replies; 33+ messages in thread
From: Patchwork @ 2022-03-18  0:05 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/bios: Rework BDB block handling (rev4)
URL   : https://patchwork.freedesktop.org/series/101496/
State : warning

== Summary ==

$ dim sparse --fast origin/drm-tip
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.



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

* [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/bios: Rework BDB block handling (rev4)
  2022-03-17 17:19 [Intel-gfx] [PATCH 00/11] drm/i915/bios: Rework BDB block handling Ville Syrjala
                   ` (19 preceding siblings ...)
  2022-03-18  0:05 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
@ 2022-03-18  0:41 ` Patchwork
  2022-03-18  2:54 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
  21 siblings, 0 replies; 33+ messages in thread
From: Patchwork @ 2022-03-18  0:41 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: intel-gfx

[-- Attachment #1: Type: text/plain, Size: 9807 bytes --]

== Series Details ==

Series: drm/i915/bios: Rework BDB block handling (rev4)
URL   : https://patchwork.freedesktop.org/series/101496/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_11378 -> Patchwork_22601
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/index.html

Participating hosts (49 -> 46)
------------------------------

  Additional (2): bat-adlm-1 fi-pnv-d510 
  Missing    (5): shard-tglu fi-bsw-cyan shard-rkl shard-dg1 fi-bdw-samus 

Known issues
------------

  Here are the changes found in Patchwork_22601 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_huc_copy@huc-copy:
    - fi-pnv-d510:        NOTRUN -> [SKIP][1] ([fdo#109271]) +57 similar issues
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/fi-pnv-d510/igt@gem_huc_copy@huc-copy.html

  * igt@i915_selftest@live@gt_lrc:
    - fi-rkl-guc:         [PASS][2] -> [INCOMPLETE][3] ([i915#2373] / [i915#4983])
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/fi-rkl-guc/igt@i915_selftest@live@gt_lrc.html
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/fi-rkl-guc/igt@i915_selftest@live@gt_lrc.html

  * igt@i915_selftest@live@hangcheck:
    - fi-hsw-4770:        [PASS][4] -> [INCOMPLETE][5] ([i915#3303])
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/fi-hsw-4770/igt@i915_selftest@live@hangcheck.html
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/fi-hsw-4770/igt@i915_selftest@live@hangcheck.html
    - fi-bdw-5557u:       NOTRUN -> [INCOMPLETE][6] ([i915#3921])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/fi-bdw-5557u/igt@i915_selftest@live@hangcheck.html

  * igt@kms_chamelium@vga-edid-read:
    - fi-bdw-5557u:       NOTRUN -> [SKIP][7] ([fdo#109271] / [fdo#111827]) +8 similar issues
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/fi-bdw-5557u/igt@kms_chamelium@vga-edid-read.html

  * igt@kms_frontbuffer_tracking@basic:
    - fi-cfl-8109u:       [PASS][8] -> [DMESG-FAIL][9] ([i915#295])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/fi-cfl-8109u/igt@kms_frontbuffer_tracking@basic.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/fi-cfl-8109u/igt@kms_frontbuffer_tracking@basic.html

  * igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-c:
    - fi-pnv-d510:        NOTRUN -> [SKIP][10] ([fdo#109271] / [i915#5341])
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/fi-pnv-d510/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-c.html
    - fi-cfl-8109u:       [PASS][11] -> [DMESG-WARN][12] ([i915#295] / [i915#5341])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/fi-cfl-8109u/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-c.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/fi-cfl-8109u/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-c.html

  * igt@kms_pipe_crc_basic@read-crc-pipe-b:
    - fi-cfl-8109u:       [PASS][13] -> [DMESG-WARN][14] ([i915#295]) +9 similar issues
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/fi-cfl-8109u/igt@kms_pipe_crc_basic@read-crc-pipe-b.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/fi-cfl-8109u/igt@kms_pipe_crc_basic@read-crc-pipe-b.html

  * igt@kms_setmode@basic-clone-single-crtc:
    - fi-bdw-5557u:       NOTRUN -> [SKIP][15] ([fdo#109271]) +14 similar issues
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/fi-bdw-5557u/igt@kms_setmode@basic-clone-single-crtc.html

  * igt@runner@aborted:
    - fi-hsw-4770:        NOTRUN -> [FAIL][16] ([fdo#109271] / [i915#1436] / [i915#4312])
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/fi-hsw-4770/igt@runner@aborted.html

  
#### Possible fixes ####

  * igt@core_hotunplug@unbind-rebind:
    - {bat-rpls-1}:       [DMESG-WARN][17] ([i915#4391]) -> [PASS][18]
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/bat-rpls-1/igt@core_hotunplug@unbind-rebind.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/bat-rpls-1/igt@core_hotunplug@unbind-rebind.html
    - fi-blb-e6850:       [FAIL][19] ([i915#3194]) -> [PASS][20]
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/fi-blb-e6850/igt@core_hotunplug@unbind-rebind.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/fi-blb-e6850/igt@core_hotunplug@unbind-rebind.html

  * igt@i915_module_load@reload:
    - {bat-rpls-2}:       [DMESG-WARN][21] ([i915#4391]) -> [PASS][22] +1 similar issue
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/bat-rpls-2/igt@i915_module_load@reload.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/bat-rpls-2/igt@i915_module_load@reload.html

  * igt@i915_selftest@live@gt_pm:
    - {bat-rpls-2}:       [INCOMPLETE][23] -> [PASS][24]
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/bat-rpls-2/igt@i915_selftest@live@gt_pm.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/bat-rpls-2/igt@i915_selftest@live@gt_pm.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
  [fdo#111825]: https://bugs.freedesktop.org/show_bug.cgi?id=111825
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
  [i915#1155]: https://gitlab.freedesktop.org/drm/intel/issues/1155
  [i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
  [i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
  [i915#1849]: https://gitlab.freedesktop.org/drm/intel/issues/1849
  [i915#2373]: https://gitlab.freedesktop.org/drm/intel/issues/2373
  [i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
  [i915#2867]: https://gitlab.freedesktop.org/drm/intel/issues/2867
  [i915#295]: https://gitlab.freedesktop.org/drm/intel/issues/295
  [i915#3194]: https://gitlab.freedesktop.org/drm/intel/issues/3194
  [i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
  [i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
  [i915#3303]: https://gitlab.freedesktop.org/drm/intel/issues/3303
  [i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546
  [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
  [i915#3595]: https://gitlab.freedesktop.org/drm/intel/issues/3595
  [i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
  [i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
  [i915#3921]: https://gitlab.freedesktop.org/drm/intel/issues/3921
  [i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
  [i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
  [i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
  [i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
  [i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212
  [i915#4213]: https://gitlab.freedesktop.org/drm/intel/issues/4213
  [i915#4215]: https://gitlab.freedesktop.org/drm/intel/issues/4215
  [i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
  [i915#4391]: https://gitlab.freedesktop.org/drm/intel/issues/4391
  [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
  [i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
  [i915#5190]: https://gitlab.freedesktop.org/drm/intel/issues/5190
  [i915#5192]: https://gitlab.freedesktop.org/drm/intel/issues/5192
  [i915#5193]: https://gitlab.freedesktop.org/drm/intel/issues/5193
  [i915#5257]: https://gitlab.freedesktop.org/drm/intel/issues/5257
  [i915#5270]: https://gitlab.freedesktop.org/drm/intel/issues/5270
  [i915#5274]: https://gitlab.freedesktop.org/drm/intel/issues/5274
  [i915#5275]: https://gitlab.freedesktop.org/drm/intel/issues/5275
  [i915#5276]: https://gitlab.freedesktop.org/drm/intel/issues/5276
  [i915#5337]: https://gitlab.freedesktop.org/drm/intel/issues/5337
  [i915#5339]: https://gitlab.freedesktop.org/drm/intel/issues/5339
  [i915#5341]: https://gitlab.freedesktop.org/drm/intel/issues/5341
  [i915#5342]: https://gitlab.freedesktop.org/drm/intel/issues/5342
  [i915#5356]: https://gitlab.freedesktop.org/drm/intel/issues/5356


Build changes
-------------

  * Linux: CI_DRM_11378 -> Patchwork_22601

  CI-20190529: 20190529
  CI_DRM_11378: 3ec612f871c18232b04e5530e485992c76bf13a6 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_6385: f3df40281d93d5a63ee98fa30e90852d780673c9 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  Patchwork_22601: d457d9e6d21805cb19ff601aae899b5d4f5c4f36 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

d457d9e6d218 drm/i915: Respect VBT seamless DRRS min refresh rate
a81fc19622d7 drm/i915/bios: Parse the seamless DRRS min refresh rate
dfe51a29a54b drm/i915/bios: Get access to the tail end of the LFP data block
9c678f984f2a drm/i915/bios: Generate LFP data table pointers if the VBT lacks them
0afce24e16a7 drm/i915/bios: Reorder panel DTD parsing
e69891bf7813 drm/i915/bios: Validate the panel_name table
7e453e0333ef drm/i915/bios: Trust the LFP data pointers
e8e666f84297 drm/i915/bios: Validate LFP data table pointers
b8d6ec3771a2 drm/i915/bios: Use the copy of the LFP data table always
8d0061ecd718 drm/i915/bios: Make copies of VBT data blocks
72f9ed8364ec drm/i915/bios: Extract struct lvds_lfp_data_ptr_table

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/index.html

[-- Attachment #2: Type: text/html, Size: 8986 bytes --]

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

* [Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915/bios: Rework BDB block handling (rev4)
  2022-03-17 17:19 [Intel-gfx] [PATCH 00/11] drm/i915/bios: Rework BDB block handling Ville Syrjala
                   ` (20 preceding siblings ...)
  2022-03-18  0:41 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
@ 2022-03-18  2:54 ` Patchwork
  21 siblings, 0 replies; 33+ messages in thread
From: Patchwork @ 2022-03-18  2:54 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: intel-gfx

[-- Attachment #1: Type: text/plain, Size: 30271 bytes --]

== Series Details ==

Series: drm/i915/bios: Rework BDB block handling (rev4)
URL   : https://patchwork.freedesktop.org/series/101496/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_11378_full -> Patchwork_22601_full
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with Patchwork_22601_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_22601_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

Participating hosts (13 -> 12)
------------------------------

  Missing    (1): shard-dg1 

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in Patchwork_22601_full:

### IGT changes ###

#### Possible regressions ####

  * igt@kms_big_fb@x-tiled-max-hw-stride-64bpp-rotate-0-async-flip:
    - shard-glk:          [PASS][1] -> [FAIL][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-glk1/igt@kms_big_fb@x-tiled-max-hw-stride-64bpp-rotate-0-async-flip.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-glk3/igt@kms_big_fb@x-tiled-max-hw-stride-64bpp-rotate-0-async-flip.html

  * igt@kms_cursor_crc@pipe-a-cursor-128x42-sliding:
    - shard-tglb:         [PASS][3] -> [INCOMPLETE][4]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-tglb7/igt@kms_cursor_crc@pipe-a-cursor-128x42-sliding.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-tglb7/igt@kms_cursor_crc@pipe-a-cursor-128x42-sliding.html

  * igt@kms_plane_scaling@downscale-with-pixel-format-factor-0-75@pipe-b-edp-1-downscale-with-pixel-format:
    - shard-iclb:         [PASS][5] -> [INCOMPLETE][6] +1 similar issue
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-iclb4/igt@kms_plane_scaling@downscale-with-pixel-format-factor-0-75@pipe-b-edp-1-downscale-with-pixel-format.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-iclb2/igt@kms_plane_scaling@downscale-with-pixel-format-factor-0-75@pipe-b-edp-1-downscale-with-pixel-format.html

  
#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * {igt@kms_frontbuffer_tracking@fbcpsr-tiling-4}:
    - {shard-rkl}:        NOTRUN -> [SKIP][7]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-rkl-4/igt@kms_frontbuffer_tracking@fbcpsr-tiling-4.html

  
Known issues
------------

  Here are the changes found in Patchwork_22601_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@core_setmaster@master-drop-set-shared-fd:
    - shard-skl:          NOTRUN -> [DMESG-WARN][8] ([i915#1982])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-skl2/igt@core_setmaster@master-drop-set-shared-fd.html

  * igt@feature_discovery@psr2:
    - shard-iclb:         [PASS][9] -> [SKIP][10] ([i915#658])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-iclb2/igt@feature_discovery@psr2.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-iclb1/igt@feature_discovery@psr2.html

  * igt@gem_create@create-massive:
    - shard-kbl:          NOTRUN -> [DMESG-WARN][11] ([i915#4991]) +1 similar issue
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-kbl3/igt@gem_create@create-massive.html

  * igt@gem_eio@in-flight-contexts-10ms:
    - shard-tglb:         [PASS][12] -> [TIMEOUT][13] ([i915#3063])
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-tglb6/igt@gem_eio@in-flight-contexts-10ms.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-tglb1/igt@gem_eio@in-flight-contexts-10ms.html

  * igt@gem_eio@unwedge-stress:
    - shard-tglb:         [PASS][14] -> [FAIL][15] ([i915#232])
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-tglb7/igt@gem_eio@unwedge-stress.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-tglb8/igt@gem_eio@unwedge-stress.html

  * igt@gem_exec_balancer@parallel-balancer:
    - shard-iclb:         [PASS][16] -> [SKIP][17] ([i915#4525])
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-iclb1/igt@gem_exec_balancer@parallel-balancer.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-iclb8/igt@gem_exec_balancer@parallel-balancer.html

  * igt@gem_exec_balancer@parallel-ordering:
    - shard-kbl:          NOTRUN -> [DMESG-FAIL][18] ([i915#5076])
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-kbl6/igt@gem_exec_balancer@parallel-ordering.html

  * igt@gem_exec_capture@pi@vecs0:
    - shard-skl:          NOTRUN -> [INCOMPLETE][19] ([i915#4547])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-skl4/igt@gem_exec_capture@pi@vecs0.html

  * igt@gem_exec_fair@basic-none-rrul@rcs0:
    - shard-glk:          NOTRUN -> [FAIL][20] ([i915#2842])
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-glk4/igt@gem_exec_fair@basic-none-rrul@rcs0.html

  * igt@gem_exec_fair@basic-none@vcs0:
    - shard-kbl:          [PASS][21] -> [FAIL][22] ([i915#2842])
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-kbl6/igt@gem_exec_fair@basic-none@vcs0.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-kbl1/igt@gem_exec_fair@basic-none@vcs0.html

  * igt@gem_exec_fair@basic-none@vecs0:
    - shard-apl:          [PASS][23] -> [FAIL][24] ([i915#2842])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-apl3/igt@gem_exec_fair@basic-none@vecs0.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-apl3/igt@gem_exec_fair@basic-none@vecs0.html

  * igt@gem_exec_fair@basic-pace-share@rcs0:
    - shard-tglb:         [PASS][25] -> [FAIL][26] ([i915#2842])
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-tglb1/igt@gem_exec_fair@basic-pace-share@rcs0.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-tglb8/igt@gem_exec_fair@basic-pace-share@rcs0.html

  * igt@gem_exec_fair@basic-throttle@rcs0:
    - shard-glk:          [PASS][27] -> [FAIL][28] ([i915#2842])
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-glk5/igt@gem_exec_fair@basic-throttle@rcs0.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-glk7/igt@gem_exec_fair@basic-throttle@rcs0.html
    - shard-iclb:         [PASS][29] -> [FAIL][30] ([i915#2842])
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-iclb2/igt@gem_exec_fair@basic-throttle@rcs0.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-iclb5/igt@gem_exec_fair@basic-throttle@rcs0.html

  * igt@gem_huc_copy@huc-copy:
    - shard-tglb:         [PASS][31] -> [SKIP][32] ([i915#2190])
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-tglb2/igt@gem_huc_copy@huc-copy.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-tglb7/igt@gem_huc_copy@huc-copy.html

  * igt@gem_lmem_swapping@parallel-random-engines:
    - shard-skl:          NOTRUN -> [SKIP][33] ([fdo#109271] / [i915#4613])
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-skl8/igt@gem_lmem_swapping@parallel-random-engines.html

  * igt@gem_ppgtt@blt-vs-render-ctx0:
    - shard-snb:          [PASS][34] -> [DMESG-FAIL][35] ([i915#3692])
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-snb7/igt@gem_ppgtt@blt-vs-render-ctx0.html
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-snb7/igt@gem_ppgtt@blt-vs-render-ctx0.html

  * igt@gem_pxp@create-valid-protected-context:
    - shard-iclb:         NOTRUN -> [SKIP][36] ([i915#4270])
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-iclb6/igt@gem_pxp@create-valid-protected-context.html

  * igt@gem_render_copy@y-tiled-mc-ccs-to-vebox-y-tiled:
    - shard-iclb:         NOTRUN -> [SKIP][37] ([i915#768]) +1 similar issue
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-iclb6/igt@gem_render_copy@y-tiled-mc-ccs-to-vebox-y-tiled.html

  * igt@gem_softpin@allocator-evict-all-engines:
    - shard-glk:          [PASS][38] -> [FAIL][39] ([i915#4171])
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-glk4/igt@gem_softpin@allocator-evict-all-engines.html
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-glk3/igt@gem_softpin@allocator-evict-all-engines.html

  * igt@gem_userptr_blits@coherency-sync:
    - shard-iclb:         NOTRUN -> [SKIP][40] ([fdo#109290])
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-iclb6/igt@gem_userptr_blits@coherency-sync.html

  * igt@gem_userptr_blits@dmabuf-sync:
    - shard-iclb:         NOTRUN -> [SKIP][41] ([i915#3323])
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-iclb6/igt@gem_userptr_blits@dmabuf-sync.html

  * igt@gen3_render_linear_blits:
    - shard-tglb:         NOTRUN -> [SKIP][42] ([fdo#109289])
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-tglb2/igt@gen3_render_linear_blits.html

  * igt@gen9_exec_parse@allowed-single:
    - shard-skl:          [PASS][43] -> [DMESG-WARN][44] ([i915#1436] / [i915#716])
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-skl3/igt@gen9_exec_parse@allowed-single.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-skl9/igt@gen9_exec_parse@allowed-single.html

  * igt@i915_pm_dc@dc3co-vpb-simulation:
    - shard-iclb:         NOTRUN -> [SKIP][45] ([i915#658])
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-iclb6/igt@i915_pm_dc@dc3co-vpb-simulation.html

  * igt@i915_pm_rpm@gem-execbuf-stress-pc8:
    - shard-iclb:         NOTRUN -> [SKIP][46] ([fdo#109293] / [fdo#109506])
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-iclb6/igt@i915_pm_rpm@gem-execbuf-stress-pc8.html

  * igt@kms_big_fb@4-tiled-32bpp-rotate-90:
    - shard-iclb:         NOTRUN -> [SKIP][47] ([i915#5286]) +1 similar issue
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-iclb6/igt@kms_big_fb@4-tiled-32bpp-rotate-90.html

  * igt@kms_big_fb@x-tiled-max-hw-stride-32bpp-rotate-0-hflip:
    - shard-skl:          NOTRUN -> [SKIP][48] ([fdo#109271] / [i915#3777])
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-skl8/igt@kms_big_fb@x-tiled-max-hw-stride-32bpp-rotate-0-hflip.html

  * igt@kms_big_fb@x-tiled-max-hw-stride-64bpp-rotate-180-async-flip:
    - shard-skl:          NOTRUN -> [FAIL][49] ([i915#3743])
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-skl2/igt@kms_big_fb@x-tiled-max-hw-stride-64bpp-rotate-180-async-flip.html

  * igt@kms_big_fb@y-tiled-max-hw-stride-64bpp-rotate-0-hflip-async-flip:
    - shard-kbl:          NOTRUN -> [SKIP][50] ([fdo#109271] / [i915#3777]) +2 similar issues
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-kbl1/igt@kms_big_fb@y-tiled-max-hw-stride-64bpp-rotate-0-hflip-async-flip.html
    - shard-apl:          NOTRUN -> [SKIP][51] ([fdo#109271] / [i915#3777])
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-apl7/igt@kms_big_fb@y-tiled-max-hw-stride-64bpp-rotate-0-hflip-async-flip.html

  * igt@kms_ccs@pipe-a-bad-pixel-format-y_tiled_gen12_rc_ccs_cc:
    - shard-skl:          NOTRUN -> [SKIP][52] ([fdo#109271] / [i915#3886]) +3 similar issues
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-skl8/igt@kms_ccs@pipe-a-bad-pixel-format-y_tiled_gen12_rc_ccs_cc.html

  * igt@kms_ccs@pipe-b-random-ccs-data-y_tiled_gen12_rc_ccs_cc:
    - shard-apl:          NOTRUN -> [SKIP][53] ([fdo#109271] / [i915#3886]) +1 similar issue
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-apl7/igt@kms_ccs@pipe-b-random-ccs-data-y_tiled_gen12_rc_ccs_cc.html

  * igt@kms_ccs@pipe-c-crc-primary-basic-y_tiled_gen12_rc_ccs_cc:
    - shard-glk:          NOTRUN -> [SKIP][54] ([fdo#109271] / [i915#3886])
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-glk4/igt@kms_ccs@pipe-c-crc-primary-basic-y_tiled_gen12_rc_ccs_cc.html

  * igt@kms_ccs@pipe-c-missing-ccs-buffer-y_tiled_gen12_rc_ccs_cc:
    - shard-kbl:          NOTRUN -> [SKIP][55] ([fdo#109271] / [i915#3886]) +2 similar issues
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-kbl1/igt@kms_ccs@pipe-c-missing-ccs-buffer-y_tiled_gen12_rc_ccs_cc.html

  * igt@kms_chamelium@dp-crc-multiple:
    - shard-skl:          NOTRUN -> [SKIP][56] ([fdo#109271] / [fdo#111827]) +3 similar issues
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-skl8/igt@kms_chamelium@dp-crc-multiple.html

  * igt@kms_chamelium@vga-edid-read:
    - shard-apl:          NOTRUN -> [SKIP][57] ([fdo#109271] / [fdo#111827]) +3 similar issues
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-apl7/igt@kms_chamelium@vga-edid-read.html

  * igt@kms_color@pipe-d-ctm-0-5:
    - shard-skl:          NOTRUN -> [SKIP][58] ([fdo#109271]) +60 similar issues
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-skl8/igt@kms_color@pipe-d-ctm-0-5.html

  * igt@kms_color_chamelium@pipe-b-ctm-0-25:
    - shard-kbl:          NOTRUN -> [SKIP][59] ([fdo#109271] / [fdo#111827]) +6 similar issues
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-kbl1/igt@kms_color_chamelium@pipe-b-ctm-0-25.html

  * igt@kms_content_protection@uevent:
    - shard-kbl:          NOTRUN -> [FAIL][60] ([i915#2105])
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-kbl1/igt@kms_content_protection@uevent.html
    - shard-apl:          NOTRUN -> [FAIL][61] ([i915#2105])
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-apl7/igt@kms_content_protection@uevent.html

  * igt@kms_cursor_crc@pipe-d-cursor-256x256-rapid-movement:
    - shard-iclb:         NOTRUN -> [SKIP][62] ([fdo#109278]) +4 similar issues
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-iclb6/igt@kms_cursor_crc@pipe-d-cursor-256x256-rapid-movement.html

  * igt@kms_cursor_crc@pipe-d-cursor-64x21-rapid-movement:
    - shard-apl:          NOTRUN -> [SKIP][63] ([fdo#109271]) +39 similar issues
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-apl7/igt@kms_cursor_crc@pipe-d-cursor-64x21-rapid-movement.html

  * igt@kms_cursor_legacy@flip-vs-cursor-toggle:
    - shard-iclb:         [PASS][64] -> [FAIL][65] ([i915#2346])
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-iclb3/igt@kms_cursor_legacy@flip-vs-cursor-toggle.html
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-iclb7/igt@kms_cursor_legacy@flip-vs-cursor-toggle.html

  * igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@ac-hdmi-a1-hdmi-a2:
    - shard-glk:          [PASS][66] -> [FAIL][67] ([i915#79])
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-glk6/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@ac-hdmi-a1-hdmi-a2.html
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-glk9/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@ac-hdmi-a1-hdmi-a2.html

  * igt@kms_flip@busy-flip@a-edp1:
    - shard-skl:          NOTRUN -> [FAIL][68] ([i915#4628])
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-skl8/igt@kms_flip@busy-flip@a-edp1.html

  * igt@kms_flip@flip-vs-blocking-wf-vblank@b-edp1:
    - shard-skl:          [PASS][69] -> [FAIL][70] ([i915#2122])
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-skl3/igt@kms_flip@flip-vs-blocking-wf-vblank@b-edp1.html
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-skl2/igt@kms_flip@flip-vs-blocking-wf-vblank@b-edp1.html

  * igt@kms_flip_scaled_crc@flip-32bpp-ytileccs-to-64bpp-ytile-downscaling:
    - shard-iclb:         [PASS][71] -> [SKIP][72] ([i915#3701])
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-iclb4/igt@kms_flip_scaled_crc@flip-32bpp-ytileccs-to-64bpp-ytile-downscaling.html
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-iclb2/igt@kms_flip_scaled_crc@flip-32bpp-ytileccs-to-64bpp-ytile-downscaling.html

  * igt@kms_frontbuffer_tracking@psr-2p-scndscrn-pri-indfb-draw-render:
    - shard-glk:          NOTRUN -> [SKIP][73] ([fdo#109271]) +1 similar issue
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-glk4/igt@kms_frontbuffer_tracking@psr-2p-scndscrn-pri-indfb-draw-render.html

  * igt@kms_frontbuffer_tracking@psr-2p-scndscrn-pri-shrfb-draw-mmap-cpu:
    - shard-kbl:          NOTRUN -> [SKIP][74] ([fdo#109271]) +90 similar issues
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-kbl1/igt@kms_frontbuffer_tracking@psr-2p-scndscrn-pri-shrfb-draw-mmap-cpu.html

  * igt@kms_frontbuffer_tracking@psr-2p-scndscrn-shrfb-plflip-blt:
    - shard-iclb:         NOTRUN -> [SKIP][75] ([fdo#109280]) +2 similar issues
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-iclb6/igt@kms_frontbuffer_tracking@psr-2p-scndscrn-shrfb-plflip-blt.html

  * igt@kms_hdr@bpc-switch-dpms@bpc-switch-dpms-edp-1-pipe-a:
    - shard-skl:          [PASS][76] -> [FAIL][77] ([i915#1188])
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-skl9/igt@kms_hdr@bpc-switch-dpms@bpc-switch-dpms-edp-1-pipe-a.html
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-skl2/igt@kms_hdr@bpc-switch-dpms@bpc-switch-dpms-edp-1-pipe-a.html

  * igt@kms_hdr@bpc-switch-suspend@bpc-switch-suspend-edp-1-pipe-a:
    - shard-skl:          NOTRUN -> [FAIL][78] ([i915#1188])
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-skl8/igt@kms_hdr@bpc-switch-suspend@bpc-switch-suspend-edp-1-pipe-a.html

  * igt@kms_multipipe_modeset@basic-max-pipe-crc-check:
    - shard-iclb:         NOTRUN -> [SKIP][79] ([i915#1839])
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-iclb6/igt@kms_multipipe_modeset@basic-max-pipe-crc-check.html

  * igt@kms_pipe_crc_basic@disable-crc-after-crtc-pipe-d:
    - shard-kbl:          NOTRUN -> [SKIP][80] ([fdo#109271] / [i915#533])
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-kbl1/igt@kms_pipe_crc_basic@disable-crc-after-crtc-pipe-d.html

  * igt@kms_plane@plane-panning-bottom-right-suspend@pipe-b-planes:
    - shard-kbl:          [PASS][81] -> [DMESG-WARN][82] ([i915#180]) +4 similar issues
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-kbl1/igt@kms_plane@plane-panning-bottom-right-suspend@pipe-b-planes.html
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-kbl4/igt@kms_plane@plane-panning-bottom-right-suspend@pipe-b-planes.html

  * igt@kms_plane_alpha_blend@pipe-c-alpha-basic:
    - shard-kbl:          NOTRUN -> [FAIL][83] ([fdo#108145] / [i915#265])
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-kbl1/igt@kms_plane_alpha_blend@pipe-c-alpha-basic.html
    - shard-apl:          NOTRUN -> [FAIL][84] ([fdo#108145] / [i915#265])
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-apl7/igt@kms_plane_alpha_blend@pipe-c-alpha-basic.html

  * igt@kms_plane_alpha_blend@pipe-c-constant-alpha-max:
    - shard-skl:          NOTRUN -> [FAIL][85] ([fdo#108145] / [i915#265])
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-skl2/igt@kms_plane_alpha_blend@pipe-c-constant-alpha-max.html

  * igt@kms_plane_scaling@planes-downscale-factor-0-5@pipe-a-edp-1-planes-downscale:
    - shard-iclb:         [PASS][86] -> [SKIP][87] ([i915#5235]) +2 similar issues
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-iclb5/igt@kms_plane_scaling@planes-downscale-factor-0-5@pipe-a-edp-1-planes-downscale.html
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-iclb2/igt@kms_plane_scaling@planes-downscale-factor-0-5@pipe-a-edp-1-planes-downscale.html

  * igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-b-edp-1-scaler-with-clipping-clamping:
    - shard-iclb:         [PASS][88] -> [INCOMPLETE][89] ([i915#5236])
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-iclb5/igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-b-edp-1-scaler-with-clipping-clamping.html
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-iclb2/igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-b-edp-1-scaler-with-clipping-clamping.html

  * igt@kms_psr2_sf@cursor-plane-update-sf:
    - shard-skl:          NOTRUN -> [SKIP][90] ([fdo#109271] / [i915#658]) +1 similar issue
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-skl2/igt@kms_psr2_sf@cursor-plane-update-sf.html

  * igt@kms_psr@psr2_suspend:
    - shard-iclb:         [PASS][91] -> [SKIP][92] ([fdo#109441]) +2 similar issues
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-iclb2/igt@kms_psr@psr2_suspend.html
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-iclb5/igt@kms_psr@psr2_suspend.html

  * igt@perf@polling-parameterized:
    - shard-skl:          [PASS][93] -> [FAIL][94] ([i915#1542])
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-skl9/igt@perf@polling-parameterized.html
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-skl2/igt@perf@polling-parameterized.html

  * igt@prime_vgem@basic-userptr:
    - shard-iclb:         NOTRUN -> [SKIP][95] ([i915#3301])
   [95]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-iclb6/igt@prime_vgem@basic-userptr.html

  * igt@syncobj_timeline@transfer-timeline-point:
    - shard-iclb:         NOTRUN -> [DMESG-FAIL][96] ([i915#5098])
   [96]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-iclb6/igt@syncobj_timeline@transfer-timeline-point.html

  
#### Possible fixes ####

  * igt@fbdev@read:
    - {shard-rkl}:        ([SKIP][97], [SKIP][98]) ([i915#2582]) -> [PASS][99]
   [97]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-rkl-4/igt@fbdev@read.html
   [98]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-rkl-2/igt@fbdev@read.html
   [99]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-rkl-6/igt@fbdev@read.html

  * igt@gem_ctx_isolation@preservation-s3@rcs0:
    - shard-kbl:          [DMESG-WARN][100] ([i915#180]) -> [PASS][101] +2 similar issues
   [100]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-kbl7/igt@gem_ctx_isolation@preservation-s3@rcs0.html
   [101]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-kbl4/igt@gem_ctx_isolation@preservation-s3@rcs0.html

  * igt@gem_eio@kms:
    - shard-tglb:         [FAIL][102] ([i915#232]) -> [PASS][103]
   [102]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-tglb1/igt@gem_eio@kms.html
   [103]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-tglb7/igt@gem_eio@kms.html

  * igt@gem_eio@unwedge-stress:
    - {shard-tglu}:       [TIMEOUT][104] ([i915#3063] / [i915#3648]) -> [PASS][105]
   [104]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-tglu-4/igt@gem_eio@unwedge-stress.html
   [105]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-tglu-1/igt@gem_eio@unwedge-stress.html
    - {shard-rkl}:        [TIMEOUT][106] ([i915#3063]) -> [PASS][107]
   [106]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-rkl-6/igt@gem_eio@unwedge-stress.html
   [107]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-rkl-2/igt@gem_eio@unwedge-stress.html

  * igt@gem_exec_capture@pi@bcs0:
    - shard-skl:          [INCOMPLETE][108] ([i915#4547]) -> [PASS][109]
   [108]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-skl10/igt@gem_exec_capture@pi@bcs0.html
   [109]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-skl4/igt@gem_exec_capture@pi@bcs0.html

  * igt@gem_exec_fair@basic-deadline:
    - shard-kbl:          [FAIL][110] ([i915#2846]) -> [PASS][111]
   [110]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-kbl3/igt@gem_exec_fair@basic-deadline.html
   [111]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-kbl6/igt@gem_exec_fair@basic-deadline.html

  * igt@gem_exec_fair@basic-none-share@rcs0:
    - shard-iclb:         [FAIL][112] ([i915#2842]) -> [PASS][113]
   [112]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-iclb3/igt@gem_exec_fair@basic-none-share@rcs0.html
   [113]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-iclb7/igt@gem_exec_fair@basic-none-share@rcs0.html
    - shard-tglb:         [FAIL][114] ([i915#2842]) -> [PASS][115]
   [114]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-tglb8/igt@gem_exec_fair@basic-none-share@rcs0.html
   [115]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-tglb8/igt@gem_exec_fair@basic-none-share@rcs0.html

  * igt@gen9_exec_parse@allowed-all:
    - shard-glk:          [DMESG-WARN][116] ([i915#1436] / [i915#716]) -> [PASS][117]
   [116]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-glk5/igt@gen9_exec_parse@allowed-all.html
   [117]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-glk4/igt@gen9_exec_parse@allowed-all.html

  * igt@i915_pm_dc@dc6-dpms:
    - {shard-tglu}:       [FAIL][118] ([i915#454]) -> [PASS][119]
   [118]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-tglu-1/igt@i915_pm_dc@dc6-dpms.html
   [119]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-tglu-4/igt@i915_pm_dc@dc6-dpms.html

  * igt@kms_async_flips@crc:
    - {shard-rkl}:        ([SKIP][120], [SKIP][121]) ([i915#1845] / [i915#4098]) -> [PASS][122]
   [120]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-rkl-4/igt@kms_async_flips@crc.html
   [121]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-rkl-2/igt@kms_async_flips@crc.html
   [122]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-rkl-6/igt@kms_async_flips@crc.html

  * igt@kms_big_fb@x-tiled-32bpp-rotate-180:
    - {shard-tglu}:       [DMESG-WARN][123] ([i915#402]) -> [PASS][124]
   [123]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-tglu-1/igt@kms_big_fb@x-tiled-32bpp-rotate-180.html
   [124]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-tglu-4/igt@kms_big_fb@x-tiled-32bpp-rotate-180.html

  * igt@kms_big_fb@x-tiled-max-hw-stride-64bpp-rotate-0:
    - {shard-rkl}:        [SKIP][125] ([i915#1845] / [i915#4098]) -> [PASS][126] +8 similar issues
   [125]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-rkl-2/igt@kms_big_fb@x-tiled-max-hw-stride-64bpp-rotate-0.html
   [126]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-rkl-6/igt@kms_big_fb@x-tiled-max-hw-stride-64bpp-rotate-0.html

  * igt@kms_color@pipe-a-ctm-blue-to-red:
    - {shard-rkl}:        [SKIP][127] ([i915#1149] / [i915#1849] / [i915#4070] / [i915#4098]) -> [PASS][128] +1 similar issue
   [127]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-rkl-2/igt@kms_color@pipe-a-ctm-blue-to-red.html
   [128]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-rkl-6/igt@kms_color@pipe-a-ctm-blue-to-red.html

  * igt@kms_color@pipe-c-invalid-gamma-lut-sizes:
    - {shard-rkl}:        ([SKIP][129], [PASS][130]) ([i915#4070]) -> ([PASS][131], [PASS][132])
   [129]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-rkl-2/igt@kms_color@pipe-c-invalid-gamma-lut-sizes.html
   [130]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-rkl-4/igt@kms_color@pipe-c-invalid-gamma-lut-sizes.html
   [131]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-rkl-5/igt@kms_color@pipe-c-invalid-gamma-lut-sizes.html
   [132]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-rkl-4/igt@kms_color@pipe-c-invalid-gamma-lut-sizes.html

  * igt@kms_cursor_crc@pipe-b-cursor-64x21-random:
    - {shard-rkl}:        [SKIP][133] ([fdo#112022] / [i915#4070]) -> [PASS][134]
   [133]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-rkl-2/igt@kms_cursor_crc@pipe-b-cursor-64x21-random.html
   [134]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-rkl-6/igt@kms_cursor_crc@pipe-b-cursor-64x21-random.html

  * igt@kms_cursor_edge_walk@pipe-a-128x128-top-edge:
    - {shard-rkl}:        ([SKIP][135], [SKIP][136]) ([i915#1849] / [i915#4070] / [i915#4098]) -> [PASS][137]
   [135]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-rkl-4/igt@kms_cursor_edge_walk@pipe-a-128x128-top-edge.html
   [136]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-rkl-2/igt@kms_cursor_edge_walk@pipe-a-128x128-top-edge.html
   [137]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-rkl-6/igt@kms_cursor_edge_walk@pipe-a-128x128-top-edge.html

  * igt@kms_dp_aux_dev:
    - {shard-rkl}:        [SKIP][138] ([i915#1257]) -> [PASS][139]
   [138]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-rkl-2/igt@kms_dp_aux_dev.html
   [139]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-rkl-6/igt@kms_dp_aux_dev.html

  * igt@kms_draw_crc@draw-method-rgb565-pwrite-untiled:
    - {shard-rkl}:        [SKIP][140] ([fdo#111314] / [i915#4098] / [i915#4369]) -> [PASS][141] +1 similar issue
   [140]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-rkl-2/igt@kms_draw_crc@draw-method-rgb565-pwrite-untiled.html
   [141]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/shard-rkl-6/igt@kms_draw_crc@draw-method-rgb565-pwrite-untiled.html

  * igt@kms_flip@flip-vs-expired-vblank-interruptible@a-edp1:
    - shard-iclb:         [FAIL][142] ([i915#79]) -> [PASS][143]
   [142]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11378/shard-iclb8/igt@kms_flip@flip-vs-expired-vblank-interruptible@a-edp1.html
   [143]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwo

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_22601/index.html

[-- Attachment #2: Type: text/html, Size: 33309 bytes --]

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

* Re: [Intel-gfx] [PATCH 02/11] drm/i915/bios: Make copies of VBT data blocks
  2022-03-17 22:18     ` Ville Syrjälä
@ 2022-03-18  9:44       ` Jani Nikula
  0 siblings, 0 replies; 33+ messages in thread
From: Jani Nikula @ 2022-03-18  9:44 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx

On Fri, 18 Mar 2022, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Thu, Mar 17, 2022 at 09:02:46PM +0200, Jani Nikula wrote:
>> On Thu, 17 Mar 2022, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
>> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> >
>> > Make a copy of each VB data block with a guaranteed minimum
>> > size. The extra (if any) will just be left zeroed.
>> 
>> *VBT
>> 
>> >
>> > This means we don't have to worry about going out of bounds
>> > when accessing any of the structure members. Otherwise that
>> > could easliy happen if we simply get the version check wrong,
>> > or if the VBT is broken/malicious.
>> 
>> *easily
>> 
>> >
>> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> 
>> The high level question is if we really want to save the copies until
>> driver remove instead of just during parsing. The lifetime should be
>> mentioned in the commit message, with rationale if you have some.
>
> Sure, I'll amend the commit msg a bit.
>
> I think we at least must move away from the "parse VBT once at
> driver init" idea because that won't ever let us deal with the
> panel_type=0xff->check PnP ID thing. I think I even have a few
> real world VBTs in my stash which have panel_type=0xff, so it's
> not just some theoretical thing.
>
> So we must hang onto the blocks at least until we've finished the
> output setup. But I'm thinking we can just keep them permanently
> and even start thinking about moving away from the "parse once,
> stash results somewhere" mentality. Ie. we could just parse on
> demand instead.

That pretty much aligns with what my direction has been with the child
devices. So gradually start throwing away stuff from i915->vbt, and
instead have some accessors on the opaque list of bdb block entries. I
guess it's going to be a lot of functions, but at least their names can
be self-documenting and they can handle the VBT version differences
cleanly.

>
>> I was wondering about making the copies up front instead of as needed,
>> but that means setting up a list for the min sizes. It would clean up
>> the usage (avoids passing around any pointers to original data to the
>> parsers). Then you could use just find_section(i915, BDB_XXX). Dunno.
>
> At least if we go for the parse on demand apporach then we definitely
> want to do that. Avoids having to deal with kmalloc() fails/etc. while
> parsing.

Agreed.


BR,
Jani.

-- 
Jani Nikula, Intel Open Source Graphics Center

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

end of thread, other threads:[~2022-03-18  9:44 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-17 17:19 [Intel-gfx] [PATCH 00/11] drm/i915/bios: Rework BDB block handling Ville Syrjala
2022-03-17 17:19 ` [Intel-gfx] [PATCH 01/11] drm/i915/bios: Extract struct lvds_lfp_data_ptr_table Ville Syrjala
2022-03-17 18:33   ` Jani Nikula
2022-03-17 17:19 ` [Intel-gfx] [PATCH 02/11] drm/i915/bios: Make copies of VBT data blocks Ville Syrjala
2022-03-17 19:02   ` Jani Nikula
2022-03-17 22:18     ` Ville Syrjälä
2022-03-18  9:44       ` Jani Nikula
2022-03-17 20:21   ` [Intel-gfx] [PATCH v2 " Ville Syrjala
2022-03-17 17:19 ` [Intel-gfx] [PATCH 03/11] drm/i915/bios: Use the copy of the LFP data table always Ville Syrjala
2022-03-17 19:10   ` Jani Nikula
2022-03-17 20:04     ` Ville Syrjälä
2022-03-17 20:08       ` Ville Syrjälä
2022-03-17 20:21   ` [Intel-gfx] [PATCH v2 " Ville Syrjala
2022-03-17 17:19 ` [Intel-gfx] [PATCH 04/11] drm/i915/bios: Validate LFP data table pointers Ville Syrjala
2022-03-17 17:19 ` [Intel-gfx] [PATCH 05/11] drm/i915/bios: Trust the LFP data pointers Ville Syrjala
2022-03-17 17:19 ` [Intel-gfx] [PATCH 06/11] drm/i915/bios: Validate the panel_name table Ville Syrjala
2022-03-17 17:19 ` [Intel-gfx] [PATCH 07/11] drm/i915/bios: Reorder panel DTD parsing Ville Syrjala
2022-03-17 17:19 ` [Intel-gfx] [PATCH 08/11] drm/i915/bios: Generate LFP data table pointers if the VBT lacks them Ville Syrjala
2022-03-17 23:41   ` [Intel-gfx] [PATCH v2 " Ville Syrjala
2022-03-17 17:19 ` [Intel-gfx] [PATCH 09/11] drm/i915/bios: Get access to the tail end of the LFP data block Ville Syrjala
2022-03-17 17:19 ` [Intel-gfx] [PATCH 10/11] drm/i915/bios: Parse the seamless DRRS min refresh rate Ville Syrjala
2022-03-17 17:19 ` [Intel-gfx] [PATCH 11/11] drm/i915: Respect VBT " Ville Syrjala
2022-03-17 17:45 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/bios: Rework BDB block handling Patchwork
2022-03-17 17:46 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-03-17 18:17 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-03-17 20:20 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2022-03-17 22:16 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/bios: Rework BDB block handling (rev3) Patchwork
2022-03-17 22:18 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-03-17 22:48 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-03-18  0:04 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/bios: Rework BDB block handling (rev4) Patchwork
2022-03-18  0:05 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-03-18  0:41 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-03-18  2:54 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork

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.