Re: [PATCH 1/2] drm/i915/guc: Add GuC Load time to dmesg log.

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

 



Sending to intel-gfx.


>-----Original Message-----
>From: Ursulin, Tvrtko
>Sent: Thursday, September 21, 2017 8:16 AM
>To: Srivatsa, Anusha <anusha.srivatsa@xxxxxxxxx>; intel-
>gfx@xxxxxxxxxxxxxxxxxxxx
>Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>; Vetter, Daniel
><daniel.vetter@xxxxxxxxx>; Sundaresan, Sujaritha
><sujaritha.sundaresan@xxxxxxxxx>; Mateo Lozano, Oscar
><oscar.mateo@xxxxxxxxx>; Wajdeczko, Michal <Michal.Wajdeczko@xxxxxxxxx>
>Subject: RE: [PATCH 1/2] drm/i915/guc: Add GuC Load time to dmesg log.
>
>
>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.

>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 

>Tvrtko
>
>-----Original Message-----
>From: Srivatsa, Anusha
>Sent: Thursday, September 21, 2017 1:44 AM
>To: intel-gfx@xxxxxxxxxxxxxxxxxxxx
>Cc: Srivatsa, Anusha <anusha.srivatsa@xxxxxxxxx>; Chris Wilson <chris@chris-
>wilson.co.uk>; Ursulin, Tvrtko <tvrtko.ursulin@xxxxxxxxx>; Vetter, Daniel
><daniel.vetter@xxxxxxxxx>; Sundaresan, Sujaritha
><sujaritha.sundaresan@xxxxxxxxx>; Mateo Lozano, Oscar
><oscar.mateo@xxxxxxxxx>; Wajdeczko, Michal <Michal.Wajdeczko@xxxxxxxxx>
>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 <chris@xxxxxxxxxxxxxxxxxx>
>Cc: Tvrtko ursulin <tvrtko.ursulin@xxxxxxxxx>
>Cc: Daniel Vetter <daniel.vetter@xxxxxxxxx>
>Cc: Sujaritha Sundaresan <sujaritha.sundaresan@xxxxxxxxx>
>Cc: Oscar Mateo <oscar.mateo@xxxxxxxxx>
>Cc: Michal Wajdeczko <michal.wajdeczko@xxxxxxxxx>
>Signed-off-by: Anusha Srivatsa <anusha.srivatsa@xxxxxxxxx>
>---
> drivers/gpu/drm/i915/intel_guc_loader.c | 7 +++++++
> drivers/gpu/drm/i915/intel_uc.h         | 1 +
> 2 files changed, 8 insertions(+)
>
>diff --git a/drivers/gpu/drm/i915/intel_guc_loader.c
>b/drivers/gpu/drm/i915/intel_guc_loader.c
>index 8b0ae7f..4b1fc55 100644
>--- a/drivers/gpu/drm/i915/intel_guc_loader.c
>+++ b/drivers/gpu/drm/i915/intel_guc_loader.c
>@@ -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;
>@@ -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.
>@@ -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;
> }
>
>diff --git a/drivers/gpu/drm/i915/intel_uc.h b/drivers/gpu/drm/i915/intel_uc.h
>index 7703c9a..749b069 100644
>--- a/drivers/gpu/drm/i915/intel_uc.h
>+++ b/drivers/gpu/drm/i915/intel_uc.h
>@@ -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 {
>--
>2.7.4

_______________________________________________
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