[Intel-xe] [PATCH 2/2] drm/xe: Replace DRM_ERROR() with pr_err()

Gustavo Sousa gustavo.sousa at intel.com
Mon May 29 13:42:51 UTC 2023


Quoting Matt Roper (2023-05-26 18:48:17-03:00)
>On Thu, May 25, 2023 at 09:42:35PM -0300, Gustavo Sousa wrote:
>> The former has been deprecated in favor of the latter.
>
>It has?  I thought generally the goal has been to replace DRM_FOO() with
>drm_foo() (i.e., drm_err() in this case) because then you get nicer
>device-specific output.  Or when we're doing something GT-specific, we
>move to xe_gt_err() so that the useful information about which GT is
>automatically included.

That's what drm_print.h currently says:

  /* NOTE: this is deprecated in favor of pr_err(). */
  #define DRM_ERROR(fmt, ...)                                             \
          __drm_err(fmt, ##__VA_ARGS__)

But, yeah, I believe using pr_err() would be the case when we do not
have a drm_device at hand.

>
>It looks like xe_reg_sr_add() doesn't have a reference to a drm_device
>to use drm_err (I didn't check how hard it would be to plumb down to
>that point), but xe_vm_bind_ioctl() should be able to use drm_err() I
>think?

Hm... Yeah, that's right, we can easily use the drm_device reference in
xe_vm_bind_ioctl(). As for xe_reg_sr_add(), there is only one caller
(rtp_add_sr_entry()) and I believe we could have xe being passed as
argument - I do not think it is worth adding an xe member to struct
xe_reg_sr, at least not this time.

Thanks for the feedback! I'll send a v2.

--
Gustavo Sousa


More information about the Intel-xe mailing list