Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 5/8] drm/mipi-dbi: convert to drm device based logging
Date: Tue, 17 Dec 2019 20:00:11 +0100	[thread overview]
Message-ID: <20191217190011.GD30809@ravnborg.org> (raw)
In-Reply-To: <20191210123050.8799-5-jani.nikula@intel.com>

On Tue, Dec 10, 2019 at 02:30:47PM +0200, Jani Nikula wrote:
> Prefer drm device based logging where possible.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/drm_mipi_dbi.c | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c
> index e34058c721be..86d98e7fc30a 100644
> --- a/drivers/gpu/drm/drm_mipi_dbi.c
> +++ b/drivers/gpu/drm/drm_mipi_dbi.c
> @@ -225,7 +225,7 @@ int mipi_dbi_buf_copy(void *dst, struct drm_framebuffer *fb,
>  		drm_fb_xrgb8888_to_rgb565(dst, src, fb, clip, swap);
>  		break;
>  	default:
> -		dev_err_once(fb->dev->dev, "Format is not supported: %s\n",
> +		drm_err_once(fb->dev, "Format is not supported: %s\n",
>  			     drm_get_format_name(fb->format->format,
>  						 &format_name));
>  		return -EINVAL;
> @@ -242,7 +242,8 @@ static void mipi_dbi_fb_dirty(struct drm_framebuffer *fb, struct drm_rect *rect)
>  {
>  	struct drm_gem_object *gem = drm_gem_fb_get_obj(fb, 0);
>  	struct drm_gem_cma_object *cma_obj = to_drm_gem_cma_obj(gem);
> -	struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(fb->dev);
> +	struct drm_device *dev = fb->dev;

In this file the pattern is to use the variable name "drm" for a
drm_device *. Your changes should follow the same pattern.

	Sam

> +	struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(dev);
>  	unsigned int height = rect->y2 - rect->y1;
>  	unsigned int width = rect->x2 - rect->x1;
>  	struct mipi_dbi *dbi = &dbidev->dbi;
> @@ -259,7 +260,7 @@ static void mipi_dbi_fb_dirty(struct drm_framebuffer *fb, struct drm_rect *rect)
>  
>  	full = width == fb->width && height == fb->height;
>  
> -	DRM_DEBUG_KMS("Flushing [FB:%d] " DRM_RECT_FMT "\n", fb->base.id, DRM_RECT_ARG(rect));
> +	drm_dbg_kms(dev, "Flushing [FB:%d] " DRM_RECT_FMT "\n", fb->base.id, DRM_RECT_ARG(rect));
>  
>  	if (!dbi->dc || !full || swap ||
>  	    fb->format->format == DRM_FORMAT_XRGB8888) {
> @@ -282,7 +283,7 @@ static void mipi_dbi_fb_dirty(struct drm_framebuffer *fb, struct drm_rect *rect)
>  				   width * height * 2);
>  err_msg:
>  	if (ret)
> -		dev_err_once(fb->dev->dev, "Failed to update display %d\n", ret);
> +		drm_err_once(dev, "Failed to update display %d\n", ret);
>  
>  	drm_dev_exit(idx);
>  }
> @@ -649,14 +650,14 @@ EXPORT_SYMBOL(mipi_dbi_display_is_on);
>  
>  static int mipi_dbi_poweron_reset_conditional(struct mipi_dbi_dev *dbidev, bool cond)
>  {
> -	struct device *dev = dbidev->drm.dev;
> +	struct drm_device *dev = &dbidev->drm;
>  	struct mipi_dbi *dbi = &dbidev->dbi;
>  	int ret;
>  
>  	if (dbidev->regulator) {
>  		ret = regulator_enable(dbidev->regulator);
>  		if (ret) {
> -			DRM_DEV_ERROR(dev, "Failed to enable regulator (%d)\n", ret);
> +			drm_err(dev, "Failed to enable regulator (%d)\n", ret);
>  			return ret;
>  		}
>  	}
> @@ -667,7 +668,7 @@ static int mipi_dbi_poweron_reset_conditional(struct mipi_dbi_dev *dbidev, bool
>  	mipi_dbi_hw_reset(dbi);
>  	ret = mipi_dbi_command(dbi, MIPI_DCS_SOFT_RESET);
>  	if (ret) {
> -		DRM_DEV_ERROR(dev, "Failed to send reset command (%d)\n", ret);
> +		drm_err(dev, "Failed to send reset command (%d)\n", ret);
>  		if (dbidev->regulator)
>  			regulator_disable(dbidev->regulator);
>  		return ret;
> -- 
> 2.20.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-12-17 19:00 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-10 12:30 [Intel-gfx] [PATCH 1/8] drm/print: introduce new struct drm_device based logging macros Jani Nikula
2019-12-10 12:30 ` [Intel-gfx] [PATCH 2/8] drm/client: convert to drm device based logging Jani Nikula
2019-12-17 18:51   ` Sam Ravnborg
2019-12-10 12:30 ` [Intel-gfx] [PATCH 3/8] drm/fb-helper: " Jani Nikula
2019-12-17 18:56   ` Sam Ravnborg
2019-12-10 12:30 ` [Intel-gfx] [PATCH 4/8] drm/gem-fb-helper: " Jani Nikula
2019-12-17 18:57   ` Sam Ravnborg
2019-12-19 14:23     ` Jani Nikula
2019-12-10 12:30 ` [Intel-gfx] [PATCH 5/8] drm/mipi-dbi: " Jani Nikula
2019-12-17 19:00   ` Sam Ravnborg [this message]
2019-12-17 19:10     ` Sam Ravnborg
2019-12-10 12:30 ` [Intel-gfx] [PATCH 6/8] drm/atomic: " Jani Nikula
2019-12-12  8:07   ` [Intel-gfx] [6/8] " james qian wang (Arm Technology China)
2019-12-12  8:33     ` Jani Nikula
2019-12-17 19:07   ` [Intel-gfx] [PATCH 6/8] " Sam Ravnborg
2019-12-10 12:30 ` [Intel-gfx] [PATCH 7/8] drm/i915/uc: " Jani Nikula
2019-12-10 12:30 ` [Intel-gfx] [PATCH 8/8] drm/i915/wopcm: " Jani Nikula
2019-12-10 12:34 ` [Intel-gfx] [PATCH 1/8] drm/print: introduce new struct drm_device based logging macros Jani Nikula
2019-12-10 22:07   ` Daniel Vetter
2019-12-10 19:27 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/8] " Patchwork
2019-12-10 19:52 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2019-12-12 21:53 ` [Intel-gfx] [PATCH 1/8] " Sam Ravnborg
2019-12-13 14:41   ` Jani Nikula
2019-12-13 13:48 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/8] drm/print: introduce new struct drm_device based logging macros (rev2) Patchwork
2019-12-13 15:01 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2019-12-13 19:40 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/8] drm/print: introduce new struct drm_device based logging macros (rev3) Patchwork
2019-12-13 20:22 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2019-12-14 16:10 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2019-12-17 14:45 ` [Intel-gfx] [PATCH 1/8] drm/print: introduce new struct drm_device based logging macros Jani Nikula
2019-12-17 16:11   ` Sam Ravnborg

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=20191217190011.GD30809@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    /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