On 9/23/26 21:33, Shahyan Soltani wrote:
> From: Pierre-Eric Pelloux-Prayer <[email protected]>
> 
> Remove the entire amdgpu_drm_ioctl handler system in favor of drm_ioctl.

Please add a bit more commit message, something like:

Each individual IOCTL should now handle runtime PM itself. Fingers crossed that 
we haven't missed anything.

With that done please push patches #1-#7 to amd-staging-drm-next, I think they 
are ready to land now.

Thanks,
Christian.

> 
> Signed-off-by: Pierre-Eric Pelloux-Prayer <[email protected]>
> v2 (Shahyan): Added commit description
> Signed-off-by: Shahyan Soltani <[email protected]>
> Reviewed-by: Christian König <[email protected]>
> ---
>  drivers/gpu/drm/amd/amdgpu/Makefile       |  1 -
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c   | 23 +-----------
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.h   |  6 ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ioc32.c | 45 -----------------------
>  4 files changed, 2 insertions(+), 73 deletions(-)
>  delete mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_ioc32.c
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/Makefile 
> b/drivers/gpu/drm/amd/amdgpu/Makefile
> index 7b08814a24da..d5ddf236a6f9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/Makefile
> +++ b/drivers/gpu/drm/amd/amdgpu/Makefile
> @@ -321,7 +321,6 @@ include $(FULL_AMD_PATH)/acp/Makefile
>  amdgpu-y += $(AMD_ACP_FILES)
>  endif
>  
> -amdgpu-$(CONFIG_COMPAT) += amdgpu_ioc32.o
>  amdgpu-$(CONFIG_VGA_SWITCHEROO) += amdgpu_atpx_handler.o
>  amdgpu-$(CONFIG_ACPI) += amdgpu_acpi.o
>  amdgpu-$(CONFIG_HMM_MIRROR) += amdgpu_hmm.o
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 9c5e93cd3ee6..f51f03ae5241 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -3019,25 +3019,6 @@ static int amdgpu_drm_release(struct inode *inode, 
> struct file *filp)
>       return drm_release(inode, filp);
>  }
>  
> -long amdgpu_drm_ioctl(struct file *filp,
> -                   unsigned int cmd, unsigned long arg)
> -{
> -     struct drm_file *file_priv = filp->private_data;
> -     struct drm_device *dev;
> -     long ret;
> -
> -     dev = file_priv->minor->dev;
> -     ret = pm_runtime_get_sync(dev->dev);
> -     if (ret < 0)
> -             goto out;
> -
> -     ret = drm_ioctl(filp, cmd, arg);
> -
> -out:
> -     pm_runtime_put_autosuspend(dev->dev);
> -     return ret;
> -}
> -
>  static const struct dev_pm_ops amdgpu_pm_ops = {
>       .prepare = pm_sleep_ptr(amdgpu_pmops_prepare),
>       .complete = pm_sleep_ptr(amdgpu_pmops_complete),
> @@ -3070,12 +3051,12 @@ static const struct file_operations 
> amdgpu_driver_kms_fops = {
>       .open = drm_open,
>       .flush = amdgpu_flush,
>       .release = amdgpu_drm_release,
> -     .unlocked_ioctl = amdgpu_drm_ioctl,
> +     .unlocked_ioctl = drm_ioctl,
>       .mmap = drm_gem_mmap,
>       .poll = drm_poll,
>       .read = drm_read,
>  #ifdef CONFIG_COMPAT
> -     .compat_ioctl = amdgpu_kms_compat_ioctl,
> +     .compat_ioctl = drm_compat_ioctl,
>  #endif
>  #ifdef CONFIG_PROC_FS
>       .show_fdinfo = drm_show_fdinfo,
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.h 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.h
> index 2d86cc6f7f4d..6b06c0956e48 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.h
> @@ -43,10 +43,4 @@
>  
>  extern const struct drm_driver amdgpu_partition_driver;
>  
> -long amdgpu_drm_ioctl(struct file *filp,
> -                   unsigned int cmd, unsigned long arg);
> -
> -long amdgpu_kms_compat_ioctl(struct file *filp,
> -                          unsigned int cmd, unsigned long arg);
> -
>  #endif
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ioc32.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ioc32.c
> deleted file mode 100644
> index a1cbd7c3deb2..000000000000
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ioc32.c
> +++ /dev/null
> @@ -1,45 +0,0 @@
> -/*
> - * \file amdgpu_ioc32.c
> - *
> - * 32-bit ioctl compatibility routines for the AMDGPU DRM.
> - *
> - * \author Paul Mackerras <[email protected]>
> - *
> - * Copyright (C) Paul Mackerras 2005
> - * All Rights Reserved.
> - *
> - * Permission is hereby granted, free of charge, to any person obtaining a
> - * copy of this software and associated documentation files (the "Software"),
> - * to deal in the Software without restriction, including without limitation
> - * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> - * and/or sell copies of the Software, and to permit persons to whom the
> - * Software is furnished to do so, subject to the following conditions:
> - *
> - * The above copyright notice and this permission notice (including the next
> - * paragraph) shall be included in all copies or substantial portions of the
> - * Software.
> - *
> - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> - * THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
> - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> - * IN THE SOFTWARE.
> - */
> -#include <linux/compat.h>
> -
> -#include <drm/amdgpu_drm.h>
> -#include <drm/drm_ioctl.h>
> -
> -#include "amdgpu_drv.h"
> -
> -long amdgpu_kms_compat_ioctl(struct file *filp, unsigned int cmd, unsigned 
> long arg)
> -{
> -     unsigned int nr = DRM_IOCTL_NR(cmd);
> -
> -     if (nr < DRM_COMMAND_BASE)
> -             return drm_compat_ioctl(filp, cmd, arg);
> -
> -     return amdgpu_drm_ioctl(filp, cmd, arg);
> -}

Reply via email to