All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
	jani.nikula@intel.com
Subject: [PATCH 4/6] drm/modes: switch to drm device based error logging
Date: Thu,  7 Mar 2024 22:39:36 +0200	[thread overview]
Message-ID: <6cfc5b03385235a6a1bb113c6c506e089aa4dc97.1709843865.git.jani.nikula@intel.com> (raw)
In-Reply-To: <cover.1709843865.git.jani.nikula@intel.com>

Prefer drm_err() over DRM_ERROR().

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/drm_modes.c | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 0fff5a8d4d81..bf0f745dd9bd 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -386,8 +386,8 @@ static int fill_analog_mode(struct drm_device *dev,
 	if (!bt601 &&
 	    (hact_duration_ns < params->hact_ns.min ||
 	     hact_duration_ns > params->hact_ns.max)) {
-		DRM_ERROR("Invalid horizontal active area duration: %uns (min: %u, max %u)\n",
-			  hact_duration_ns, params->hact_ns.min, params->hact_ns.max);
+		drm_err(dev, "Invalid horizontal active area duration: %uns (min: %u, max %u)\n",
+			hact_duration_ns, params->hact_ns.min, params->hact_ns.max);
 		return -EINVAL;
 	}
 
@@ -398,8 +398,8 @@ static int fill_analog_mode(struct drm_device *dev,
 	if (!bt601 &&
 	    (hblk_duration_ns < params->hblk_ns.min ||
 	     hblk_duration_ns > params->hblk_ns.max)) {
-		DRM_ERROR("Invalid horizontal blanking duration: %uns (min: %u, max %u)\n",
-			  hblk_duration_ns, params->hblk_ns.min, params->hblk_ns.max);
+		drm_err(dev, "Invalid horizontal blanking duration: %uns (min: %u, max %u)\n",
+			hblk_duration_ns, params->hblk_ns.min, params->hblk_ns.max);
 		return -EINVAL;
 	}
 
@@ -410,8 +410,8 @@ static int fill_analog_mode(struct drm_device *dev,
 	if (!bt601 &&
 	    (hslen_duration_ns < params->hslen_ns.min ||
 	     hslen_duration_ns > params->hslen_ns.max)) {
-		DRM_ERROR("Invalid horizontal sync duration: %uns (min: %u, max %u)\n",
-			  hslen_duration_ns, params->hslen_ns.min, params->hslen_ns.max);
+		drm_err(dev, "Invalid horizontal sync duration: %uns (min: %u, max %u)\n",
+			hslen_duration_ns, params->hslen_ns.min, params->hslen_ns.max);
 		return -EINVAL;
 	}
 
@@ -422,7 +422,8 @@ static int fill_analog_mode(struct drm_device *dev,
 	if (!bt601 &&
 	    (porches_duration_ns > (params->hfp_ns.max + params->hbp_ns.max) ||
 	     porches_duration_ns < (params->hfp_ns.min + params->hbp_ns.min))) {
-		DRM_ERROR("Invalid horizontal porches duration: %uns\n", porches_duration_ns);
+		drm_err(dev, "Invalid horizontal porches duration: %uns\n",
+			porches_duration_ns);
 		return -EINVAL;
 	}
 
@@ -444,8 +445,8 @@ static int fill_analog_mode(struct drm_device *dev,
 	if (!bt601 &&
 	    (hfp_duration_ns < params->hfp_ns.min ||
 	     hfp_duration_ns > params->hfp_ns.max)) {
-		DRM_ERROR("Invalid horizontal front porch duration: %uns (min: %u, max %u)\n",
-			  hfp_duration_ns, params->hfp_ns.min, params->hfp_ns.max);
+		drm_err(dev, "Invalid horizontal front porch duration: %uns (min: %u, max %u)\n",
+			hfp_duration_ns, params->hfp_ns.min, params->hfp_ns.max);
 		return -EINVAL;
 	}
 
@@ -456,8 +457,8 @@ static int fill_analog_mode(struct drm_device *dev,
 	if (!bt601 &&
 	    (hbp_duration_ns < params->hbp_ns.min ||
 	     hbp_duration_ns > params->hbp_ns.max)) {
-		DRM_ERROR("Invalid horizontal back porch duration: %uns (min: %u, max %u)\n",
-			  hbp_duration_ns, params->hbp_ns.min, params->hbp_ns.max);
+		drm_err(dev, "Invalid horizontal back porch duration: %uns (min: %u, max %u)\n",
+			hbp_duration_ns, params->hbp_ns.min, params->hbp_ns.max);
 		return -EINVAL;
 	}
 
@@ -508,8 +509,8 @@ static int fill_analog_mode(struct drm_device *dev,
 
 	vtotal = vactive + vfp + vslen + vbp;
 	if (params->num_lines != vtotal) {
-		DRM_ERROR("Invalid vertical total: %upx (expected %upx)\n",
-			  vtotal, params->num_lines);
+		drm_err(dev, "Invalid vertical total: %upx (expected %upx)\n",
+			vtotal, params->num_lines);
 		return -EINVAL;
 	}
 
-- 
2.39.2


  parent reply	other threads:[~2024-03-07 20:40 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07 20:39 [PATCH 0/6] drm: debug logging improvements Jani Nikula
2024-03-07 20:39 ` [PATCH 1/6] drm/modes: add drm_mode_print() to dump mode in drm_printer Jani Nikula
2024-04-05  8:45   ` Thomas Zimmermann
2024-04-05 18:45     ` Ville Syrjälä
2024-04-08  9:24       ` Jani Nikula
2024-03-07 20:39 ` [PATCH 2/6] drm/probe-helper: switch to drm device based logging Jani Nikula
2024-03-07 20:39 ` [PATCH 3/6] drm/modes: switch drm_mode_prune_invalid() to use struct drm_printer Jani Nikula
2024-03-07 20:39 ` Jani Nikula [this message]
2024-03-07 20:39 ` [PATCH 5/6] drm/sysfs: switch to drm device based logging Jani Nikula
2024-03-07 20:44   ` Jani Nikula
2024-03-07 20:39 ` [PATCH 6/6] drm/client: switch to drm device based logging, and more Jani Nikula
2024-03-07 20:47   ` Jani Nikula
2024-03-07 20:48 ` ✓ CI.Patch_applied: success for drm: debug logging improvements Patchwork
2024-03-07 20:48 ` ✗ CI.checkpatch: warning " Patchwork
2024-03-07 20:49 ` ✓ CI.KUnit: success " Patchwork
2024-03-07 20:59 ` ✓ CI.Build: " Patchwork
2024-03-07 21:00 ` ✗ CI.Hooks: failure " Patchwork
2024-03-07 21:01 ` ✗ CI.checksparse: warning " Patchwork
2024-03-07 21:42 ` ✓ CI.BAT: success " Patchwork
2024-03-07 23:17 ` ✗ Fi.CI.CHECKPATCH: warning " Patchwork
2024-03-07 23:17 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-03-07 23:32 ` ✓ Fi.CI.BAT: success " Patchwork
2024-03-08 11:09 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-03-14 12:07 ` [PATCH 0/6] " Jani Nikula
2024-04-05  8:55 ` Thomas Zimmermann
2024-04-08  9:26   ` Jani Nikula

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=6cfc5b03385235a6a1bb113c6c506e089aa4dc97.1709843865.git.jani.nikula@intel.com \
    --to=jani.nikula@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    /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 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.