Skip to contentSkip to conversation

drm/i915/guc: Add GuC Load time to dmesg log.

PATCH Srivatsa, Anusha 2 participants 2 messages Sep 22, 2017 – Sep 25, 2017 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 9108028B3EB68E4CA5158371AB76E601633C4616@IRSMSX106.ger.corp.intel.com

#2 lore raw

Sending to intel-gfx.

Quoted 12 lines

-----Original Message-----
From: Ursulin, Tvrtko
Sent: Thursday, September 21, 2017 8:16 AM
To: Srivatsa, Anusha <[email protected]>; intel- [email protected]
Cc: Chris Wilson <[email protected]>; Vetter, Daniel <[email protected]>; Sundaresan, Sujaritha <[email protected]>; Mateo Lozano, Oscar <[email protected]>; Wajdeczko, Michal <[email protected]>
Subject: RE: [PATCH 1/2] drm/i915/guc: Add GuC Load time to dmesg log.

Quoted 4 lines

Hi,

For some reason this email hasn't appeared on the mailing list so apologies for a lame Outlook reply.

Thanks Tvrtko. I corrected the address.

Quoted 3 lines

I thought we agreed to use a better time source than jiffies (ktime_get()) and also that DRM_NOTE would get emitted only in the case of load time being over some threshold. If it is in realm of normal it should be a normal DRM_DEBUG_DRIVER.

If it is over 20 ms (the threshold) wont DRM_ERROR be a better option? If it is within that limit, then the info will be in DRM_DEBUG_DRIVER from which the QA can pick it.

Anusha

Quoted 94 lines

Tvrtko

-----Original Message-----
From: Srivatsa, Anusha
Sent: Thursday, September 21, 2017 1:44 AM
To: [email protected]
Cc: Srivatsa, Anusha <[email protected]>; Chris Wilson <chris@chris- wilson.co.uk>; Ursulin, Tvrtko <[email protected]>; Vetter, Daniel <[email protected]>; Sundaresan, Sujaritha <[email protected]>; Mateo Lozano, Oscar <[email protected]>; Wajdeczko, Michal <[email protected]>
Subject: [PATCH 1/2] drm/i915/guc: Add GuC Load time to dmesg log.

Calculate the time that GuC takes to load using jiffies. This information could be very useful in determining if GuC is taking unreasonably long time to load in a certain platforms.

v2: Calculate time before logs are collected.
Move the guc_load_time variable as a part of intel_uc_fw struct. Store only final result which is to be exported to debugfs. (Michal) Add the load time in the print message as well.

v3: Remove debugfs entry. Remove local variable guc_finish_load. (Daniel, Tvrtko)

Cc Chris Wilson <[email protected]>
Cc Tvrtko ursulin <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Sujaritha Sundaresan <[email protected]>
Cc Oscar Mateo <[email protected]>
Cc Michal Wajdeczko <[email protected]>

---
drivers/gpu/drm/i915/intel_guc_loader.c | 7 +++++++
drivers/gpu/drm/i915/intel_uc.h | 1 +

2 files changed, 8 insertions(+)
drivers/gpu/drm/i915/intel_guc_loader.c +1 -0
index 8b0ae7f..4b1fc55 100644
@@ -199,6 +199,7 @@ static int guc_ucode_xfer_dma(struct drm_i915_private
 *dev_priv,
 	struct sg_table *sg = vma->pages;
 	u32 status, rsa[UOS_RSA_SCRATCH_MAX_COUNT];
 	int i, ret = 0;
+	unsigned long guc_start_load;
 
 	/* where RSA signature starts */
	offset = guc_fw->rsa_offset;
drivers/gpu/drm/i915/intel_guc_loader.c +1 -0
@@ -226,6 +227,7 @@ static int guc_ucode_xfer_dma(struct drm_i915_private
 *dev_priv,
 
 	/* Finally start the DMA */
 	I915_WRITE(DMA_CTRL, _MASKED_BIT_ENABLE(UOS_MOVE |
 START_DMA));
+	guc_start_load = jiffies;
 
	/*
	 * Wait for the DMA to complete & the GuC to start up.
drivers/gpu/drm/i915/intel_guc_loader.c +5 -0
@@ -237,6 +239,8 @@ static int guc_ucode_xfer_dma(struct drm_i915_private
 *dev_priv,
 	 */
 	ret = wait_for(guc_ucode_response(dev_priv, &status), 100);
 
+	guc_fw->load_time = jiffies_to_msecs(jiffies - guc_start_load);
+
 	DRM_DEBUG_DRIVER("DMA status 0x%x, GuC status 0x%x\n",
 			I915_READ(DMA_CTRL), status);
@@ -372,6 +376,9 @@ int intel_guc_init_hw(struct intel_guc *guc)
 		 guc->fw.path,
 		 guc->fw.major_ver_found, guc->fw.minor_ver_found);
 
+	DRM_NOTE("Time taken to load GuC is %lu ms\n",
+		 guc->fw.load_time);
+
 	return 0;
 }
 
drivers/gpu/drm/i915/intel_uc.h +1 -1
index 7703c9a..749b069 100644
@@ -136,6 +136,7 @@ struct intel_uc_fw {
 	uint32_t rsa_offset;
 	uint32_t ucode_size;
 	uint32_t ucode_offset;
+	unsigned long load_time;
 };
 
 struct intel_guc_log {
--
Quoted 1 line

2.7.4

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

#3 lore raw
Quoted 20 lines · Anusha

Sending to intel-gfx.

Quoted 12 lines

-----Original Message-----
From: Ursulin, Tvrtko
Sent: Thursday, September 21, 2017 8:16 AM
To: Srivatsa, Anusha <[email protected]>; intel- [email protected]
Cc: Chris Wilson <[email protected]>; Vetter, Daniel <[email protected]>; Sundaresan, Sujaritha <[email protected]>; Mateo Lozano, Oscar <[email protected]>; Wajdeczko, Michal <[email protected]>
Subject: RE: [PATCH 1/2] drm/i915/guc: Add GuC Load time to dmesg log.

Quoted 4 lines

Hi,

For some reason this email hasn't appeared on the mailing list so apologies for a lame Outlook reply.

Quoted 7 lines

Thanks Tvrtko. I corrected the address.

Quoted 3 lines

I thought we agreed to use a better time source than jiffies (ktime_get()) and also that DRM_NOTE would get emitted only in the case of load time being over some threshold. If it is in realm of normal it should be a normal DRM_DEBUG_DRIVER.

If it is over 20 ms (the threshold) wont DRM_ERROR be a better option? If it is within that limit, then the info will be in DRM_DEBUG_DRIVER from which the QA can pick it.

Error only if it fails to load I think. DRM_NOTE was for cases when it succeeds but after taking unexpectedly long. Just so it is a level about informational.

Regards,

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