Message ID | 19eab020c57c0fa45acacf4e4a8077e57cd4d561.1722951405.git.jani.nikula@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/i915: remove __i915_printk() | expand |
-----Original Message----- From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of Jani Nikula Sent: Tuesday, August 6, 2024 6:39 AM To: intel-gfx@lists.freedesktop.org Cc: Nikula, Jani <jani.nikula@intel.com> Subject: [PATCH 2/3] drm/i915: remove i915_report_error() > > i915_report_error() has only two users, both in driver probe. I doubt > these cases are worth having a dedicated wrapper to also print bug > reporting info. Just switch them to regular drm_err() and remove the > wrapper. The commit message might be better if worded as such: """ i915_report_error presently acts as a wrapper for __i915_printk. In practice, it would be better to use drm level error reporting wherever possible, so replace all uses of i915_report_error with the equivalent drm_err call. Doing so leaves i915_report_error with no users, so remove it. """ With this change: Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com> -Jonathan Cavitt > > Signed-off-by: Jani Nikula <jani.nikula@intel.com> > --- > drivers/gpu/drm/i915/i915_driver.c | 8 ++++---- > drivers/gpu/drm/i915/i915_utils.h | 3 --- > 2 files changed, 4 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c > index fb8e9c2fcea5..94dca1d8bb15 100644 > --- a/drivers/gpu/drm/i915/i915_driver.c > +++ b/drivers/gpu/drm/i915/i915_driver.c > @@ -451,8 +451,8 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv) > if (HAS_PPGTT(dev_priv)) { > if (intel_vgpu_active(dev_priv) && > !intel_vgpu_has_full_ppgtt(dev_priv)) { > - i915_report_error(dev_priv, > - "incompatible vGPU found, support for isolated ppGTT required\n"); > + drm_err(&dev_priv->drm, > + "incompatible vGPU found, support for isolated ppGTT required\n"); > return -ENXIO; > } > } > @@ -465,8 +465,8 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv) > */ > if (intel_vgpu_active(dev_priv) && > !intel_vgpu_has_hwsp_emulation(dev_priv)) { > - i915_report_error(dev_priv, > - "old vGPU host found, support for HWSP emulation required\n"); > + drm_err(&dev_priv->drm, > + "old vGPU host found, support for HWSP emulation required\n"); > return -ENXIO; > } > } > diff --git a/drivers/gpu/drm/i915/i915_utils.h b/drivers/gpu/drm/i915/i915_utils.h > index 06ec6ceb61d5..feb078ae246f 100644 > --- a/drivers/gpu/drm/i915/i915_utils.h > +++ b/drivers/gpu/drm/i915/i915_utils.h > @@ -49,9 +49,6 @@ void __printf(3, 4) > __i915_printk(struct drm_i915_private *dev_priv, const char *level, > const char *fmt, ...); > > -#define i915_report_error(dev_priv, fmt, ...) \ > - __i915_printk(dev_priv, KERN_ERR, fmt, ##__VA_ARGS__) > - > #if IS_ENABLED(CONFIG_DRM_I915_DEBUG) > > int __i915_inject_probe_error(struct drm_i915_private *i915, int err, > -- > 2.39.2 > >
On 06/08/2024 14:38, Jani Nikula wrote: > i915_report_error() has only two users, both in driver probe. I doubt > these cases are worth having a dedicated wrapper to also print bug > reporting info. Just switch them to regular drm_err() and remove the > wrapper. > > Signed-off-by: Jani Nikula <jani.nikula@intel.com> > --- > drivers/gpu/drm/i915/i915_driver.c | 8 ++++---- > drivers/gpu/drm/i915/i915_utils.h | 3 --- > 2 files changed, 4 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c > index fb8e9c2fcea5..94dca1d8bb15 100644 > --- a/drivers/gpu/drm/i915/i915_driver.c > +++ b/drivers/gpu/drm/i915/i915_driver.c > @@ -451,8 +451,8 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv) > if (HAS_PPGTT(dev_priv)) { > if (intel_vgpu_active(dev_priv) && > !intel_vgpu_has_full_ppgtt(dev_priv)) { > - i915_report_error(dev_priv, > - "incompatible vGPU found, support for isolated ppGTT required\n"); > + drm_err(&dev_priv->drm, > + "incompatible vGPU found, support for isolated ppGTT required\n"); > return -ENXIO; > } > } > @@ -465,8 +465,8 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv) > */ > if (intel_vgpu_active(dev_priv) && > !intel_vgpu_has_hwsp_emulation(dev_priv)) { > - i915_report_error(dev_priv, > - "old vGPU host found, support for HWSP emulation required\n"); > + drm_err(&dev_priv->drm, > + "old vGPU host found, support for HWSP emulation required\n"); > return -ENXIO; > } > } > diff --git a/drivers/gpu/drm/i915/i915_utils.h b/drivers/gpu/drm/i915/i915_utils.h > index 06ec6ceb61d5..feb078ae246f 100644 > --- a/drivers/gpu/drm/i915/i915_utils.h > +++ b/drivers/gpu/drm/i915/i915_utils.h > @@ -49,9 +49,6 @@ void __printf(3, 4) > __i915_printk(struct drm_i915_private *dev_priv, const char *level, > const char *fmt, ...); > > -#define i915_report_error(dev_priv, fmt, ...) \ > - __i915_printk(dev_priv, KERN_ERR, fmt, ##__VA_ARGS__) > - > #if IS_ENABLED(CONFIG_DRM_I915_DEBUG) > > int __i915_inject_probe_error(struct drm_i915_private *i915, int err, Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Regards, Tvrtko
Hi Jani, On Tue, Aug 06, 2024 at 04:38:31PM +0300, Jani Nikula wrote: > i915_report_error() has only two users, both in driver probe. I doubt > these cases are worth having a dedicated wrapper to also print bug > reporting info. Just switch them to regular drm_err() and remove the > wrapper. > > Signed-off-by: Jani Nikula <jani.nikula@intel.com> with the commit log imrpovement suggested by Jonathan: Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> Thanks, Andi
diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c index fb8e9c2fcea5..94dca1d8bb15 100644 --- a/drivers/gpu/drm/i915/i915_driver.c +++ b/drivers/gpu/drm/i915/i915_driver.c @@ -451,8 +451,8 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv) if (HAS_PPGTT(dev_priv)) { if (intel_vgpu_active(dev_priv) && !intel_vgpu_has_full_ppgtt(dev_priv)) { - i915_report_error(dev_priv, - "incompatible vGPU found, support for isolated ppGTT required\n"); + drm_err(&dev_priv->drm, + "incompatible vGPU found, support for isolated ppGTT required\n"); return -ENXIO; } } @@ -465,8 +465,8 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv) */ if (intel_vgpu_active(dev_priv) && !intel_vgpu_has_hwsp_emulation(dev_priv)) { - i915_report_error(dev_priv, - "old vGPU host found, support for HWSP emulation required\n"); + drm_err(&dev_priv->drm, + "old vGPU host found, support for HWSP emulation required\n"); return -ENXIO; } } diff --git a/drivers/gpu/drm/i915/i915_utils.h b/drivers/gpu/drm/i915/i915_utils.h index 06ec6ceb61d5..feb078ae246f 100644 --- a/drivers/gpu/drm/i915/i915_utils.h +++ b/drivers/gpu/drm/i915/i915_utils.h @@ -49,9 +49,6 @@ void __printf(3, 4) __i915_printk(struct drm_i915_private *dev_priv, const char *level, const char *fmt, ...); -#define i915_report_error(dev_priv, fmt, ...) \ - __i915_printk(dev_priv, KERN_ERR, fmt, ##__VA_ARGS__) - #if IS_ENABLED(CONFIG_DRM_I915_DEBUG) int __i915_inject_probe_error(struct drm_i915_private *i915, int err,
i915_report_error() has only two users, both in driver probe. I doubt these cases are worth having a dedicated wrapper to also print bug reporting info. Just switch them to regular drm_err() and remove the wrapper. Signed-off-by: Jani Nikula <jani.nikula@intel.com> --- drivers/gpu/drm/i915/i915_driver.c | 8 ++++---- drivers/gpu/drm/i915/i915_utils.h | 3 --- 2 files changed, 4 insertions(+), 7 deletions(-)