[5/5] drm/komeda: add rate limiting disable to err_verbosity
diff mbox series

Message ID 20191021164654.9642-6-mihail.atanassov@arm.com
State New
Headers show
Series
  • drm/komeda: Improve IRQ error event prints
Related show

Commit Message

Mihail Atanassov Oct. 21, 2019, 4:47 p.m. UTC
It's possible to get multiple events in a single frame/flip, so add an
option to print them all.

Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com>
---
 drivers/gpu/drm/arm/display/komeda/komeda_dev.h   | 2 ++
 drivers/gpu/drm/arm/display/komeda/komeda_event.c | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

Comments

james qian wang (Arm Technology China) Nov. 1, 2019, 7:18 a.m. UTC | #1
On Mon, Oct 21, 2019 at 04:47:35PM +0000, Mihail Atanassov wrote:
> It's possible to get multiple events in a single frame/flip, so add an
> option to print them all.
> 
> Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com>
Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
> ---
>  drivers/gpu/drm/arm/display/komeda/komeda_dev.h   | 2 ++
>  drivers/gpu/drm/arm/display/komeda/komeda_event.c | 3 ++-
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> index d9fc9c48859a..15f52e304c08 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> @@ -224,6 +224,8 @@ struct komeda_dev {
>  #define KOMEDA_DEV_PRINT_INFO_EVENTS BIT(2)
>  	/* Dump DRM state on an error or warning event. */
>  #define KOMEDA_DEV_PRINT_DUMP_STATE_ON_EVENT BIT(8)
> +	/* Disable rate limiting of event prints (normally one per commit) */
> +#define KOMEDA_DEV_PRINT_DISABLE_RATELIMIT BIT(12)
>  };
>  
>  static inline bool
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_event.c b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> index bf88463bb4d9..86e33fed8a91 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> @@ -119,7 +119,8 @@ void komeda_print_events(struct komeda_events *evts, struct drm_device *dev)
>  	/* reduce the same msg print, only print the first evt for one frame */
>  	if (evts->global || is_new_frame(evts))
>  		en_print = true;
> -	if (!en_print)
> +	if (!(err_verbosity & KOMEDA_DEV_PRINT_DISABLE_RATELIMIT)
> +	    && !en_print)
>  		return;
>  
>  	if (err_verbosity & KOMEDA_DEV_PRINT_ERR_EVENTS)

Patch
diff mbox series

diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
index d9fc9c48859a..15f52e304c08 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
@@ -224,6 +224,8 @@  struct komeda_dev {
 #define KOMEDA_DEV_PRINT_INFO_EVENTS BIT(2)
 	/* Dump DRM state on an error or warning event. */
 #define KOMEDA_DEV_PRINT_DUMP_STATE_ON_EVENT BIT(8)
+	/* Disable rate limiting of event prints (normally one per commit) */
+#define KOMEDA_DEV_PRINT_DISABLE_RATELIMIT BIT(12)
 };
 
 static inline bool
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_event.c b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
index bf88463bb4d9..86e33fed8a91 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_event.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
@@ -119,7 +119,8 @@  void komeda_print_events(struct komeda_events *evts, struct drm_device *dev)
 	/* reduce the same msg print, only print the first evt for one frame */
 	if (evts->global || is_new_frame(evts))
 		en_print = true;
-	if (!en_print)
+	if (!(err_verbosity & KOMEDA_DEV_PRINT_DISABLE_RATELIMIT)
+	    && !en_print)
 		return;
 
 	if (err_verbosity & KOMEDA_DEV_PRINT_ERR_EVENTS)