Sending to intel-gfx.

>-----Original Message-----
>From: Ursulin, Tvrtko
>Sent: Thursday, September 21, 2017 8:16 AM
>To: Srivatsa, Anusha <anusha.sriva...@intel.com>; intel-
>g...@lists.freedektop.org
>Cc: Chris Wilson <ch...@chris-wilson.co.uk>; Vetter, Daniel
><daniel.vet...@intel.com>; Sundaresan, Sujaritha
><sujaritha.sundare...@intel.com>; Mateo Lozano, Oscar
><oscar.ma...@intel.com>; Wajdeczko, Michal <michal.wajdec...@intel.com>
>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-...@lists.freedektop.org
>Cc: Srivatsa, Anusha <anusha.sriva...@intel.com>; Chris Wilson <chris@chris-
>wilson.co.uk>; Ursulin, Tvrtko <tvrtko.ursu...@intel.com>; Vetter, Daniel
><daniel.vet...@intel.com>; Sundaresan, Sujaritha
><sujaritha.sundare...@intel.com>; Mateo Lozano, Oscar
><oscar.ma...@intel.com>; Wajdeczko, Michal <michal.wajdec...@intel.com>
>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 <ch...@chris-wilson.co.uk>
>Cc: Tvrtko ursulin <tvrtko.ursu...@intel.com>
>Cc: Daniel Vetter <daniel.vet...@intel.com>
>Cc: Sujaritha Sundaresan <sujaritha.sundare...@intel.com>
>Cc: Oscar Mateo <oscar.ma...@intel.com>
>Cc: Michal Wajdeczko <michal.wajdec...@intel.com>
>Signed-off-by: Anusha Srivatsa <anusha.sriva...@intel.com>
>---
> 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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to