Re: [PATCH v2] drm: Replace the deprecated DRM_* logging macros in gem helper files

Athul Raj Kollareth
2025-08-19T11:16:36Z

On Mon, Aug 18, 2025 at 09:42:46PM +0200, Michal Wajdeczko wrote:

> On 8/18/2025 9:20 PM, Athul Raj Kollareth wrote:
> > Replace the DRM_* logging macros used in gem helper files with the appropriate
> > ones specified in /include/drm/drm_print.h.
> >
> > Signed-off-by: Athul Raj Kollareth <krathul3152@gmail.com>
> > ---
> > Changes in v2:
> > - Change drm_gem_objects_lookup() to take a drm_device* argument.
> > - Make appropriate changes to all calls of drm_gem_objects_lookup().
> > ---
> > drivers/accel/rocket/rocket_job.c | 4 ++--
> > drivers/gpu/drm/drm_gem.c | 12 +++++++-----
> > drivers/gpu/drm/drm_gem_dma_helper.c | 2 +-
> > drivers/gpu/drm/panfrost/panfrost_drv.c | 2 +-
> > drivers/gpu/drm/v3d/v3d_submit.c | 2 +-
> > drivers/gpu/drm/vc4/vc4_gem.c | 2 +-
> > include/drm/drm_gem.h | 5 +++--
> > 7 files changed, 16 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/accel/rocket/rocket_job.c b/drivers/accel/rocket/rocket_job.c
> > index 5d4afd692306..db7c50c9ab90 100644
> > --- a/drivers/accel/rocket/rocket_job.c
> > +++ b/drivers/accel/rocket/rocket_job.c
> > @@ -560,14 +560,14 @@ static int rocket_ioctl_submit_job(struct drm_device *dev, struct drm_file *file
> > if (ret)
> > goto out_cleanup_job;
> >
> > - ret = drm_gem_objects_lookup(file, u64_to_user_ptr(job->in_bo_handles),
> > + ret = drm_gem_objects_lookup(dev, file, u64_to_user_ptr(job->in_bo_handles),
> > job->in_bo_handle_count, &rjob->in_bos);
> > if (ret)
> > goto out_cleanup_job;
> >
> > rjob->in_bo_count = job->in_bo_handle_count;
> >
> > - ret = drm_gem_objects_lookup(file, u64_to_user_ptr(job->out_bo_handles),
> > + ret = drm_gem_objects_lookup(dev, file, u64_to_user_ptr(job->out_bo_handles),
> > job->out_bo_handle_count, &rjob->out_bos);
> > if (ret)
> > goto out_cleanup_job;
> > diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
> > index 4a89b6acb6af..ee1e5ded6dd6 100644
> > --- a/drivers/gpu/drm/drm_gem.c
> > +++ b/drivers/gpu/drm/drm_gem.c
> > @@ -102,7 +102,7 @@ drm_gem_init(struct drm_device *dev)
> > vma_offset_manager = drmm_kzalloc(dev, sizeof(*vma_offset_manager),
> > GFP_KERNEL);
> > if (!vma_offset_manager) {
> > - DRM_ERROR("out of memory\n");
> > + drm_err(dev, "out of memory\n");
> > return -ENOMEM;
> > }
> >
> > @@ -764,6 +764,7 @@ static int objects_lookup(struct drm_file *filp, u32 *handle, int count,
> >
> > /**
> > * drm_gem_objects_lookup - look up GEM objects from an array of handles
> > + * @dev: corresponding drm_device
> > * @filp: DRM file private date
> > * @bo_handles: user pointer to array of userspace handle
> > * @count: size of handle array
> > @@ -780,8 +781,9 @@ static int objects_lookup(struct drm_file *filp, u32 *handle, int count,
> > * failure. 0 is returned on success.
> > *
> > */
> > -int drm_gem_objects_lookup(struct drm_file *filp, void __user *bo_handles,
> > - int count, struct drm_gem_object ***objs_out)
> > +int drm_gem_objects_lookup(struct drm_device *dev, struct drm_file *filp,
> > + void __user *bo_handles, int count,
> > + struct drm_gem_object ***objs_out)
> > {
>
> can't we just use:
>
> struct drm_device *dev = filp->minor->dev;
>

Ah, yes. I think I can use that. Thank you.

Best regards,
Athul