All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/crc: Only report a single overflow when a CRC fd is opened
@ 2018-04-18 12:51 Maarten Lankhorst
  2018-04-18 15:37 ` Ville Syrjälä
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Maarten Lankhorst @ 2018-04-18 12:51 UTC (permalink / raw)
  To: intel-gfx

This reduces the amount of spam when you debug a CRC reading
program.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/drm_debugfs_crc.c | 9 ++++++++-
 include/drm/drm_debugfs_crc.h     | 3 ++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_debugfs_crc.c b/drivers/gpu/drm/drm_debugfs_crc.c
index 9f8312137cad..5a052c511e62 100644
--- a/drivers/gpu/drm/drm_debugfs_crc.c
+++ b/drivers/gpu/drm/drm_debugfs_crc.c
@@ -139,6 +139,7 @@ static int crtc_crc_data_count(struct drm_crtc_crc *crc)
 static void crtc_crc_cleanup(struct drm_crtc_crc *crc)
 {
 	kfree(crc->entries);
+	crc->overflow = false;
 	crc->entries = NULL;
 	crc->head = 0;
 	crc->tail = 0;
@@ -391,8 +392,14 @@ int drm_crtc_add_crc_entry(struct drm_crtc *crtc, bool has_frame,
 	tail = crc->tail;
 
 	if (CIRC_SPACE(head, tail, DRM_CRC_ENTRIES_NR) < 1) {
+		bool overflow = crc->overflow;
+
+		crc->overflow = true;
 		spin_unlock(&crc->lock);
-		DRM_ERROR("Overflow of CRC buffer, userspace reads too slow.\n");
+
+		if (!overflow)
+			DRM_ERROR("Overflow of CRC buffer, userspace reads too slow.\n");
+
 		return -ENOBUFS;
 	}
 
diff --git a/include/drm/drm_debugfs_crc.h b/include/drm/drm_debugfs_crc.h
index 7d63b1d4adb9..b225eeb30d05 100644
--- a/include/drm/drm_debugfs_crc.h
+++ b/include/drm/drm_debugfs_crc.h
@@ -43,6 +43,7 @@ struct drm_crtc_crc_entry {
  * @lock: protects the fields in this struct
  * @source: name of the currently configured source of CRCs
  * @opened: whether userspace has opened the data file for reading
+ * @overflow: whether an overflow occured.
  * @entries: array of entries, with size of %DRM_CRC_ENTRIES_NR
  * @head: head of circular queue
  * @tail: tail of circular queue
@@ -52,7 +53,7 @@ struct drm_crtc_crc_entry {
 struct drm_crtc_crc {
 	spinlock_t lock;
 	const char *source;
-	bool opened;
+	bool opened, overflow;
 	struct drm_crtc_crc_entry *entries;
 	int head, tail;
 	size_t values_cnt;
-- 
2.17.0

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

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

* Re: [PATCH] drm/crc: Only report a single overflow when a CRC fd is opened
  2018-04-18 12:51 [PATCH] drm/crc: Only report a single overflow when a CRC fd is opened Maarten Lankhorst
@ 2018-04-18 15:37 ` Ville Syrjälä
  2018-07-06 13:08   ` Maarten Lankhorst
  2018-04-18 16:13 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Ville Syrjälä @ 2018-04-18 15:37 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: intel-gfx

On Wed, Apr 18, 2018 at 02:51:21PM +0200, Maarten Lankhorst wrote:
> This reduces the amount of spam when you debug a CRC reading
> program.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  drivers/gpu/drm/drm_debugfs_crc.c | 9 ++++++++-
>  include/drm/drm_debugfs_crc.h     | 3 ++-
>  2 files changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_debugfs_crc.c b/drivers/gpu/drm/drm_debugfs_crc.c
> index 9f8312137cad..5a052c511e62 100644
> --- a/drivers/gpu/drm/drm_debugfs_crc.c
> +++ b/drivers/gpu/drm/drm_debugfs_crc.c
> @@ -139,6 +139,7 @@ static int crtc_crc_data_count(struct drm_crtc_crc *crc)
>  static void crtc_crc_cleanup(struct drm_crtc_crc *crc)
>  {
>  	kfree(crc->entries);
> +	crc->overflow = false;
>  	crc->entries = NULL;
>  	crc->head = 0;
>  	crc->tail = 0;
> @@ -391,8 +392,14 @@ int drm_crtc_add_crc_entry(struct drm_crtc *crtc, bool has_frame,
>  	tail = crc->tail;
>  
>  	if (CIRC_SPACE(head, tail, DRM_CRC_ENTRIES_NR) < 1) {
> +		bool overflow = crc->overflow;

'was_overflow' or something to indicate this is the old value?

> +
> +		crc->overflow = true;
>  		spin_unlock(&crc->lock);
> -		DRM_ERROR("Overflow of CRC buffer, userspace reads too slow.\n");
> +
> +		if (!overflow)
> +			DRM_ERROR("Overflow of CRC buffer, userspace reads too slow.\n");

would make this a bit less confusing perhaps. Now it reads as
"if (no overflow) DRM_ERROR("we have an overflow");" which makes no
sense on the first glance.

Apart from that
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> +
>  		return -ENOBUFS;
>  	}
>  
> diff --git a/include/drm/drm_debugfs_crc.h b/include/drm/drm_debugfs_crc.h
> index 7d63b1d4adb9..b225eeb30d05 100644
> --- a/include/drm/drm_debugfs_crc.h
> +++ b/include/drm/drm_debugfs_crc.h
> @@ -43,6 +43,7 @@ struct drm_crtc_crc_entry {
>   * @lock: protects the fields in this struct
>   * @source: name of the currently configured source of CRCs
>   * @opened: whether userspace has opened the data file for reading
> + * @overflow: whether an overflow occured.
>   * @entries: array of entries, with size of %DRM_CRC_ENTRIES_NR
>   * @head: head of circular queue
>   * @tail: tail of circular queue
> @@ -52,7 +53,7 @@ struct drm_crtc_crc_entry {
>  struct drm_crtc_crc {
>  	spinlock_t lock;
>  	const char *source;
> -	bool opened;
> +	bool opened, overflow;
>  	struct drm_crtc_crc_entry *entries;
>  	int head, tail;
>  	size_t values_cnt;
> -- 
> 2.17.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

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

* ✗ Fi.CI.CHECKPATCH: warning for drm/crc: Only report a single overflow when a CRC fd is opened
  2018-04-18 12:51 [PATCH] drm/crc: Only report a single overflow when a CRC fd is opened Maarten Lankhorst
  2018-04-18 15:37 ` Ville Syrjälä
@ 2018-04-18 16:13 ` Patchwork
  2018-04-18 16:27 ` ✓ Fi.CI.BAT: success " Patchwork
  2018-04-18 21:45 ` ✓ Fi.CI.IGT: " Patchwork
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-04-18 16:13 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: intel-gfx

== Series Details ==

Series: drm/crc: Only report a single overflow when a CRC fd is opened
URL   : https://patchwork.freedesktop.org/series/41897/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
e17f1c739f3f drm/crc: Only report a single overflow when a CRC fd is opened
-:52: WARNING:TYPO_SPELLING: 'occured' may be misspelled - perhaps 'occurred'?
#52: FILE: include/drm/drm_debugfs_crc.h:46:
+ * @overflow: whether an overflow occured.

total: 0 errors, 1 warnings, 0 checks, 37 lines checked

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

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

* ✓ Fi.CI.BAT: success for drm/crc: Only report a single overflow when a CRC fd is opened
  2018-04-18 12:51 [PATCH] drm/crc: Only report a single overflow when a CRC fd is opened Maarten Lankhorst
  2018-04-18 15:37 ` Ville Syrjälä
  2018-04-18 16:13 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
@ 2018-04-18 16:27 ` Patchwork
  2018-04-18 21:45 ` ✓ Fi.CI.IGT: " Patchwork
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-04-18 16:27 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: intel-gfx

== Series Details ==

Series: drm/crc: Only report a single overflow when a CRC fd is opened
URL   : https://patchwork.freedesktop.org/series/41897/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4066 -> Patchwork_8737 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/41897/revisions/1/mbox/

== Known issues ==

  Here are the changes found in Patchwork_8737 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_exec_suspend@basic-s3:
      fi-ivb-3520m:       PASS -> DMESG-WARN (fdo#106084)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      fi-bxt-dsi:         NOTRUN -> INCOMPLETE (fdo#103927)

    
    ==== Possible fixes ====

    igt@gem_mmap_gtt@basic-small-bo-tiledx:
      fi-gdg-551:         FAIL (fdo#102575) -> PASS

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
      fi-ivb-3520m:       DMESG-WARN (fdo#106084) -> PASS

    
  fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
  fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
  fdo#106084 https://bugs.freedesktop.org/show_bug.cgi?id=106084


== Participating hosts (33 -> 32) ==

  Additional (2): fi-glk-j4005 fi-bxt-dsi 
  Missing    (3): fi-ctg-p8600 fi-ilk-m540 fi-skl-6700hq 


== Build changes ==

    * Linux: CI_DRM_4066 -> Patchwork_8737

  CI_DRM_4066: e1fbca4821d0700551df233285a5c28db09fd0f6 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4441: 83ba5b7d3bde48b383df41792fc9c955a5a23bdb @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_8737: e17f1c739f3f4bfe59ec5192330fdea1e109ea34 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4441: e60d247eb359f044caf0c09904da14e39d7adca1 @ git://anongit.freedesktop.org/piglit


== Linux commits ==

e17f1c739f3f drm/crc: Only report a single overflow when a CRC fd is opened

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8737/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.IGT: success for drm/crc: Only report a single overflow when a CRC fd is opened
  2018-04-18 12:51 [PATCH] drm/crc: Only report a single overflow when a CRC fd is opened Maarten Lankhorst
                   ` (2 preceding siblings ...)
  2018-04-18 16:27 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2018-04-18 21:45 ` Patchwork
  3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-04-18 21:45 UTC (permalink / raw)
  To: Maarten Lankhorst; +Cc: intel-gfx

== Series Details ==

Series: drm/crc: Only report a single overflow when a CRC fd is opened
URL   : https://patchwork.freedesktop.org/series/41897/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4066_full -> Patchwork_8737_full =

== Summary - WARNING ==

  Minor unknown changes coming with Patchwork_8737_full need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_8737_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/41897/revisions/1/mbox/

== Possible new issues ==

  Here are the unknown changes that may have been introduced in Patchwork_8737_full:

  === IGT changes ===

    ==== Warnings ====

    igt@gem_exec_schedule@deep-vebox:
      shard-kbl:          PASS -> SKIP

    igt@perf_pmu@rc6:
      shard-kbl:          SKIP -> PASS +1

    
== Known issues ==

  Here are the changes found in Patchwork_8737_full that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
      shard-hsw:          PASS -> FAIL (fdo#102887)

    igt@kms_setmode@basic:
      shard-hsw:          PASS -> FAIL (fdo#99912)

    
    ==== Possible fixes ====

    igt@drv_suspend@forcewake:
      shard-kbl:          INCOMPLETE (fdo#103665) -> PASS

    igt@gem_ppgtt@blt-vs-render-ctx0:
      shard-kbl:          INCOMPLETE (fdo#106023, fdo#103665) -> PASS

    igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy:
      shard-hsw:          FAIL (fdo#105767) -> PASS

    igt@kms_flip@2x-dpms-vs-vblank-race:
      shard-hsw:          FAIL (fdo#103060) -> PASS

    igt@kms_flip@2x-flip-vs-expired-vblank:
      shard-hsw:          FAIL (fdo#102887) -> PASS

    igt@kms_flip@flip-vs-blocking-wf-vblank:
      shard-hsw:          FAIL (fdo#100368) -> PASS

    igt@kms_frontbuffer_tracking@fbc-farfromfence:
      shard-kbl:          DMESG-WARN (fdo#103558, fdo#105602) -> PASS +2

    igt@kms_sysfs_edid_timing:
      shard-apl:          WARN (fdo#100047) -> PASS

    
  fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
  fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
  fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
  fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
  fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
  fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
  fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
  fdo#105767 https://bugs.freedesktop.org/show_bug.cgi?id=105767
  fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912


== Participating hosts (9 -> 4) ==

  Missing    (5): shard-glk8 shard-glk6 shard-glk7 shard-glk shard-glkb 


== Build changes ==

    * Linux: CI_DRM_4066 -> Patchwork_8737

  CI_DRM_4066: e1fbca4821d0700551df233285a5c28db09fd0f6 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4441: 83ba5b7d3bde48b383df41792fc9c955a5a23bdb @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_8737: e17f1c739f3f4bfe59ec5192330fdea1e109ea34 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4441: e60d247eb359f044caf0c09904da14e39d7adca1 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8737/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/crc: Only report a single overflow when a CRC fd is opened
  2018-04-18 15:37 ` Ville Syrjälä
@ 2018-07-06 13:08   ` Maarten Lankhorst
  0 siblings, 0 replies; 6+ messages in thread
From: Maarten Lankhorst @ 2018-07-06 13:08 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx

Op 18-04-18 om 17:37 schreef Ville Syrjälä:
> On Wed, Apr 18, 2018 at 02:51:21PM +0200, Maarten Lankhorst wrote:
>> This reduces the amount of spam when you debug a CRC reading
>> program.
>>
>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> ---
>>  drivers/gpu/drm/drm_debugfs_crc.c | 9 ++++++++-
>>  include/drm/drm_debugfs_crc.h     | 3 ++-
>>  2 files changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_debugfs_crc.c b/drivers/gpu/drm/drm_debugfs_crc.c
>> index 9f8312137cad..5a052c511e62 100644
>> --- a/drivers/gpu/drm/drm_debugfs_crc.c
>> +++ b/drivers/gpu/drm/drm_debugfs_crc.c
>> @@ -139,6 +139,7 @@ static int crtc_crc_data_count(struct drm_crtc_crc *crc)
>>  static void crtc_crc_cleanup(struct drm_crtc_crc *crc)
>>  {
>>  	kfree(crc->entries);
>> +	crc->overflow = false;
>>  	crc->entries = NULL;
>>  	crc->head = 0;
>>  	crc->tail = 0;
>> @@ -391,8 +392,14 @@ int drm_crtc_add_crc_entry(struct drm_crtc *crtc, bool has_frame,
>>  	tail = crc->tail;
>>  
>>  	if (CIRC_SPACE(head, tail, DRM_CRC_ENTRIES_NR) < 1) {
>> +		bool overflow = crc->overflow;
> 'was_overflow' or something to indicate this is the old value?
>
>> +
>> +		crc->overflow = true;
>>  		spin_unlock(&crc->lock);
>> -		DRM_ERROR("Overflow of CRC buffer, userspace reads too slow.\n");
>> +
>> +		if (!overflow)
>> +			DRM_ERROR("Overflow of CRC buffer, userspace reads too slow.\n");
> would make this a bit less confusing perhaps. Now it reads as
> "if (no overflow) DRM_ERROR("we have an overflow");" which makes no
> sense on the first glance.
>
> Apart from that
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Thanks, fixed and pushed to drm-misc-next. :)
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2018-07-06 13:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-18 12:51 [PATCH] drm/crc: Only report a single overflow when a CRC fd is opened Maarten Lankhorst
2018-04-18 15:37 ` Ville Syrjälä
2018-07-06 13:08   ` Maarten Lankhorst
2018-04-18 16:13 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-04-18 16:27 ` ✓ Fi.CI.BAT: success " Patchwork
2018-04-18 21:45 ` ✓ Fi.CI.IGT: " Patchwork

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.