From 04dfe19a5ed683e91d8285df5be1dbde2f2f39af Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Fri, 7 May 2021 20:57:09 +0200 Subject: drm: Mark AGP implementation and ioctls as legacy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only UMs drivers use DRM's core AGP code and ioctls. Mark the icotls as legacy. Add the _legacy_ infix to all AGP functions. Move the declarations to the public and internal legacy header files. The agp field in struct drm_device is now located in the structure's legacy section. Adapt drivers to the changes. AGP code now depends on CONFIG_DRM_LEGACY. Signed-off-by: Thomas Zimmermann Reviewed-by: Alex Deucher Acked-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20210507185709.22797-5-tzimmermann@suse.de --- drivers/gpu/drm/drm_ioc32.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'drivers/gpu/drm/drm_ioc32.c') diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c index 33390f02f5eb..d29907955ff7 100644 --- a/drivers/gpu/drm/drm_ioc32.c +++ b/drivers/gpu/drm/drm_ioc32.c @@ -31,7 +31,6 @@ #include #include -#include #include #include @@ -619,6 +618,7 @@ static int compat_drm_dma(struct file *file, unsigned int cmd, } #endif +#if IS_ENABLED(CONFIG_DRM_LEGACY) #if IS_ENABLED(CONFIG_AGP) typedef struct drm_agp_mode32 { u32 mode; /**< AGP mode */ @@ -633,7 +633,7 @@ static int compat_drm_agp_enable(struct file *file, unsigned int cmd, if (get_user(mode.mode, &argp->mode)) return -EFAULT; - return drm_ioctl_kernel(file, drm_agp_enable_ioctl, &mode, + return drm_ioctl_kernel(file, drm_legacy_agp_enable_ioctl, &mode, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY); } @@ -659,7 +659,7 @@ static int compat_drm_agp_info(struct file *file, unsigned int cmd, struct drm_agp_info info; int err; - err = drm_ioctl_kernel(file, drm_agp_info_ioctl, &info, DRM_AUTH); + err = drm_ioctl_kernel(file, drm_legacy_agp_info_ioctl, &info, DRM_AUTH); if (err) return err; @@ -698,7 +698,7 @@ static int compat_drm_agp_alloc(struct file *file, unsigned int cmd, request.size = req32.size; request.type = req32.type; - err = drm_ioctl_kernel(file, drm_agp_alloc_ioctl, &request, + err = drm_ioctl_kernel(file, drm_legacy_agp_alloc_ioctl, &request, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY); if (err) return err; @@ -706,7 +706,7 @@ static int compat_drm_agp_alloc(struct file *file, unsigned int cmd, req32.handle = request.handle; req32.physical = request.physical; if (copy_to_user(argp, &req32, sizeof(req32))) { - drm_ioctl_kernel(file, drm_agp_free_ioctl, &request, + drm_ioctl_kernel(file, drm_legacy_agp_free_ioctl, &request, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY); return -EFAULT; } @@ -723,7 +723,7 @@ static int compat_drm_agp_free(struct file *file, unsigned int cmd, if (get_user(request.handle, &argp->handle)) return -EFAULT; - return drm_ioctl_kernel(file, drm_agp_free_ioctl, &request, + return drm_ioctl_kernel(file, drm_legacy_agp_free_ioctl, &request, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY); } @@ -744,7 +744,7 @@ static int compat_drm_agp_bind(struct file *file, unsigned int cmd, request.handle = req32.handle; request.offset = req32.offset; - return drm_ioctl_kernel(file, drm_agp_bind_ioctl, &request, + return drm_ioctl_kernel(file, drm_legacy_agp_bind_ioctl, &request, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY); } @@ -757,12 +757,11 @@ static int compat_drm_agp_unbind(struct file *file, unsigned int cmd, if (get_user(request.handle, &argp->handle)) return -EFAULT; - return drm_ioctl_kernel(file, drm_agp_unbind_ioctl, &request, + return drm_ioctl_kernel(file, drm_legacy_agp_unbind_ioctl, &request, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY); } #endif /* CONFIG_AGP */ -#if IS_ENABLED(CONFIG_DRM_LEGACY) typedef struct drm_scatter_gather32 { u32 size; /**< In bytes -- will round to page boundary */ u32 handle; /**< Used for mapping / unmapping */ @@ -935,7 +934,6 @@ static struct { DRM_IOCTL32_DEF(DRM_IOCTL_GET_SAREA_CTX, compat_drm_getsareactx), DRM_IOCTL32_DEF(DRM_IOCTL_RES_CTX, compat_drm_resctx), DRM_IOCTL32_DEF(DRM_IOCTL_DMA, compat_drm_dma), -#endif #if IS_ENABLED(CONFIG_AGP) DRM_IOCTL32_DEF(DRM_IOCTL_AGP_ENABLE, compat_drm_agp_enable), DRM_IOCTL32_DEF(DRM_IOCTL_AGP_INFO, compat_drm_agp_info), @@ -944,6 +942,7 @@ static struct { DRM_IOCTL32_DEF(DRM_IOCTL_AGP_BIND, compat_drm_agp_bind), DRM_IOCTL32_DEF(DRM_IOCTL_AGP_UNBIND, compat_drm_agp_unbind), #endif +#endif #if IS_ENABLED(CONFIG_DRM_LEGACY) DRM_IOCTL32_DEF(DRM_IOCTL_SG_ALLOC, compat_drm_sg_alloc), DRM_IOCTL32_DEF(DRM_IOCTL_SG_FREE, compat_drm_sg_free), -- cgit v1.2.3