public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "james qian wang (Arm Technology China)" <james.qian.wang@arm.com>
To: Mihail Atanassov <Mihail.Atanassov@arm.com>
Cc: "dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	David Airlie <airlied@linux.ie>,
	Liviu Dudau <Liviu.Dudau@arm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Lowry Li (Arm Technology China)" <Lowry.Li@arm.com>,
	nd <nd@arm.com>, Sean Paul <sean@poorly.run>
Subject: Re: [3/5] drm/komeda: Optionally dump DRM state on interrupts
Date: Fri, 1 Nov 2019 07:17:06 +0000	[thread overview]
Message-ID: <20191101071659.GA30189@jamwan02-TSP300> (raw)
In-Reply-To: <20191021164654.9642-4-mihail.atanassov@arm.com>

On Mon, Oct 21, 2019 at 04:47:24PM +0000, Mihail Atanassov wrote:
> It's potentially useful information when diagnosing error/warn IRQs, so
> dump it to dmesg with a drm_info_printer. Hide this extra debug dumping
> behind another komeda_dev->err_verbosity bit.
> 
> Note that there's not much sense in dumping it for INFO events,
> since the VSYNC event will swamp the log.
> 
> 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   | 5 ++++-
>  drivers/gpu/drm/arm/display/komeda/komeda_event.c | 8 +++++++-
>  2 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> index 831c375180f8..4809000c1efb 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> @@ -205,11 +205,14 @@ struct komeda_dev {
>  	/**
>  	 * @err_verbosity: bitmask for how much extra info to print on error
>  	 *
> -	 * See KOMEDA_DEV_* macros for details.
> +	 * See KOMEDA_DEV_* macros for details. Low byte contains the debug
> +	 * level categories, the high byte contains extra debug options.
>  	 */
>  	u16 err_verbosity;
>  	/* Print a single line per error per frame with error events. */
>  #define KOMEDA_DEV_PRINT_ERR_EVENTS BIT(0)
> +	/* Dump DRM state on an error or warning event. */
> +#define KOMEDA_DEV_PRINT_DUMP_STATE_ON_EVENT BIT(8)
>  };
>  
>  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 575ed4df74ed..5da61e7d75d5 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> @@ -4,6 +4,7 @@
>   * Author: James.Qian.Wang <james.qian.wang@arm.com>
>   *
>   */
> +#include <drm/drm_atomic.h>
>  #include <drm/drm_print.h>
>  
>  #include "komeda_dev.h"
> @@ -113,6 +114,7 @@ void komeda_print_events(struct komeda_events *evts, struct drm_device *dev)
>  	static bool en_print = true;
>  	struct komeda_dev *mdev = dev->dev_private;
>  	u16 const err_verbosity = mdev->err_verbosity;
> +	u64 evts_mask = evts->global | evts->pipes[0] | evts->pipes[1];
>  
>  	/* reduce the same msg print, only print the first evt for one frame */
>  	if (evts->global || is_new_frame(evts))
> @@ -123,9 +125,10 @@ void komeda_print_events(struct komeda_events *evts, struct drm_device *dev)
>  	if (err_verbosity & KOMEDA_DEV_PRINT_ERR_EVENTS)
>  		print_evts |= KOMEDA_ERR_EVENTS;
>  
> -	if ((evts->global | evts->pipes[0] | evts->pipes[1]) & print_evts) {
> +	if (evts_mask & print_evts) {
>  		char msg[256];
>  		struct komeda_str str;
> +		struct drm_printer p = drm_info_printer(dev->dev);
>  
>  		str.str = msg;
>  		str.sz  = sizeof(msg);
> @@ -139,6 +142,9 @@ void komeda_print_events(struct komeda_events *evts, struct drm_device *dev)
>  		evt_str(&str, evts->pipes[1]);
>  
>  		DRM_ERROR("err detect: %s\n", msg);
> +		if ((err_verbosity & KOMEDA_DEV_PRINT_DUMP_STATE_ON_EVENT)
> +		    && (evts_mask & (KOMEDA_ERR_EVENTS | KOMEDA_WARN_EVENTS)))
> +			drm_state_dump(dev, &p);
>  
>  		en_print = false;
>  	}

  reply	other threads:[~2019-11-01  7:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21 16:47 [PATCH 0/5] drm/komeda: Improve IRQ error event prints Mihail Atanassov
2019-10-21 16:47 ` [PATCH 1/5] drm/komeda: Add debugfs node to control error verbosity Mihail Atanassov
2019-11-01  7:14   ` [1/5] " james qian wang (Arm Technology China)
2019-10-21 16:47 ` [PATCH 2/5] drm/komeda: Remove CONFIG_KOMEDA_ERROR_PRINT Mihail Atanassov
2019-11-01  7:16   ` [2/5] " james qian wang (Arm Technology China)
2019-10-21 16:47 ` [PATCH 3/5] drm/komeda: Optionally dump DRM state on interrupts Mihail Atanassov
2019-11-01  7:17   ` james qian wang (Arm Technology China) [this message]
2019-10-21 16:47 ` [PATCH 4/5] drm/komeda: Add option to print WARN- and INFO-level IRQ events Mihail Atanassov
2019-11-01  7:17   ` [4/5] " james qian wang (Arm Technology China)
2019-10-21 16:47 ` [PATCH 5/5] drm/komeda: add rate limiting disable to err_verbosity Mihail Atanassov
2019-11-01  7:18   ` [5/5] " james qian wang (Arm Technology China)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191101071659.GA30189@jamwan02-TSP300 \
    --to=james.qian.wang@arm.com \
    --cc=Liviu.Dudau@arm.com \
    --cc=Lowry.Li@arm.com \
    --cc=Mihail.Atanassov@arm.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nd@arm.com \
    --cc=sean@poorly.run \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox