Skip to contentSkip to conversation

drm/i915: Tracepoints for profiling DC9 entry and exit programming

PATCH In review Sagar Arun Kamble 3 participants 5 messages Jun 17, 2015 – Jun 29, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Tracepoints for profiling DC9 entry and exit programming

DC9 entry and exit programming is critical part of suspend/resume sequences. This patch adds tracepoints that can help analyze time taken using analyze_suspend.py/FTrace.

Change-Id I22fca5313c4349f8937eeb5a1c441c8ef76e5f4e
---
 drivers/gpu/drm/i915/i915_drv.c | 9 +++++++++
 drivers/gpu/drm/i915/i915_reg.h | 1 +
 2 files changed, 10 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +9 -0
index 78ef0bb..6797650 100644
@@ -39,6 +39,7 @@
 #include <linux/module.h>
 #include <linux/pm_runtime.h>
 #include <drm/drm_crtc_helper.h>
+#include <trace/events/power.h>
 
 static struct drm_driver driver;
 
@@ -1061,12 +1062,16 @@ static int bxt_suspend_complete(struct drm_i915_private *dev_priv)
 {
 	struct drm_device *dev = dev_priv->dev;
 
+	trace_suspend_resume(TPS("dc_state_entry"), DC9_STATE, true);
+
 	/* TODO: when DC5 support is added disable DC5 here. */
 
 	broxton_ddi_phy_uninit(dev);
 	broxton_uninit_cdclk(dev);
 	bxt_enable_dc9(dev_priv);
 
+	trace_suspend_resume(TPS("dc_state_entry"), DC9_STATE, false);
+
 	return 0;
 }
 
@@ -1076,6 +1081,8 @@ static int bxt_resume_prepare(struct drm_i915_private *dev_priv)
 
 	/* TODO: when CSR FW support is added make sure the FW is loaded */
 
+	trace_suspend_resume(TPS("dc_state_exit"), DC9_STATE, true);
+
 	bxt_disable_dc9(dev_priv);
 
 	/*
@@ -1086,6 +1093,8 @@ static int bxt_resume_prepare(struct drm_i915_private *dev_priv)
 	broxton_ddi_phy_init(dev);
 	intel_prepare_ddi(dev);
 
+	trace_suspend_resume(TPS("dc_state_exit"), DC9_STATE, false);
+
 	return 0;
 }
 
drivers/gpu/drm/i915/i915_reg.h +1 -0
index 0b979ad..cf83ec8 100644
@@ -7290,6 +7290,7 @@ enum skl_disp_power_wells {
 #define  DC_STATE_EN_DC9		(1<<3)
 #define  DC_STATE_EN_UPTO_DC6		(2<<0)
 #define  DC_STATE_EN_UPTO_DC5_DC6_MASK   0x3
+#define  DC9_STATE			9
 
 #define  DC_STATE_DEBUG                  0x45520
 #define  DC_STATE_DEBUG_MASK_MEMORY_UP	(1<<1)
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 6 lines · Sagar Arun Kamble

DC9 entry and exit programming is critical part of suspend/resume sequences. This patch adds tracepoints that can help analyze time taken using analyze_suspend.py/FTrace.

Change-Id I22fca5313c4349f8937eeb5a1c441c8ef76e5f4e

Tracepoints are for system profiling when benchmarking and all that. What exactly is this here for?

Also note that tracepoints are pretty much ABI, so high standards apply here.
-Daniel

Quoted 71 lines
---
 drivers/gpu/drm/i915/i915_drv.c | 9 +++++++++
 drivers/gpu/drm/i915/i915_reg.h | 1 +
 2 files changed, 10 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +9 -0
index 78ef0bb..6797650 100644
@@ -39,6 +39,7 @@
 #include <linux/module.h>
 #include <linux/pm_runtime.h>
 #include <drm/drm_crtc_helper.h>
+#include <trace/events/power.h>
 
 static struct drm_driver driver;
 
@@ -1061,12 +1062,16 @@ static int bxt_suspend_complete(struct drm_i915_private *dev_priv)
 {
 	struct drm_device *dev = dev_priv->dev;
 
+	trace_suspend_resume(TPS("dc_state_entry"), DC9_STATE, true);
+
 	/* TODO: when DC5 support is added disable DC5 here. */
 
 	broxton_ddi_phy_uninit(dev);
 	broxton_uninit_cdclk(dev);
 	bxt_enable_dc9(dev_priv);
 
+	trace_suspend_resume(TPS("dc_state_entry"), DC9_STATE, false);
+
 	return 0;
 }
 
@@ -1076,6 +1081,8 @@ static int bxt_resume_prepare(struct drm_i915_private *dev_priv)
 
 	/* TODO: when CSR FW support is added make sure the FW is loaded */
 
+	trace_suspend_resume(TPS("dc_state_exit"), DC9_STATE, true);
+
 	bxt_disable_dc9(dev_priv);
 
 	/*
@@ -1086,6 +1093,8 @@ static int bxt_resume_prepare(struct drm_i915_private *dev_priv)
 	broxton_ddi_phy_init(dev);
 	intel_prepare_ddi(dev);
 
+	trace_suspend_resume(TPS("dc_state_exit"), DC9_STATE, false);
+
 	return 0;
 }
 
drivers/gpu/drm/i915/i915_reg.h +1 -0
index 0b979ad..cf83ec8 100644
@@ -7290,6 +7290,7 @@ enum skl_disp_power_wells {
 #define  DC_STATE_EN_DC9		(1<<3)
 #define  DC_STATE_EN_UPTO_DC6		(2<<0)
 #define  DC_STATE_EN_UPTO_DC5_DC6_MASK   0x3
+#define  DC9_STATE			9
 
 #define  DC_STATE_DEBUG                  0x45520
 #define  DC_STATE_DEBUG_MASK_MEMORY_UP	(1<<1)
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw
Quoted 10 lines · Daniel Vetter
Quoted 6 lines · Sagar Arun Kamble

DC9 entry and exit programming is critical part of suspend/resume sequences. This patch adds tracepoints that can help analyze time taken using analyze_suspend.py/FTrace.

Change-Id I22fca5313c4349f8937eeb5a1c441c8ef76e5f4e

Tracepoints are for system profiling when benchmarking and all that. What exactly is this here for?

Hi Daniel,
These trace points are added so that we can know how much time is spent in entry/exit programming of DC9 state which is done during runtime/system suspend. Analyzing these times is critical for resume time KPIs.

Quoted 2 lines

Also note that tracepoints are pretty much ABI, so high standards apply here.

Already these tracepoints are present at PM Core level.

Quoted 69 lines

-Daniel

Quoted 67 lines
---
 drivers/gpu/drm/i915/i915_drv.c | 9 +++++++++
 drivers/gpu/drm/i915/i915_reg.h | 1 +
 2 files changed, 10 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +9 -0
index 78ef0bb..6797650 100644
@@ -39,6 +39,7 @@
 #include <linux/module.h>
 #include <linux/pm_runtime.h>
 #include <drm/drm_crtc_helper.h>
+#include <trace/events/power.h>
 
 static struct drm_driver driver;
 
@@ -1061,12 +1062,16 @@ static int bxt_suspend_complete(struct drm_i915_private *dev_priv)
 {
 	struct drm_device *dev = dev_priv->dev;
 
+	trace_suspend_resume(TPS("dc_state_entry"), DC9_STATE, true);
+
 	/* TODO: when DC5 support is added disable DC5 here. */
 
 	broxton_ddi_phy_uninit(dev);
 	broxton_uninit_cdclk(dev);
 	bxt_enable_dc9(dev_priv);
 
+	trace_suspend_resume(TPS("dc_state_entry"), DC9_STATE, false);
+
 	return 0;
 }
 
@@ -1076,6 +1081,8 @@ static int bxt_resume_prepare(struct drm_i915_private *dev_priv)
 
 	/* TODO: when CSR FW support is added make sure the FW is loaded */
 
+	trace_suspend_resume(TPS("dc_state_exit"), DC9_STATE, true);
+
 	bxt_disable_dc9(dev_priv);
 
 	/*
@@ -1086,6 +1093,8 @@ static int bxt_resume_prepare(struct drm_i915_private *dev_priv)
 	broxton_ddi_phy_init(dev);
 	intel_prepare_ddi(dev);
 
+	trace_suspend_resume(TPS("dc_state_exit"), DC9_STATE, false);
+
 	return 0;
 }
 
drivers/gpu/drm/i915/i915_reg.h +1 -0
index 0b979ad..cf83ec8 100644
@@ -7290,6 +7290,7 @@ enum skl_disp_power_wells {
 #define  DC_STATE_EN_DC9		(1<<3)
 #define  DC_STATE_EN_UPTO_DC6		(2<<0)
 #define  DC_STATE_EN_UPTO_DC5_DC6_MASK   0x3
+#define  DC9_STATE			9
 
 #define  DC_STATE_DEBUG                  0x45520
 #define  DC_STATE_DEBUG_MASK_MEMORY_UP	(1<<1)
Signature · 1 line
1.9.1
Quoted 5 lines
Quoted 4 lines

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw
Quoted 9 lines · Sagar Arun Kamble
Quoted 8 lines · Daniel Vetter
Quoted 6 lines · Sagar Arun Kamble

DC9 entry and exit programming is critical part of suspend/resume sequences. This patch adds tracepoints that can help analyze time taken using analyze_suspend.py/FTrace.

Change-Id I22fca5313c4349f8937eeb5a1c441c8ef76e5f4e
Quoted 7 lines
Quoted 2 lines

Tracepoints are for system profiling when benchmarking and all that. What exactly is this here for?

Hi Daniel,
These trace points are added so that we can know how much time is spent in entry/exit programming of DC9 state which is done during runtime/system suspend. Analyzing these times is critical for resume time KPIs.

What's a KPI? Also if we want to instrument our runtime pm interface then I think we should do this across the driver (probably at the power well interface). Also you seem to instrument only suspend resume and not rpm here.

Quoted 3 lines
Quoted 2 lines

Also note that tracepoints are pretty much ABI, so high standards apply here.

Already these tracepoints are present at PM Core level.

You're adding new labels and stuff and (see above) it looks not all that well thought out yet.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tested-by on v1 1/1
#4 lore raw
In reply to Sagar Arun Kamble

Task id: 6596 -------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied

ILK                                  303/303              303/303
SNB                                  312/312              312/312
IVB                                  343/343              343/343

BYT -1 284/284 283/284
HSW 380/380 380/380
-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
*BYT igt@gem_partial_pwrite_pread@reads-display PASS(1) FAIL(1)
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx