public inbox for linux-kernel-mentees@lists.linux-foundation.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Athul Raj Kollareth <krathul3152@gmail.com>, michal.wajdeczko@intel.com
Cc: skhan@linuxfoundation.org, dri-devel@lists.freedesktop.org,
	linux-kernel-mentees@lists.linux.dev,
	linux-kernel@vger.kernel.org, simona@ffwll.ch,
	mripard@kernel.org
Subject: Re: [PATCH v5] drm: Replace the deprecated DRM_* logging macros in gem helper files
Date: Mon, 15 Sep 2025 12:33:17 +0200	[thread overview]
Message-ID: <38570a2a-c01a-4cd3-a72d-8fa909b33348@suse.de> (raw)
In-Reply-To: <aLczDHV_yGnnRKbr@Terra>



Am 02.09.25 um 20:10 schrieb 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 <krathul3152@gmail.com>
> Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>

> ---
> 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(-)
>
> diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
> index 4a89b6acb6af..fb12cc2051d8 100644
> --- a/drivers/gpu/drm/drm_gem.c
> +++ b/drivers/gpu/drm/drm_gem.c
> @@ -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;
>   	}
>   
> diff --git a/drivers/gpu/drm/drm_gem_dma_helper.c b/drivers/gpu/drm/drm_gem_dma_helper.c
> index 4f0320df858f..a507cf517015 100644
> --- a/drivers/gpu/drm/drm_gem_dma_helper.c
> +++ b/drivers/gpu/drm/drm_gem_dma_helper.c
> @@ -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);
>   	}
>   

-- 
--
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)



  reply	other threads:[~2025-09-15 10:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-02 15:00 [PATCH v4 RESEND] drm: Replace the deprecated DRM_* logging macros in gem helper files Athul Raj Kollareth
2025-09-02 15:35 ` Michal Wajdeczko
2025-09-02 17:45   ` Athul Raj Kollareth
2025-09-02 18:10   ` [PATCH v5] " Athul Raj Kollareth
2025-09-15 10:33     ` Thomas Zimmermann [this message]
2025-09-15 10:38     ` Thomas Zimmermann

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=38570a2a-c01a-4cd3-a72d-8fa909b33348@suse.de \
    --to=tzimmermann@suse.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=krathul3152@gmail.com \
    --cc=linux-kernel-mentees@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.wajdeczko@intel.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=skhan@linuxfoundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox