[i-g-t PATCH 07/10] tools/intel_vbt_decode: migrate psr dumping to kernel struct

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



No functional changes.

Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>
---
 tools/intel_bios.h       | 15 ---------------
 tools/intel_vbt_decode.c | 26 ++++++++++++++------------
 tools/intel_vbt_defs.h   | 18 ++++++++++++++++++
 3 files changed, 32 insertions(+), 27 deletions(-)

diff --git a/tools/intel_bios.h b/tools/intel_bios.h
index 3f441a6da17b..f4b0b9795221 100644
--- a/tools/intel_bios.h
+++ b/tools/intel_bios.h
@@ -163,21 +163,6 @@ struct bdb_edp { /* 155 */
 	struct edp_full_link_params full_link_params[16]; /* 199 */
 } __attribute__ ((packed));
 
-struct psr_params {
-	uint8_t full_link:1;
-	uint8_t require_aux_to_wakeup:1;
-	uint8_t rsvd1:6;
-	uint8_t idle_frames:4;
-	uint8_t lines_to_wait:3;
-	uint8_t rsvd2:1;
-	uint16_t tp1_wakeup_time;
-	uint16_t tp2_tp3_wakeup_time;
-} __attribute__ ((packed));
-
-struct bdb_psr {
-	struct psr_params psr[16];
-} __attribute__ ((packed));
-
 /* Block 52 contains MiPi Panel info
  * 6 such enteries will there. Index into correct
  * entery is based on the panel_index in #40 LFP
diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
index 711f29979418..d0b91a3de3ef 100644
--- a/tools/intel_vbt_decode.c
+++ b/tools/intel_vbt_decode.c
@@ -891,7 +891,7 @@ static void dump_edp(struct context *context,
 static void dump_psr(struct context *context,
 		     const struct bdb_block *block)
 {
-	const struct bdb_psr *psr = block->data;
+	const struct bdb_psr *psr_block = block->data;
 	int i;
 
 	/* The same block ID was used for something else before? */
@@ -899,41 +899,43 @@ static void dump_psr(struct context *context,
 		return;
 
 	for (i = 0; i < 16; i++) {
+		const struct psr_table *psr = &psr_block->psr_table[i];
+
 		if (i != context->panel_type && !context->dump_all_panel_types)
 			continue;
 
 		printf("\tPanel %d%s\n", i, context->panel_type == i ? " *" : "");
 
-		printf("\t\tFull link: %s\n", YESNO(psr->psr[i].full_link));
-		printf("\t\tRequire AUX to wakeup: %s\n", YESNO(psr->psr[i].require_aux_to_wakeup));
+		printf("\t\tFull link: %s\n", YESNO(psr->full_link));
+		printf("\t\tRequire AUX to wakeup: %s\n", YESNO(psr->require_aux_to_wakeup));
 
-		switch (psr->psr[i].lines_to_wait) {
+		switch (psr->lines_to_wait) {
 		case 0:
 		case 1:
 			printf("\t\tLines to wait before link standby: %d\n",
-			       psr->psr[i].lines_to_wait);
+			       psr->lines_to_wait);
 			break;
 		case 2:
 		case 3:
 			printf("\t\tLines to wait before link standby: %d\n",
-			       1 << psr->psr[i].lines_to_wait);
+			       1 << psr->lines_to_wait);
 			break;
 		default:
 			printf("\t\tLines to wait before link standby: (unknown) (0x%x)\n",
-			       psr->psr[i].lines_to_wait);
+			       psr->lines_to_wait);
 			break;
 		}
 
 		printf("\t\tIdle frames to for PSR enable: %d\n",
-		       psr->psr[i].idle_frames);
+		       psr->idle_frames);
 
 		printf("\t\tTP1 wakeup time: %d usec (0x%x)\n",
-		       psr->psr[i].tp1_wakeup_time * 100,
-		       psr->psr[i].tp1_wakeup_time);
+		       psr->tp1_wakeup_time * 100,
+		       psr->tp1_wakeup_time);
 
 		printf("\t\tTP2/TP3 wakeup time: %d usec (0x%x)\n",
-		       psr->psr[i].tp2_tp3_wakeup_time * 100,
-		       psr->psr[i].tp2_tp3_wakeup_time);
+		       psr->tp2_tp3_wakeup_time * 100,
+		       psr->tp2_tp3_wakeup_time);
 	}
 }
 
diff --git a/tools/intel_vbt_defs.h b/tools/intel_vbt_defs.h
index dcb6f36443ad..a43ec2d1c02e 100644
--- a/tools/intel_vbt_defs.h
+++ b/tools/intel_vbt_defs.h
@@ -671,7 +671,25 @@ struct bdb_driver_features {
 #define EDP_VSWING_0_8V		2
 #define EDP_VSWING_1_2V		3
 
+struct psr_table {
+	/* Feature bits */
+	u8 full_link:1;
+	u8 require_aux_to_wakeup:1;
+	u8 feature_bits_rsvd:6;
+
+	/* Wait times */
+	u8 idle_frames:4;
+	u8 lines_to_wait:3;
+	u8 wait_times_rsvd:1;
+
+	/* TP wake up time in multiple of 100 */
+	u16 tp1_wakeup_time;
+	u16 tp2_tp3_wakeup_time;
+} __packed;
 
+struct bdb_psr {
+	struct psr_table psr_table[16];
+} __packed;
 
 /*
  * Driver<->VBIOS interaction occurs through scratch bits in
-- 
2.11.0

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




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux