All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: jani.nikula@intel.com
Subject: [i-g-t PATCH 05/10] tools/intel_vbt_decode: migrate timing dumping to kernel struct
Date: Mon, 28 Aug 2017 15:19:57 +0300	[thread overview]
Message-ID: <dc8d4ff7e0ab4bf4fec18038e1c9a25fdf425b60.1503922610.git.jani.nikula@intel.com> (raw)
In-Reply-To: <cover.1503922610.git.jani.nikula@intel.com>
In-Reply-To: <cover.1503922610.git.jani.nikula@intel.com>

Adapt the dumping according to the changes, and do what the kernel does.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 tools/intel_bios.h       | 28 ----------------------------
 tools/intel_vbt_decode.c |  9 ++++++---
 tools/intel_vbt_defs.h   | 31 +++++++++++++++++++++++++++++++
 3 files changed, 37 insertions(+), 31 deletions(-)

diff --git a/tools/intel_bios.h b/tools/intel_bios.h
index 65e64ccb41ef..8d1bf7ae0c81 100644
--- a/tools/intel_bios.h
+++ b/tools/intel_bios.h
@@ -155,34 +155,6 @@ struct bdb_child_devices {
 	struct child_device_config children[DEVICE_CHILD_SIZE];
 } __attribute__ ((packed));
 
-struct lvds_dvo_timing {
-	uint16_t clock;		/**< In 10khz */
-	uint8_t hactive_lo;
-	uint8_t hblank_lo;
-	uint8_t hblank_hi:4;
-	uint8_t hactive_hi:4;
-	uint8_t vactive_lo;
-	uint8_t vblank_lo;
-	uint8_t vblank_hi:4;
-	uint8_t vactive_hi:4;
-	uint8_t hsync_off_lo;
-	uint8_t hsync_pulse_width;
-	uint8_t vsync_pulse_width:4;
-	uint8_t vsync_off:4;
-	uint8_t rsvd0:6;
-	uint8_t hsync_off_hi:2;
-	uint8_t h_image;
-	uint8_t v_image;
-	uint8_t max_hv;
-	uint8_t h_border;
-	uint8_t v_border;
-	uint8_t rsvd1:3;
-	uint8_t digital:2;
-	uint8_t vsync_positive:1;
-	uint8_t hsync_positive:1;
-	uint8_t rsvd2:1;
-} __attribute__((packed));
-
 struct blc_struct {
 	uint8_t inverter_type:2;
 	uint8_t inverter_polarity:1;	/* 1 means inverted (0 = max brightness) */
diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
index 836a9783d54e..beb33672835e 100644
--- a/tools/intel_vbt_decode.c
+++ b/tools/intel_vbt_decode.c
@@ -950,7 +950,8 @@ print_detail_timing_data(const struct lvds_dvo_timing *dvo_timing)
 	display = (dvo_timing->hactive_hi << 8) | dvo_timing->hactive_lo;
 	sync_start = display +
 		((dvo_timing->hsync_off_hi << 8) | dvo_timing->hsync_off_lo);
-	sync_end = sync_start + dvo_timing->hsync_pulse_width;
+	sync_end = sync_start + ((dvo_timing->hsync_pulse_width_hi) << 8 |
+				 dvo_timing->hsync_pulse_width_lo);
 	total = display +
 		((dvo_timing->hblank_hi << 8) | dvo_timing->hblank_lo);
 	printf("\thdisplay: %d\n", display);
@@ -959,8 +960,10 @@ print_detail_timing_data(const struct lvds_dvo_timing *dvo_timing)
 	printf("\thtotal: %d\n", total);
 
 	display = (dvo_timing->vactive_hi << 8) | dvo_timing->vactive_lo;
-	sync_start = display + dvo_timing->vsync_off;
-	sync_end = sync_start + dvo_timing->vsync_pulse_width;
+	sync_start = display + ((dvo_timing->vsync_off_hi << 8) |
+				dvo_timing->vsync_off_lo);
+	sync_end = sync_start + ((dvo_timing->vsync_pulse_width_hi << 8) |
+				 dvo_timing->vsync_pulse_width_lo);
 	total = display +
 		((dvo_timing->vblank_hi << 8) | dvo_timing->vblank_lo);
 	printf("\tvdisplay: %d\n", display);
diff --git a/tools/intel_vbt_defs.h b/tools/intel_vbt_defs.h
index 5481304d2ac2..8bdb2292747b 100644
--- a/tools/intel_vbt_defs.h
+++ b/tools/intel_vbt_defs.h
@@ -379,6 +379,37 @@ struct lvds_fp_timing {
 	u16 terminator;
 } __packed;
 
+struct lvds_dvo_timing {
+	u16 clock;		/**< In 10khz */
+	u8 hactive_lo;
+	u8 hblank_lo;
+	u8 hblank_hi:4;
+	u8 hactive_hi:4;
+	u8 vactive_lo;
+	u8 vblank_lo;
+	u8 vblank_hi:4;
+	u8 vactive_hi:4;
+	u8 hsync_off_lo;
+	u8 hsync_pulse_width_lo;
+	u8 vsync_pulse_width_lo:4;
+	u8 vsync_off_lo:4;
+	u8 vsync_pulse_width_hi:2;
+	u8 vsync_off_hi:2;
+	u8 hsync_pulse_width_hi:2;
+	u8 hsync_off_hi:2;
+	u8 himage_lo;
+	u8 vimage_lo;
+	u8 vimage_hi:4;
+	u8 himage_hi:4;
+	u8 h_border;
+	u8 v_border;
+	u8 rsvd1:3;
+	u8 digital:2;
+	u8 vsync_positive:1;
+	u8 hsync_positive:1;
+	u8 non_interlaced:1;
+} __packed;
+
 struct lvds_pnp_id {
 	u16 mfg_name;
 	u16 product_code;
-- 
2.11.0

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

  parent reply	other threads:[~2017-08-28 12:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-28 12:19 [i-g-t PATCH 00/10] tools/intel_vbt_decode: switch to using kernel intel_vbt_defs.h Jani Nikula
2017-08-28 12:19 ` [i-g-t PATCH 01/10] tools/intel_lid: use local register definition Jani Nikula
2017-08-28 12:19 ` [i-g-t PATCH 02/10] tools/intel_vbt_decode: remove unused definitions from intel_bios.h Jani Nikula
2017-08-28 12:19 ` [i-g-t PATCH 03/10] tools/intel_vbt_decode: clean up struct lvds_dvo_timing Jani Nikula
2017-08-28 12:19 ` [i-g-t PATCH 04/10] tools/intel_vbt_decode: start migrating to kernel intel_vbt_defs.h Jani Nikula
2017-08-28 12:19 ` Jani Nikula [this message]
2017-08-28 12:19 ` [i-g-t PATCH 06/10] tools/intel_vbt_decode: migrate child device dumping to kernel struct Jani Nikula
2017-08-28 12:19 ` [i-g-t PATCH 07/10] tools/intel_vbt_decode: migrate psr " Jani Nikula
2017-08-28 12:20 ` [i-g-t PATCH 08/10] tools/intel_vbt_decode: migrate edp " Jani Nikula
2017-08-28 12:20 ` [i-g-t PATCH 09/10] tools/intel_vbt_decode: migrate child device type bits decoding to kernel defs Jani Nikula
2017-08-28 12:20 ` [i-g-t PATCH 10/10] tools/intel_vbt_defs: migrate backlight dumping to kernel struct Jani Nikula
2017-08-28 12:46 ` ✓ Fi.CI.BAT: success for tools/intel_vbt_decode: switch to using kernel intel_vbt_defs.h Patchwork
2017-08-28 15:25 ` ✓ Fi.CI.IGT: " Patchwork
2017-08-28 22:19 ` [i-g-t PATCH 00/10] " Daniel Vetter
2017-08-29 14:31   ` Jani Nikula

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dc8d4ff7e0ab4bf4fec18038e1c9a25fdf425b60.1503922610.git.jani.nikula@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.