All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 1/4] tools/intel_bios_reader: Dump the DSI video transfer mode and pixel overlap
@ 2016-12-15 15:24 ville.syrjala
  2016-12-15 15:24 ` [PATCH i-g-t 2/4] tools/intel_reg: Dump some interesting CCK regs on VLV/CHV ville.syrjala
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: ville.syrjala @ 2016-12-15 15:24 UTC (permalink / raw)
  To: intel-gfx

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

Knowing how were trasmitting the data is pretty important, so let's
dump out the video transfer mode and pixel overlap for DSI.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tools/intel_bios.h        | 3 ++-
 tools/intel_bios_reader.c | 8 ++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/intel_bios.h b/tools/intel_bios.h
index 324ef4a759b4..ca0d2c587120 100644
--- a/tools/intel_bios.h
+++ b/tools/intel_bios.h
@@ -743,7 +743,8 @@ struct mipi_config {
 	/* 2 byte Port Description */
 	uint16_t dual_link:2;
 	uint16_t lane_cnt:2;
-	uint16_t rsvd3:12;
+	uint16_t pixel_overlap:3;
+	uint16_t rsvd3:9;
 
 	/* 2 byte DSI COntroller params */
 	/* 0 - Using DSI PHY, 1 - TE usage */
diff --git a/tools/intel_bios_reader.c b/tools/intel_bios_reader.c
index d5297e27c3e7..3455296bc008 100644
--- a/tools/intel_bios_reader.c
+++ b/tools/intel_bios_reader.c
@@ -1046,12 +1046,16 @@ static void dump_mipi_config(struct context *context,
 		printf("RGB888\n");
 	printf("\t\t PPS GPIO Pins: %s \n", config->pwm_blc ? "Using SOC" : "Using PMIC");
 	printf("\t\t CABC Support: %s\n", config->cabc ? "supported" : "not supported");
-	//insert video mode type
 	printf("\t\t Mode: %s\n", config->cmd_mode ? "COMMAND" : "VIDEO");
+	printf("\t\t Video transfer mode: %s (0x%x)\n",
+	       config->vtm == 1 ? "non-burst with sync pulse" :
+	       config->vtm == 2 ? "non-burst with sync events" :
+	       config->vtm == 3 ? "burst" : "<unknown>",
+	       config->vtm);
 	printf("\t\t Dithering: %s\n", config->dithering ? "done in Display Controller" : "done in Panel Controller");
 
 	printf("\tPort Desc\n");
-	//insert pixel overlap count
+	printf("\t\t Pixel overlap: %d\n", config->pixel_overlap);
 	printf("\t\t Lane Count: %d\n", config->lane_cnt + 1);
 	printf("\t\t Dual Link Support: ");
 	if (config->dual_link == 0)
-- 
2.10.2

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

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

* [PATCH i-g-t 2/4] tools/intel_reg: Dump some interesting CCK regs on VLV/CHV
  2016-12-15 15:24 [PATCH i-g-t 1/4] tools/intel_bios_reader: Dump the DSI video transfer mode and pixel overlap ville.syrjala
@ 2016-12-15 15:24 ` ville.syrjala
  2016-12-15 15:24 ` [PATCH i-g-t 3/4] lib/debugfs: Check if debufs is already mounted before attempting to mount it ville.syrjala
  2016-12-15 15:25 ` [PATCH i-g-t 4/4] tools/intel_display_poller: Allow the tool to be used without i915 loaded ville.syrjala
  2 siblings, 0 replies; 4+ messages in thread
From: ville.syrjala @ 2016-12-15 15:24 UTC (permalink / raw)
  To: intel-gfx

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

CCK houses various important clock related registers. Let's
dump those as well.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tools/registers/cherryview  |  1 +
 tools/registers/valleyview  |  1 +
 tools/registers/vlv_cck.txt | 11 +++++++++++
 3 files changed, 13 insertions(+)
 create mode 100644 tools/registers/vlv_cck.txt

diff --git a/tools/registers/cherryview b/tools/registers/cherryview
index 9b94d026b584..47d79acf9c79 100644
--- a/tools/registers/cherryview
+++ b/tools/registers/cherryview
@@ -6,4 +6,5 @@ chv_display_base.txt
 chv_dpio_phy_x2.txt
 chv_dpio_phy_x1.txt
 vlv_dsi.txt
+vlv_cck.txt
 gen7_other.txt
diff --git a/tools/registers/valleyview b/tools/registers/valleyview
index 2611a982a7ef..a4722f54f8eb 100644
--- a/tools/registers/valleyview
+++ b/tools/registers/valleyview
@@ -4,4 +4,5 @@ vlv_display_base.txt
 vlv_dpio_phy.txt
 vlv_dsi.txt
 vlv_flisdsi.txt
+vlv_cck.txt
 gen7_other.txt
diff --git a/tools/registers/vlv_cck.txt b/tools/registers/vlv_cck.txt
new file mode 100644
index 000000000000..60bcdc7f17ba
--- /dev/null
+++ b/tools/registers/vlv_cck.txt
@@ -0,0 +1,11 @@
+('CCK_FUSE_0',				'0x08', 'CCK')
+('CCK_DSI_PLL_FUSE',			'0x44', 'CCK')
+('CCK_DSI_PLL_CONTROL',			'0x48', 'CCK')
+('CCK_DSI_PLL_DIVIDER',			'0x4c', 'CCK')
+('CCK_CZ_CLOCK_CONTROL',		'0x62', 'CCK')
+('CCK_GPLL_CLOCK_CONTROL',		'0x67', 'CCK')
+('CCK_DISPLAY_CLOCK_CONTROL',		'0x6b', 'CCK')
+('CCK_DISPLAY_REF_CLOCK_CONTROL',	'0x6c', 'CCK')
+('CCK_MIPI_ESCAPE_CONTROL',		'0x6d', 'CCK')
+('CCK_DSI0_CONTROL',			'0x6e', 'CCK')
+('CCK_DSI1_CONTROL',			'0x6f', 'CCK')
-- 
2.10.2

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

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

* [PATCH i-g-t 3/4] lib/debugfs: Check if debufs is already mounted before attempting to mount it
  2016-12-15 15:24 [PATCH i-g-t 1/4] tools/intel_bios_reader: Dump the DSI video transfer mode and pixel overlap ville.syrjala
  2016-12-15 15:24 ` [PATCH i-g-t 2/4] tools/intel_reg: Dump some interesting CCK regs on VLV/CHV ville.syrjala
@ 2016-12-15 15:24 ` ville.syrjala
  2016-12-15 15:25 ` [PATCH i-g-t 4/4] tools/intel_display_poller: Allow the tool to be used without i915 loaded ville.syrjala
  2 siblings, 0 replies; 4+ messages in thread
From: ville.syrjala @ 2016-12-15 15:24 UTC (permalink / raw)
  To: intel-gfx

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

mount("/sys/kernel/debug") will return an error if something is already
mounted there. So let's check for that before calling mount(). This
allows many of the tools (eg. intel_reg) to work even when no drm
drivers are loaded since the earlier "/sys/kernel/debug/dri" & co.
path checks will fail in that case and we will fall back to attempting
to mount debugfs ourselves.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 lib/igt_debugfs.c | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index 3d92c6a10a41..5b3167581054 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -89,6 +89,22 @@ typedef struct {
 	char dri_path[128];
 } igt_debugfs_t;
 
+static bool is_mountpoint(const char *path)
+{
+	char buf[strlen(path) + 4];
+	dev_t dot_dev, dotdot_dev;
+	struct stat st;
+
+	igt_assert_lt(snprintf(buf, sizeof(buf), "%s/.", path), sizeof(buf));
+	igt_assert_eq(stat(buf, &st), 0);
+	dot_dev = st.st_dev;
+
+	igt_assert_lt(snprintf(buf, sizeof(buf), "%s/..", path), sizeof(buf));
+	igt_assert_eq(stat(buf, &st), 0);
+	dotdot_dev = st.st_dev;
+
+	return dot_dev != dotdot_dev;
+}
 
 /**
  * igt_debugfs_mount:
@@ -109,8 +125,9 @@ const char *igt_debugfs_mount(void)
 	if (stat("/sys/kernel/debug/dri", &st) == 0)
 		return "/sys/kernel/debug";
 
-	igt_assert(stat("/sys/kernel/debug", &st) == 0);
-	igt_assert(mount("debug", "/sys/kernel/debug", "debugfs", 0, 0) == 0);
+	igt_assert(is_mountpoint("/sys/kernel/debug") ||
+		   mount("debug", "/sys/kernel/debug", "debugfs", 0, 0) == 0);
+
 	return "/sys/kernel/debug";
 }
 
-- 
2.10.2

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

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

* [PATCH i-g-t 4/4] tools/intel_display_poller: Allow the tool to be used without i915 loaded
  2016-12-15 15:24 [PATCH i-g-t 1/4] tools/intel_bios_reader: Dump the DSI video transfer mode and pixel overlap ville.syrjala
  2016-12-15 15:24 ` [PATCH i-g-t 2/4] tools/intel_reg: Dump some interesting CCK regs on VLV/CHV ville.syrjala
  2016-12-15 15:24 ` [PATCH i-g-t 3/4] lib/debugfs: Check if debufs is already mounted before attempting to mount it ville.syrjala
@ 2016-12-15 15:25 ` ville.syrjala
  2 siblings, 0 replies; 4+ messages in thread
From: ville.syrjala @ 2016-12-15 15:25 UTC (permalink / raw)
  To: intel-gfx

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

We don't need the drm fd to find out the PCI device ID. So let's drop
the drm stuff, which allows the tool to work without i915 loaded.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tools/intel_display_poller.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/tools/intel_display_poller.c b/tools/intel_display_poller.c
index eab17c52428e..2129c613652d 100644
--- a/tools/intel_display_poller.c
+++ b/tools/intel_display_poller.c
@@ -961,7 +961,7 @@ static void __attribute__((noreturn)) usage(const char *name)
 
 int main(int argc, char *argv[])
 {
-	int fd, i;
+	int i;
 	int pipe = 0, bit = 0, target_scanline = 0, target_fuzz = 1;
 	bool test_pixelcount = false;
 	uint32_t devid;
@@ -1045,9 +1045,7 @@ int main(int argc, char *argv[])
 		}
 	}
 
-	fd = drm_open_driver(DRIVER_INTEL);
-	devid = intel_get_drm_devid(fd);
-	close(fd);
+	devid = intel_get_pci_device()->device_id;
 
 	/*
 	 * check if the requires registers are
-- 
2.10.2

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

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

end of thread, other threads:[~2016-12-15 15:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-15 15:24 [PATCH i-g-t 1/4] tools/intel_bios_reader: Dump the DSI video transfer mode and pixel overlap ville.syrjala
2016-12-15 15:24 ` [PATCH i-g-t 2/4] tools/intel_reg: Dump some interesting CCK regs on VLV/CHV ville.syrjala
2016-12-15 15:24 ` [PATCH i-g-t 3/4] lib/debugfs: Check if debufs is already mounted before attempting to mount it ville.syrjala
2016-12-15 15:25 ` [PATCH i-g-t 4/4] tools/intel_display_poller: Allow the tool to be used without i915 loaded ville.syrjala

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.