drm: Replace the deprecated DRM_* logging macros in gem helper files
Subsystems (2)
PATCH RESEND v4 1/1 drm: Replace the deprecated DRM_* logging macros in gem helper files
Replace the DRM_* logging macros used in gem helper files with the appropriate ones specified in /include/drm/drm_print.h.
---
Changes in v4:
- Some codestyle corrections.
- Remove OOM error logging in drm_gem_init().
Changes in v3:
- Revert all changes to drm_gem_objects_lookup().
- Use drm_device from minor.
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/gpu/drm/drm_gem.c | 13 +++++++------ drivers/gpu/drm/drm_gem_dma_helper.c | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-)
drivers/gpu/drm/drm_gem.c +7 -6
@@ -102,7 +102,6 @@ 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" );return -ENOMEM ; }
@@ -783,9 +782,10 @@ static int objects_lookup(struct drm_file *filp, u32 *handle, int count,int drm_gem_objects_lookup (struct drm_file *filp,void __user *bo_handles,int count,struct drm_gem_object ***objs_out) { -int ret; -u32 *handles; +struct drm_device *dev = filp->minor->dev;struct drm_gem_object **objs; +u32 *handles; +int ret;if (!count)return 0 ;
@@ -805,7 +805,7 @@ int drm_gem_objects_lookup(struct drm_file *filp, void __user *bo_handles,if (copy_from_user (handles, bo_handles, count *sizeof (u32))) { ret = -EFAULT ; -DRM_DEBUG ("Failed to copy in GEM handles\n" ); +drm_dbg_core (dev,"Failed to copy in GEM handles\n" ); goto out; }
@@ -853,12 +853,13 @@ EXPORT_SYMBOL(drm_gem_object_lookup);long drm_gem_dma_resv_wait (struct drm_file *filep,u32 handle,bool wait_all,unsigned long timeout) { -long ret; +struct drm_device *dev = filep->minor->dev;struct drm_gem_object *obj; +long ret; obj =drm_gem_object_lookup (filep, handle);if (!obj) { -DRM_DEBUG ("Failed to look up GEM BO %d\n" , handle); +drm_dbg_core (dev,"Failed to look up GEM BO %d\n" , handle);return -EINVAL ; }
drivers/gpu/drm/drm_gem_dma_helper.c +1 -1
@@ -582,7 +582,7 @@ drm_gem_dma_prime_import_sg_table_vmap(struct drm_device *dev, ret =dma_buf_vmap_unlocked (attach->dmabuf, &map);if (ret) { -DRM_ERROR ("Failed to vmap PRIME buffer\n" ); +drm_err (dev,"Failed to vmap PRIME buffer\n" );return ERR_PTR (ret); }
Signature · 1 line
2.51.0
Quoted 26 lines · Athul Raj Kollareth
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 <[email protected]>---
Changes in v4:
- Some codestyle corrections.
- Remove OOM error logging indrm_gem_init().Changes in v3:
- Revert all changes todrm_gem_objects_lookup().
- Usedrm_devicefrom minor.Changes in v2:
- Changedrm_gem_objects_lookup()to take a drm_device* argument.
- Make appropriate changes to all calls ofdrm_gem_objects_lookup().--- drivers/gpu/drm/drm_gem.c | 13 +++++++------ drivers/gpu/drm/drm_gem_dma_helper.c | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-)drivers/gpu/drm/drm_gem.c +0
-0
drivers/gpu/drm/drm_gem.c drm_gem_init(struct drm_device *dev) · line 106
Quoted 6 lines
drivers/gpu/drm/drm_gem.c +0
-1@@ -102,7 +102,6 @@ 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" );return -ENOMEM ; }
nit: you can now remove { }, didn't checkpatch.pl complain?
Quoted 44 lines
drivers/gpu/drm/drm_gem.c +7
-5@@ -783,9 +782,10 @@ static int objects_lookup(struct drm_file *filp, u32 *handle, int count,int drm_gem_objects_lookup (struct drm_file *filp,void __user *bo_handles,int count,struct drm_gem_object ***objs_out) { -int ret; -u32 *handles; +struct drm_device *dev = filp->minor->dev;struct drm_gem_object **objs; +u32 *handles; +int ret;if (!count)return 0 ;@@ -805,7 +805,7 @@ int drm_gem_objects_lookup(struct drm_file *filp, void __user *bo_handles,if (copy_from_user (handles, bo_handles, count *sizeof (u32))) { ret = -EFAULT ; -DRM_DEBUG ("Failed to copy in GEM handles\n" ); +drm_dbg_core (dev,"Failed to copy in GEM handles\n" ); goto out; }@@ -853,12 +853,13 @@ EXPORT_SYMBOL(drm_gem_object_lookup);long drm_gem_dma_resv_wait (struct drm_file *filep,u32 handle,bool wait_all,unsigned long timeout) { -long ret; +struct drm_device *dev = filep->minor->dev;struct drm_gem_object *obj; +long ret; obj =drm_gem_object_lookup (filep, handle);if (!obj) { -DRM_DEBUG ("Failed to look up GEM BO %d\n" , handle); +drm_dbg_core (dev,"Failed to look up GEM BO %d\n" , handle);return -EINVAL ; }drivers/gpu/drm/drm_gem_dma_helper.c +0
-0
drivers/gpu/drm/drm_gem_dma_helper.c drm_gem_dma_prime_import_sg_table_vmap(struct drm_device *dev, · line 588
Quoted 8 lines
drivers/gpu/drm/drm_gem_dma_helper.c +1
-1@@ -582,7 +582,7 @@ drm_gem_dma_prime_import_sg_table_vmap(struct drm_device *dev, ret =dma_buf_vmap_unlocked (attach->dmabuf, &map);if (ret) { -DRM_ERROR ("Failed to vmap PRIME buffer\n" ); +drm_err (dev,"Failed to vmap PRIME buffer\n" );return ERR_PTR (ret); }
otherwise LGTM, so with nit fixed:
but you still need someone else to merge it
Quoted 24 lines · Michal Wajdeczko
Quoted 21 lines · Athul Raj Kollareth
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 <[email protected]>---
Changes in v4:
- Some codestyle corrections.
- Remove OOM error logging indrm_gem_init().Changes in v3:
- Revert all changes todrm_gem_objects_lookup().
- Usedrm_devicefrom minor.Changes in v2:
- Changedrm_gem_objects_lookup()to take a drm_device* argument.
- Make appropriate changes to all calls ofdrm_gem_objects_lookup().--- drivers/gpu/drm/drm_gem.c | 13 +++++++------ drivers/gpu/drm/drm_gem_dma_helper.c | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-)
Quoted 13 lines
drivers/gpu/drm/drm_gem.c drm_gem_init(struct drm_device *dev) · line 106
Quoted 11 lines
drivers/gpu/drm/drm_gem.c +0
-1@@ -102,7 +102,6 @@ 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" );return -ENOMEM ; }nit: you can now remove { }, didn't checkpatch.pl complain?
No, it did not.
Quoted 55 lines
Quoted 44 lines
drivers/gpu/drm/drm_gem.c +7
-5@@ -783,9 +782,10 @@ static int objects_lookup(struct drm_file *filp, u32 *handle, int count,int drm_gem_objects_lookup (struct drm_file *filp,void __user *bo_handles,int count,struct drm_gem_object ***objs_out) { -int ret; -u32 *handles; +struct drm_device *dev = filp->minor->dev;struct drm_gem_object **objs; +u32 *handles; +int ret;if (!count)return 0 ;@@ -805,7 +805,7 @@ int drm_gem_objects_lookup(struct drm_file *filp, void __user *bo_handles,if (copy_from_user (handles, bo_handles, count *sizeof (u32))) { ret = -EFAULT ; -DRM_DEBUG ("Failed to copy in GEM handles\n" ); +drm_dbg_core (dev,"Failed to copy in GEM handles\n" ); goto out; }@@ -853,12 +853,13 @@ EXPORT_SYMBOL(drm_gem_object_lookup);long drm_gem_dma_resv_wait (struct drm_file *filep,u32 handle,bool wait_all,unsigned long timeout) { -long ret; +struct drm_device *dev = filep->minor->dev;struct drm_gem_object *obj; +long ret; obj =drm_gem_object_lookup (filep, handle);if (!obj) { -DRM_DEBUG ("Failed to look up GEM BO %d\n" , handle); +drm_dbg_core (dev,"Failed to look up GEM BO %d\n" , handle);return -EINVAL ; }drivers/gpu/drm/drm_gem_dma_helper.c +0
-0drivers/gpu/drm/drm_gem_dma_helper.c drm_gem_dma_prime_import_sg_table_vmap(struct drm_device *dev, · line 588
Quoted 8 lines
drivers/gpu/drm/drm_gem_dma_helper.c +1
-1@@ -582,7 +582,7 @@ drm_gem_dma_prime_import_sg_table_vmap(struct drm_device *dev, ret =dma_buf_vmap_unlocked (attach->dmabuf, &map);if (ret) { -DRM_ERROR ("Failed to vmap PRIME buffer\n" ); +drm_err (dev,"Failed to vmap PRIME buffer\n" );return ERR_PTR (ret); }otherwise LGTM, so with nit fixed:
Quoted 4 lines
Reviewed-by Michal Wajdeczko <[email protected]>but you still need someone else to merge it
Thank you, I will fix it and hopefully get someone to merge it.
Best regards,
Athul
PATCH v5 1/1 drm: Replace the deprecated DRM_* logging macros in gem helper files
In reply to Michal WajdeczkoReplace the DRM_* logging macros used in gem helper files with the appropriate ones specified in /include/drm/drm_print.h.
---
Changes in v5:
- Minor style fix.
Changes in v4:
- Some codestyle corrections.
- Remove OOM error logging in drm_gem_init().
Changes in v3:
- Revert all changes to drm_gem_objects_lookup().
- Use drm_device from minor.
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/gpu/drm/drm_gem.c | 16 ++++++++-------- drivers/gpu/drm/drm_gem_dma_helper.c | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/gpu/drm/drm_gem.c +8 -8
@@ -101,10 +101,8 @@ 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" ); +if (!vma_offset_manager)return -ENOMEM ; - } dev->vma_offset_manager = vma_offset_manager; drm_vma_offset_manager_init(vma_offset_manager,
@@ -783,9 +781,10 @@ static int objects_lookup(struct drm_file *filp, u32 *handle, int count,int drm_gem_objects_lookup (struct drm_file *filp,void __user *bo_handles,int count,struct drm_gem_object ***objs_out) { -int ret; -u32 *handles; +struct drm_device *dev = filp->minor->dev;struct drm_gem_object **objs; +u32 *handles; +int ret;if (!count)return 0 ;
@@ -805,7 +804,7 @@ int drm_gem_objects_lookup(struct drm_file *filp, void __user *bo_handles,if (copy_from_user (handles, bo_handles, count *sizeof (u32))) { ret = -EFAULT ; -DRM_DEBUG ("Failed to copy in GEM handles\n" ); +drm_dbg_core (dev,"Failed to copy in GEM handles\n" ); goto out; }
@@ -853,12 +852,13 @@ EXPORT_SYMBOL(drm_gem_object_lookup);long drm_gem_dma_resv_wait (struct drm_file *filep,u32 handle,bool wait_all,unsigned long timeout) { -long ret; +struct drm_device *dev = filep->minor->dev;struct drm_gem_object *obj; +long ret; obj =drm_gem_object_lookup (filep, handle);if (!obj) { -DRM_DEBUG ("Failed to look up GEM BO %d\n" , handle); +drm_dbg_core (dev,"Failed to look up GEM BO %d\n" , handle);return -EINVAL ; }
drivers/gpu/drm/drm_gem_dma_helper.c +1 -1
@@ -582,7 +582,7 @@ drm_gem_dma_prime_import_sg_table_vmap(struct drm_device *dev, ret =dma_buf_vmap_unlocked (attach->dmabuf, &map);if (ret) { -DRM_ERROR ("Failed to vmap PRIME buffer\n" ); +drm_err (dev,"Failed to vmap PRIME buffer\n" );return ERR_PTR (ret); }
Signature · 1 line
2.51.0
Am 02.09.25 um 20:10 schrieb Athul Raj Kollareth:
Quoted 5 lines
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 <[email protected]>Reviewed-by Michal Wajdeczko <[email protected]>
Quoted 87 lines
---
Changes in v5:
- Minor style fix.Changes in v4:
- Some codestyle corrections.
- Remove OOM error logging indrm_gem_init().Changes in v3:
- Revert all changes todrm_gem_objects_lookup().
- Usedrm_devicefrom minor.Changes in v2:
- Changedrm_gem_objects_lookup()to take a drm_device* argument.
- Make appropriate changes to all calls ofdrm_gem_objects_lookup().--- drivers/gpu/drm/drm_gem.c | 16 ++++++++-------- drivers/gpu/drm/drm_gem_dma_helper.c | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-)drivers/gpu/drm/drm_gem.c +8
-8@@ -101,10 +101,8 @@ 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" ); +if (!vma_offset_manager)return -ENOMEM ; - } dev->vma_offset_manager = vma_offset_manager; drm_vma_offset_manager_init(vma_offset_manager,@@ -783,9 +781,10 @@ static int objects_lookup(struct drm_file *filp, u32 *handle, int count,int drm_gem_objects_lookup (struct drm_file *filp,void __user *bo_handles,int count,struct drm_gem_object ***objs_out) { -int ret; -u32 *handles; +struct drm_device *dev = filp->minor->dev;struct drm_gem_object **objs; +u32 *handles; +int ret;if (!count)return 0 ;@@ -805,7 +804,7 @@ int drm_gem_objects_lookup(struct drm_file *filp, void __user *bo_handles,if (copy_from_user (handles, bo_handles, count *sizeof (u32))) { ret = -EFAULT ; -DRM_DEBUG ("Failed to copy in GEM handles\n" ); +drm_dbg_core (dev,"Failed to copy in GEM handles\n" ); goto out; }@@ -853,12 +852,13 @@ EXPORT_SYMBOL(drm_gem_object_lookup);long drm_gem_dma_resv_wait (struct drm_file *filep,u32 handle,bool wait_all,unsigned long timeout) { -long ret; +struct drm_device *dev = filep->minor->dev;struct drm_gem_object *obj; +long ret; obj =drm_gem_object_lookup (filep, handle);if (!obj) { -DRM_DEBUG ("Failed to look up GEM BO %d\n" , handle); +drm_dbg_core (dev,"Failed to look up GEM BO %d\n" , handle);return -EINVAL ; }drivers/gpu/drm/drm_gem_dma_helper.c +1
-1@@ -582,7 +582,7 @@ drm_gem_dma_prime_import_sg_table_vmap(struct drm_device *dev, ret =dma_buf_vmap_unlocked (attach->dmabuf, &map);if (ret) { -DRM_ERROR ("Failed to vmap PRIME buffer\n" ); +drm_err (dev,"Failed to vmap PRIME buffer\n" );return ERR_PTR (ret); }
Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Thomas Zimmermann
maintainerHi
Am 02.09.25 um 20:10 schrieb Athul Raj Kollareth:
Quoted 2 lines
Replace the DRM_* logging macros used in gem helper files with the appropriate ones specified in /include/drm/drm_print.h.
Added to drm-misc-next. Thanks for the patch.
Best regards
Thomas
Quoted 90 lines
Signed-off-by Athul Raj Kollareth <[email protected]>Reviewed-by Michal Wajdeczko <[email protected]>---
Changes in v5:
- Minor style fix.Changes in v4:
- Some codestyle corrections.
- Remove OOM error logging indrm_gem_init().Changes in v3:
- Revert all changes todrm_gem_objects_lookup().
- Usedrm_devicefrom minor.Changes in v2:
- Changedrm_gem_objects_lookup()to take a drm_device* argument.
- Make appropriate changes to all calls ofdrm_gem_objects_lookup().--- drivers/gpu/drm/drm_gem.c | 16 ++++++++-------- drivers/gpu/drm/drm_gem_dma_helper.c | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-)drivers/gpu/drm/drm_gem.c +8
-8@@ -101,10 +101,8 @@ 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" ); +if (!vma_offset_manager)return -ENOMEM ; - } dev->vma_offset_manager = vma_offset_manager; drm_vma_offset_manager_init(vma_offset_manager,@@ -783,9 +781,10 @@ static int objects_lookup(struct drm_file *filp, u32 *handle, int count,int drm_gem_objects_lookup (struct drm_file *filp,void __user *bo_handles,int count,struct drm_gem_object ***objs_out) { -int ret; -u32 *handles; +struct drm_device *dev = filp->minor->dev;struct drm_gem_object **objs; +u32 *handles; +int ret;if (!count)return 0 ;@@ -805,7 +804,7 @@ int drm_gem_objects_lookup(struct drm_file *filp, void __user *bo_handles,if (copy_from_user (handles, bo_handles, count *sizeof (u32))) { ret = -EFAULT ; -DRM_DEBUG ("Failed to copy in GEM handles\n" ); +drm_dbg_core (dev,"Failed to copy in GEM handles\n" ); goto out; }@@ -853,12 +852,13 @@ EXPORT_SYMBOL(drm_gem_object_lookup);long drm_gem_dma_resv_wait (struct drm_file *filep,u32 handle,bool wait_all,unsigned long timeout) { -long ret; +struct drm_device *dev = filep->minor->dev;struct drm_gem_object *obj; +long ret; obj =drm_gem_object_lookup (filep, handle);if (!obj) { -DRM_DEBUG ("Failed to look up GEM BO %d\n" , handle); +drm_dbg_core (dev,"Failed to look up GEM BO %d\n" , handle);return -EINVAL ; }drivers/gpu/drm/drm_gem_dma_helper.c +1
-1@@ -582,7 +582,7 @@ drm_gem_dma_prime_import_sg_table_vmap(struct drm_device *dev, ret =dma_buf_vmap_unlocked (attach->dmabuf, &map);if (ret) { -DRM_ERROR ("Failed to vmap PRIME buffer\n" ); +drm_err (dev,"Failed to vmap PRIME buffer\n" );return ERR_PTR (ret); }
Signature · 7 lines
-- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)