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: [1/5] drm/komeda: Add debugfs node to control error verbosity
Date: Fri, 1 Nov 2019 07:14:37 +0000	[thread overview]
Message-ID: <20191101071429.GA29928@jamwan02-TSP300> (raw)
In-Reply-To: <20191021164654.9642-2-mihail.atanassov@arm.com>

On Mon, Oct 21, 2019 at 04:47:14PM +0000, Mihail Atanassov wrote:
> Named 'err_verbosity', currently with only 1 active bit in that
> replicates the existing level - print error events once per flip.
> 
> Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com>
> ---
>  drivers/gpu/drm/arm/display/komeda/komeda_dev.c   |  4 ++++
>  drivers/gpu/drm/arm/display/komeda/komeda_dev.h   | 14 ++++++++++++--
>  drivers/gpu/drm/arm/display/komeda/komeda_event.c |  9 +++++++--
>  drivers/gpu/drm/arm/display/komeda/komeda_kms.c   |  2 +-
>  4 files changed, 24 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
> index 937a6d4c4865..82230c0ddec3 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c
> @@ -58,6 +58,8 @@ static void komeda_debugfs_init(struct komeda_dev *mdev)
>  	mdev->debugfs_root = debugfs_create_dir("komeda", NULL);
>  	debugfs_create_file("register", 0444, mdev->debugfs_root,
>  			    mdev, &komeda_register_fops);
> +	debugfs_create_x16("err_verbosity", 0664, mdev->debugfs_root,
> +			   &mdev->err_verbosity);
>  }
>  #endif
>  
> @@ -280,6 +282,8 @@ struct komeda_dev *komeda_dev_create(struct device *dev)
>  		goto err_cleanup;
>  	}
>  
> +	mdev->err_verbosity = KOMEDA_DEV_PRINT_ERR_EVENTS;
> +
>  #ifdef CONFIG_DEBUG_FS
>  	komeda_debugfs_init(mdev);
>  #endif
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> index 414200233b64..b5bd3d5898ee 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> @@ -202,6 +202,14 @@ struct komeda_dev {
>  
>  	/** @debugfs_root: root directory of komeda debugfs */
>  	struct dentry *debugfs_root;
> +	/**
> +	 * @err_verbosity: bitmask for how much extra info to print on error
> +	 *
> +	 * See KOMEDA_DEV_* macros for details.
> +	 */
> +	u16 err_verbosity;
> +	/* Print a single line per error per frame with error events. */
> +#define KOMEDA_DEV_PRINT_ERR_EVENTS BIT(0)
>  };
>  
>  static inline bool
> @@ -219,9 +227,11 @@ void komeda_dev_destroy(struct komeda_dev *mdev);
>  struct komeda_dev *dev_to_mdev(struct device *dev);
>  
>  #ifdef CONFIG_DRM_KOMEDA_ERROR_PRINT
> -void komeda_print_events(struct komeda_events *evts);
> +void komeda_print_events(struct komeda_events *evts, struct drm_device *dev);
>  #else
> -static inline void komeda_print_events(struct komeda_events *evts) {}
> +static inline void komeda_print_events(struct komeda_events *evts,
> +				       struct drm_device *dev)
> +{}
>  #endif
>  
>  int komeda_dev_resume(struct komeda_dev *mdev);
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_event.c b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> index a36fb86cc054..575ed4df74ed 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> @@ -107,10 +107,12 @@ static bool is_new_frame(struct komeda_events *a)
>  	       (KOMEDA_EVENT_FLIP | KOMEDA_EVENT_EOW);
>  }
>  
> -void komeda_print_events(struct komeda_events *evts)
> +void komeda_print_events(struct komeda_events *evts, struct drm_device *dev)
>  {
> -	u64 print_evts = KOMEDA_ERR_EVENTS;
> +	u64 print_evts = 0;
>  	static bool en_print = true;
> +	struct komeda_dev *mdev = dev->dev_private;
> +	u16 const err_verbosity = mdev->err_verbosity;
>  
>  	/* reduce the same msg print, only print the first evt for one frame */
>  	if (evts->global || is_new_frame(evts))
> @@ -118,6 +120,9 @@ void komeda_print_events(struct komeda_events *evts)
>  	if (!en_print)
>  		return;
>  
> +	if (err_verbosity & KOMEDA_DEV_PRINT_ERR_EVENTS)
> +		print_evts |= KOMEDA_ERR_EVENTS;
> +
>  	if ((evts->global | evts->pipes[0] | evts->pipes[1]) & print_evts) {
>  		char msg[256];
>  		struct komeda_str str;
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
> index d49772de93e0..e30a5b43caa9 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
> @@ -48,7 +48,7 @@ static irqreturn_t komeda_kms_irq_handler(int irq, void *data)
>  	memset(&evts, 0, sizeof(evts));
>  	status = mdev->funcs->irq_handler(mdev, &evts);
>  
> -	komeda_print_events(&evts);
> +	komeda_print_events(&evts, drm);
>  
>  	/* Notify the crtc to handle the events */
>  	for (i = 0; i < kms->n_crtcs; i++)

thank you for the patch, looks good to me.

BTW: for you question: 
 | These patches are overall quite tiny, and I was considering just
 | squashing them into one, but I opted to keep them separate for an easier
 | review experience; please let me know whether you prefer a single patch.

I like the current single patch. :)

Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>

  reply	other threads:[~2019-11-01  7:15 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   ` james qian wang (Arm Technology China) [this message]
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   ` [3/5] " james qian wang (Arm Technology China)
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=20191101071429.GA29928@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