Commit 723dad97 authored by Tvrtko Ursulin's avatar Tvrtko Ursulin Committed by Simon Ser

drm: Replace DRM_DEBUG with drm_dbg_core in file and ioctl handling

Replace the deprecated macro with the per-device one.
Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Acked-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarSimon Ser <contact@emersion.fr>
Signed-off-by: default avatarSimon Ser <contact@emersion.fr>
Link: https://patchwork.freedesktop.org/patch/msgid/20221223112302.320097-1-tvrtko.ursulin@linux.intel.com
parent fe91e41a
...@@ -245,7 +245,7 @@ void drm_file_free(struct drm_file *file) ...@@ -245,7 +245,7 @@ void drm_file_free(struct drm_file *file)
dev = file->minor->dev; dev = file->minor->dev;
DRM_DEBUG("comm=\"%s\", pid=%d, dev=0x%lx, open_count=%d\n", drm_dbg_core(dev, "comm=\"%s\", pid=%d, dev=0x%lx, open_count=%d\n",
current->comm, task_pid_nr(current), current->comm, task_pid_nr(current),
(long)old_encode_dev(file->minor->kdev->devt), (long)old_encode_dev(file->minor->kdev->devt),
atomic_read(&dev->open_count)); atomic_read(&dev->open_count));
...@@ -340,8 +340,8 @@ static int drm_open_helper(struct file *filp, struct drm_minor *minor) ...@@ -340,8 +340,8 @@ static int drm_open_helper(struct file *filp, struct drm_minor *minor)
dev->switch_power_state != DRM_SWITCH_POWER_DYNAMIC_OFF) dev->switch_power_state != DRM_SWITCH_POWER_DYNAMIC_OFF)
return -EINVAL; return -EINVAL;
DRM_DEBUG("comm=\"%s\", pid=%d, minor=%d\n", current->comm, drm_dbg_core(dev, "comm=\"%s\", pid=%d, minor=%d\n",
task_pid_nr(current), minor->index); current->comm, task_pid_nr(current), minor->index);
priv = drm_file_alloc(minor); priv = drm_file_alloc(minor);
if (IS_ERR(priv)) if (IS_ERR(priv))
...@@ -450,11 +450,11 @@ EXPORT_SYMBOL(drm_open); ...@@ -450,11 +450,11 @@ EXPORT_SYMBOL(drm_open);
void drm_lastclose(struct drm_device * dev) void drm_lastclose(struct drm_device * dev)
{ {
DRM_DEBUG("\n"); drm_dbg_core(dev, "\n");
if (dev->driver->lastclose) if (dev->driver->lastclose)
dev->driver->lastclose(dev); dev->driver->lastclose(dev);
DRM_DEBUG("driver lastclose completed\n"); drm_dbg_core(dev, "driver lastclose completed\n");
if (drm_core_check_feature(dev, DRIVER_LEGACY)) if (drm_core_check_feature(dev, DRIVER_LEGACY))
drm_legacy_dev_reinit(dev); drm_legacy_dev_reinit(dev);
...@@ -485,7 +485,7 @@ int drm_release(struct inode *inode, struct file *filp) ...@@ -485,7 +485,7 @@ int drm_release(struct inode *inode, struct file *filp)
if (drm_dev_needs_global_mutex(dev)) if (drm_dev_needs_global_mutex(dev))
mutex_lock(&drm_global_mutex); mutex_lock(&drm_global_mutex);
DRM_DEBUG("open_count = %d\n", atomic_read(&dev->open_count)); drm_dbg_core(dev, "open_count = %d\n", atomic_read(&dev->open_count));
drm_close_helper(filp); drm_close_helper(filp);
......
...@@ -972,6 +972,7 @@ long drm_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) ...@@ -972,6 +972,7 @@ long drm_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{ {
unsigned int nr = DRM_IOCTL_NR(cmd); unsigned int nr = DRM_IOCTL_NR(cmd);
struct drm_file *file_priv = filp->private_data; struct drm_file *file_priv = filp->private_data;
struct drm_device *dev = file_priv->minor->dev;
drm_ioctl_compat_t *fn; drm_ioctl_compat_t *fn;
int ret; int ret;
...@@ -986,14 +987,14 @@ long drm_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) ...@@ -986,14 +987,14 @@ long drm_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
if (!fn) if (!fn)
return drm_ioctl(filp, cmd, arg); return drm_ioctl(filp, cmd, arg);
DRM_DEBUG("comm=\"%s\", pid=%d, dev=0x%lx, auth=%d, %s\n", drm_dbg_core(dev, "comm=\"%s\", pid=%d, dev=0x%lx, auth=%d, %s\n",
current->comm, task_pid_nr(current), current->comm, task_pid_nr(current),
(long)old_encode_dev(file_priv->minor->kdev->devt), (long)old_encode_dev(file_priv->minor->kdev->devt),
file_priv->authenticated, file_priv->authenticated,
drm_compat_ioctls[nr].name); drm_compat_ioctls[nr].name);
ret = (*fn)(filp, cmd, arg); ret = (*fn)(filp, cmd, arg);
if (ret) if (ret)
DRM_DEBUG("ret = %d\n", ret); drm_dbg_core(dev, "ret = %d\n", ret);
return ret; return ret;
} }
EXPORT_SYMBOL(drm_compat_ioctl); EXPORT_SYMBOL(drm_compat_ioctl);
...@@ -440,7 +440,7 @@ static int drm_setversion(struct drm_device *dev, void *data, struct drm_file *f ...@@ -440,7 +440,7 @@ static int drm_setversion(struct drm_device *dev, void *data, struct drm_file *f
int drm_noop(struct drm_device *dev, void *data, int drm_noop(struct drm_device *dev, void *data,
struct drm_file *file_priv) struct drm_file *file_priv)
{ {
DRM_DEBUG("\n"); drm_dbg_core(dev, "\n");
return 0; return 0;
} }
EXPORT_SYMBOL(drm_noop); EXPORT_SYMBOL(drm_noop);
...@@ -856,7 +856,7 @@ long drm_ioctl(struct file *filp, ...@@ -856,7 +856,7 @@ long drm_ioctl(struct file *filp,
out_size = 0; out_size = 0;
ksize = max(max(in_size, out_size), drv_size); ksize = max(max(in_size, out_size), drv_size);
DRM_DEBUG("comm=\"%s\" pid=%d, dev=0x%lx, auth=%d, %s\n", drm_dbg_core(dev, "comm=\"%s\" pid=%d, dev=0x%lx, auth=%d, %s\n",
current->comm, task_pid_nr(current), current->comm, task_pid_nr(current),
(long)old_encode_dev(file_priv->minor->kdev->devt), (long)old_encode_dev(file_priv->minor->kdev->devt),
file_priv->authenticated, ioctl->name); file_priv->authenticated, ioctl->name);
...@@ -865,7 +865,7 @@ long drm_ioctl(struct file *filp, ...@@ -865,7 +865,7 @@ long drm_ioctl(struct file *filp,
func = ioctl->func; func = ioctl->func;
if (unlikely(!func)) { if (unlikely(!func)) {
DRM_DEBUG("no function\n"); drm_dbg_core(dev, "no function\n");
retcode = -EINVAL; retcode = -EINVAL;
goto err_i1; goto err_i1;
} }
...@@ -894,7 +894,8 @@ long drm_ioctl(struct file *filp, ...@@ -894,7 +894,8 @@ long drm_ioctl(struct file *filp,
err_i1: err_i1:
if (!ioctl) if (!ioctl)
DRM_DEBUG("invalid ioctl: comm=\"%s\", pid=%d, dev=0x%lx, auth=%d, cmd=0x%02x, nr=0x%02x\n", drm_dbg_core(dev,
"invalid ioctl: comm=\"%s\", pid=%d, dev=0x%lx, auth=%d, cmd=0x%02x, nr=0x%02x\n",
current->comm, task_pid_nr(current), current->comm, task_pid_nr(current),
(long)old_encode_dev(file_priv->minor->kdev->devt), (long)old_encode_dev(file_priv->minor->kdev->devt),
file_priv->authenticated, cmd, nr); file_priv->authenticated, cmd, nr);
...@@ -902,8 +903,8 @@ long drm_ioctl(struct file *filp, ...@@ -902,8 +903,8 @@ long drm_ioctl(struct file *filp,
if (kdata != stack_kdata) if (kdata != stack_kdata)
kfree(kdata); kfree(kdata);
if (retcode) if (retcode)
DRM_DEBUG("comm=\"%s\", pid=%d, ret=%d\n", current->comm, drm_dbg_core(dev, "comm=\"%s\", pid=%d, ret=%d\n",
task_pid_nr(current), retcode); current->comm, task_pid_nr(current), retcode);
return retcode; return retcode;
} }
EXPORT_SYMBOL(drm_ioctl); EXPORT_SYMBOL(drm_ioctl);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment